江湖梦网游戏服务平台

 找回密码
 免费注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 3457|回复: 0

[搬运汉化] 称号

[复制链接]

449

帖子

41

精华

25

贡献

江湖英豪

检察者

Rank: 5Rank: 5Rank: 5

积分
7217
发表于 2020-2-24 13:13 | 显示全部楼层 |阅读模式

马上注册,享用更多精彩。

您需要 登录 才可以下载或查看,没有帐号?免费注册

x
* 称号の設定方法:
*  アクターのメモ 記述例:
*   <Title1:ブロンズナイト,2,1,2,3,4,5,6,7,8,12:13>
*   <Title2:シルバーナイト,3,1,2,3,4,5,6,7,8,12:13:14>
*   …
*   <Title10:ゴールドナイト,99,1,2,3,4,5,6,7,8,12:13:14:15>
*  ※称号は各アクターにつき99番まで指定可能。
*  ※左から順に、称号名,称号獲得レベル,HP増分,MP増分,攻撃力増分,…,運増分,スキル習得。
*  ※スキル習得は、":"で複数個をつなげて記述。12:13:14:15なら
*   スキル12,13,14,15を使用できる。スキルを習得させる必要が無い場合は、0と記述。
*  ※称号をレベルアップで獲得させたくない場合は、称号獲得レベルを100以上に指定する。

機翻
*如何設置標題:
  *演員說明示例註釋
  * <標題1:青銅之夜,2、1、2、3、4、5、6、7、8、12:13>
  * <標題2:銀騎士,3、1、2、3、4、5、6、7、8、12:13:14>
  *…
  * <標題10:金騎士,99,1,2,3,4,5,6,7,8,12:13:14:15>
  * *每個演員最多可以指定99個標題。
  *※從左至右,標題名稱,標題獲取級別,HP增量,MP增量,攻擊力增量,...,運氣增量,技能獲取。
  * *通過將多個數字與“:”連接來描述技能獲得。 12:13:14:15
  *您可以使用技能12,13,14,15。 如果不需要學習技能,請輸入0。
  *※如果您不想按級別賺取頭銜,請將頭銜獲取級別指定為100或更高。

  1. //=============================================================================
  2. // WD_TitleSystem.js v1.01
  3. //=============================================================================

  4. /*:ja
  5. * @plugindesc 称号システムです。称号によりステータスやスキルを追加します。(v1.01)
  6. * @author Izumi (http://izumiwhite.web.fc2.com/)
  7. *
  8. * @param Title Call
  9. * @desc 称号の呼び方。
  10. * (String, デフォルト:称号)
  11. * @default 称号
  12. *
  13. * @param Title Getmess
  14. * @desc 称号獲得時のメッセージ。
  15. * (String, デフォルト:%1の%2を獲得した!)
  16. * @default %1の%2を獲得した!
  17. *
  18. * @param Draw Title
  19. * @desc 職業か二つ名の代わりに称号を表示するかどうか。
  20. * (1 or 2 or 0, デフォルト:1) ※1⇒職業、2⇒二つ名
  21. * @default 1
  22. *
  23. * @param Non Titles
  24. * @desc 称号無しの場合に表示する称号名。
  25. * (String, デフォルト: )
  26. * @default  
  27. * @help
  28. *
  29. * @param Level Change
  30. * @desc レベルアップによって自動で称号を変更するかどうか。
  31. * (1 or 0, デフォルト:1)
  32. * @default 1
  33. *
  34. * @param Use Command
  35. * @desc 称号選択メニューをメニューコマンドに追加するかどうか。
  36. * (1 or 0, デフォルト:1)
  37. * @default 1
  38. *
  39. * @param Selectable Notitles
  40. * @desc 称号選択メニューでの称号無しの選択を可能にするかどうか。
  41. * (1 or 0, デフォルト:1)
  42. * @default 1
  43. *
  44. * @param Changeable Actors
  45. * @desc 称号選択メニューでQ/Wキーでのアクター切り替えを許可するか。
  46. * (1 or 0, デフォルト:1)
  47. * @default 1
  48. *
  49. * @param List Rows
  50. * @desc 称号選択ウィンドウの行数。
  51. * (1 ~ 10, デフォルト:3)
  52. * @default 3
  53. *
  54. * @param List Columns
  55. * @desc 称号選択ウィンドウの列数。
  56. * (1 ~ 5, デフォルト:3)
  57. * @default 3
  58. *
  59. * @help
  60. *
  61. * プラグインコマンド:
  62. *   TitleSystem add 1 2      # アクター1に称号2を追加
  63. *   TitleSystem remove 1 3   # アクター1から称号3を削除
  64. *   TitleSystem change 1 2   # アクター1の称号を称号2に変更
  65. *   TitleSystem open 0       # 0番(先頭)のアクターの称号選択メニューを表示。
  66. *   TitleSystem openbyid 1   # アクター1の称号選択メニューを表示。
  67. *
  68. * 称号の設定方法:
  69. *  アクターのメモ 記述例:
  70. *   <Title1:ブロンズナイト,2,1,2,3,4,5,6,7,8,12:13>
  71. *   <Title2:シルバーナイト,3,1,2,3,4,5,6,7,8,12:13:14>
  72. *   …
  73. *   <Title10:ゴールドナイト,99,1,2,3,4,5,6,7,8,12:13:14:15>
  74. *  ※称号は各アクターにつき99番まで指定可能。
  75. *  ※左から順に、称号名,称号獲得レベル,HP増分,MP増分,攻撃力増分,…,運増分,スキル習得。
  76. *  ※スキル習得は、":"で複数個をつなげて記述。12:13:14:15なら
  77. *   スキル12,13,14,15を使用できる。スキルを習得させる必要が無い場合は、0と記述。
  78. *  ※称号をレベルアップで獲得させたくない場合は、称号獲得レベルを100以上に指定する。
  79. *
  80. */

  81. (function() {

  82.     var parameters = PluginManager.parameters('WD_TitleSystem');
  83.     var titleCall = parameters['Title Call'];
  84.     var titleGetmess = parameters['Title Getmess'];
  85.     var flagDrawTitle = Number(parameters['Draw Title'] || 1);
  86.     var nonTitlesName = parameters['Non Titles'];
  87.     var flagLevelChange = Number(parameters['Level Change'] || 1);
  88.     var flagUseCommand = Number(parameters['Use Command'] || 1);
  89.     var flagSelectableNotitles = Number(parameters['Selectable Notitles'] || 1);
  90.     var flagChangeableActors = Number(parameters['Changeable Actors'] || 1);
  91.     var listRows = Number(parameters['List Rows'] || 3);
  92.     var listColumns = Number(parameters['List Columns'] || 3);

  93.     var _Game_Interpreter_pluginCommand =
  94.             Game_Interpreter.prototype.pluginCommand;
  95.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  96.         _Game_Interpreter_pluginCommand.call(this, command, args);
  97.         if (command === 'TitleSystem') {
  98.             switch (args[0]) {
  99.             case 'open':
  100.                 $gameParty.setMenuActor($gameParty.allMembers()[Number(args[1])]);
  101.                 SceneManager.push(Scene_TitleItem);
  102.                 break;
  103.             case 'openbyid':
  104.                 $gameParty.setMenuActor($gameActors.actor(Number(args[1])));
  105.                 SceneManager.push(Scene_TitleItem);
  106.                 break;
  107.             case 'add':
  108.                 $gameSystem.addToTitleItem(Number(args[1]),Number(args[2]));
  109.                 break;
  110.             case 'remove':
  111.                 $gameSystem.removeFromTitleItem(Number(args[1]),Number(args[2]));
  112.                 break;
  113.             case 'clear':
  114.                 $gameSystem.clearTitleItem();
  115.                 break;
  116.             case 'change':
  117.                 $gameSystem.changeTitleItem(Number(args[1]),Number(args[2]));
  118.                 break;
  119.             }
  120.         }
  121.     };

  122.     Game_System.prototype.addToTitleItem = function(actorId,titleId) {
  123.         $gameActors.actor(actorId).changeTitleFlag(titleId, true);
  124.     };

  125.     Game_System.prototype.removeFromTitleItem = function(actorId,titleId) {
  126.         $gameActors.actor(actorId).changeTitleFlag(titleId, false);
  127.     };

  128.     Game_System.prototype.changeTitleItem = function(actorId,titleId) {
  129.         $gameActors.actor(actorId).setTitleId(titleId);
  130.     };


  131.     var _Game_Actor_setup = Game_Actor.prototype.setup;
  132.     Game_Actor.prototype.setup = function(actorId) {
  133.         _Game_Actor_setup.call(this, actorId);
  134.         this._titleId = 0;
  135.         this._titelItemFlags = [];
  136.     };


  137.     Game_Actor.prototype.setTitleId = function(titleId) {
  138.         this._titleId = titleId;
  139.         if(this.hp > this.mhp){
  140.             this._hp = this.mhp;
  141.         }
  142.         if(this.mp > this.mmp){
  143.             this._mp = this.mmp;
  144.         }
  145.     };

  146.     Game_Actor.prototype.titleId = function() {
  147.         return this._titleId;
  148.     };


  149.     Game_Actor.prototype.changeTitleFlag = function(titleId, flag) {
  150.         if (!this._titelItemFlags) {
  151.             this.clearTitleItemFlags();
  152.         }
  153.         this._titelItemFlags[titleId] = flag;
  154.     };

  155.     Game_Actor.prototype.clearTitleItemFlags = function() {
  156.         this._titelItemFlags = [];
  157.     };

  158.     Game_Actor.prototype.titleItemFlags = function() {
  159.         return this._titelItemFlags;
  160.     };

  161.     Game_Actor.prototype.titleItemName = function() {
  162.         actor_meta_title = this.metaTitle();
  163.         if (actor_meta_title) {
  164.             return actor_meta_title.split(",")[0];
  165.         }
  166.         return nonTitlesName;
  167.     };

  168.     var _Game_Actor_paramPlus = Game_Actor.prototype.paramPlus;
  169.     Game_Actor.prototype.paramPlus = function(paramId) {
  170.         var value = _Game_Actor_paramPlus.call(this, paramId);
  171.         actor_meta_title = this.metaTitle();
  172.         if (actor_meta_title) {
  173.             value += Number(actor_meta_title.split(",")[paramId+2]);
  174.         }
  175.         return value;
  176.     };

  177.     Game_Actor.prototype.metaTitle = function() {
  178.         actor_meta_title = this.metaTitleFromId(this._titleId);      
  179.         return actor_meta_title;
  180.     };

  181.     Game_Actor.prototype.metaTitleFromId = function(index) {
  182.         actor_meta = $dataActors[this._actorId].meta;
  183.         actor_meta_title = false;
  184.         actor_meta_title = actor_meta["Title"+String(index)];
  185.         return actor_meta_title;
  186.     };

  187.     var _Game_Actor_skills = Game_Actor.prototype.skills;
  188.     Game_Actor.prototype.skills = function() {
  189.         var list = [];
  190.         list = _Game_Actor_skills.call(this);
  191.         add_list = this.titleSkills();
  192.         list =list.concat(add_list);

  193.         return list;
  194.     };

  195.     Game_Actor.prototype.titleSkills = function() {
  196.         var list = [];
  197.         actor_meta_title = this.metaTitle();
  198.         var list_add = false
  199.         if (actor_meta_title) {
  200.             list_add = actor_meta_title.split(",")[10];
  201.             if (list_add&&list_add!=0){
  202.                 list_add = list_add.split(":");
  203.                 for (i=0; i<list_add.length; i++){
  204.                     list.push($dataSkills[list_add[i]]);
  205.                 }
  206.             }
  207.         }
  208.         return list;
  209.     };

  210.     //再定義
  211.     Window_Base.prototype.drawActorClass = function(actor, x, y, width) {
  212.         width = width || 168;
  213.         this.resetTextColor();
  214.         if (flagDrawTitle==1){
  215.             this.drawText(actor.titleItemName(), x, y, width);
  216.         }else{
  217.             this.drawText(actor.currentClass().name, x, y, width);
  218.         }
  219.     };

  220.     //再定義
  221.     Window_Base.prototype.drawActorNickname = function(actor, x, y, width) {
  222.         width = width || 270;
  223.         this.resetTextColor();
  224.         if (flagDrawTitle==2){
  225.             this.drawText(actor.titleItemName(), x, y, width);
  226.         }else{
  227.             this.drawText(actor.nickname(), x, y, width);
  228.         }
  229.     };

  230.     Window_Base.prototype.drawActorTitle = function(actor, x, y, width) {
  231.         width = width || 168;
  232.         this.resetTextColor();
  233.         this.drawText(actor.titleItemName(), x, y, width);
  234.     };

  235.     //再定義
  236.     Game_Actor.prototype.changeExp = function(exp, show) {
  237.         this._exp[this._classId] = Math.max(exp, 0);
  238.         var lastLevel = this._level;
  239.         var lastSkills = this.skills();
  240.         var newTitleItemFlags = []; //add
  241.         while (!this.isMaxLevel() && this.currentExp() >= this.nextLevelExp()) {
  242.             this.levelUp();
  243.             newTitleItemFlags = this.getNewTitleItemFlags(newTitleItemFlags);
  244.         }
  245.         while (this.currentExp() < this.currentLevelExp()) {
  246.             this.levelDown();
  247.         }
  248.         if (show && this._level > lastLevel) {
  249.             this.displayLevelUp(this.findNewSkills(lastSkills));
  250.             this.displayNewTitleFlag(newTitleItemFlags);
  251.         }
  252.         this.refresh();
  253.     };


  254.     Game_Actor.prototype.getNewTitleItemFlags = function(newTitleItemFlags) {
  255.         for (i=1; i<=99; i++){
  256.             actor_meta_title = this.metaTitleFromId(i);
  257.             if (actor_meta_title){
  258.                 title_level = Number(actor_meta_title.split(",")[1]);
  259.                 if (title_level<=this._level) {
  260.                     if(!this._titelItemFlags[i]){
  261.                         newTitleItemFlags[i] = true;
  262.                         this.changeTitleFlag(i, true);
  263.                     }
  264.                 }
  265.             }
  266.         }
  267.         return newTitleItemFlags;
  268.     };

  269.     Game_Actor.prototype.displayNewTitleFlag = function(newTitleItemFlags) {
  270.         for (i=1; i<=99; i++){
  271.             if (newTitleItemFlags[i]){
  272.                 actor_meta_title = this.metaTitleFromId(i);
  273.                 if (actor_meta_title) {
  274.                     titleName = actor_meta_title.split(",")[0];
  275.                 }
  276.                 if (flagLevelChange==1){
  277.                     this.setTitleId(i);
  278.                 }
  279.                 var text = titleGetmess;
  280.                 text = text.replace("%1", titleName);
  281.                 text = text.replace("%2", titleCall);
  282.                 $gameMessage.add(text);
  283.             }
  284.         }
  285.     };





  286. //以下、メニューウィンドウ用

  287.     var _Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  288.     Scene_Menu.prototype.createCommandWindow = function() {
  289.         _Scene_Menu_createCommandWindow.call(this);
  290.         if(flagUseCommand){
  291.             this._commandWindow.setHandler('titleitem', this.commandPersonal.bind(this));
  292.         }
  293.     };

  294.     var _Scene_Menu_onPersonalOk = Scene_Menu.prototype.onPersonalOk;
  295.     Scene_Menu.prototype.onPersonalOk = function() {
  296.         _Scene_Menu_onPersonalOk.call(this);
  297.         switch (this._commandWindow.currentSymbol()) {
  298.         case 'titleitem':
  299.             SceneManager.push(Scene_TitleItem);
  300.             break;
  301.         }
  302.     };   

  303.     var _Window_MenuCommand_addMainCommands = Window_MenuCommand.prototype.addMainCommands;
  304.     Window_MenuCommand.prototype.addMainCommands = function() {
  305.         _Window_MenuCommand_addMainCommands.call(this);
  306.         var enabled = this.areMainCommandsEnabled();
  307.         if(flagUseCommand){
  308.             if (this.needsCommand('titleitem')) {
  309.                 this.addCommand(titleCall, 'titleitem', enabled);
  310.              }
  311.         }
  312.     };


  313. //-----------------------------------------------------------------------------
  314. // Scene_TitleItem
  315. //
  316. // The scene class of the titlechange screen.

  317.     function Scene_TitleItem() {
  318.         this.initialize.apply(this, arguments);
  319.     }

  320.     Scene_TitleItem.prototype = Object.create(Scene_MenuBase.prototype);
  321.     Scene_TitleItem.prototype.constructor = Scene_TitleItem;

  322.     Scene_TitleItem.prototype.initialize = function() {
  323.         Scene_MenuBase.prototype.initialize.call(this);
  324.     };

  325.     Scene_TitleItem.prototype.create = function() {
  326.         Scene_MenuBase.prototype.create.call(this);
  327.         this.createStatusWindow();
  328.         this.createTitleItemWindow();
  329.         this.refreshActor();
  330.     };

  331.     Scene_TitleItem.prototype.createStatusWindow = function() {
  332.         this._statusWindow = new Window_TitleItemStatus(0, 0);
  333.         this.addWindow(this._statusWindow);
  334.     };

  335.     Scene_TitleItem.prototype.createTitleItemWindow = function() {
  336.         var wx = 0;
  337.         var wy = this._statusWindow.y + this._statusWindow.height;
  338.         var ww = Graphics.boxWidth;
  339.         var wh = Graphics.boxHeight - wy;
  340.         this._titleItemWindow = new Window_TitleItem(wx, wy, ww, wh);
  341.         this._titleItemWindow.setStatusWindow(this._statusWindow);
  342.         this._titleItemWindow.setHandler('ok',     this.onItemOk.bind(this));
  343.         this._titleItemWindow.setHandler('cancel',   this.popScene.bind(this));
  344.         if(flagChangeableActors){
  345.             this._titleItemWindow.setHandler('pagedown', this.nextActor.bind(this));
  346.             this._titleItemWindow.setHandler('pageup',   this.previousActor.bind(this));
  347.         }
  348.         this.addWindow(this._titleItemWindow);
  349.         this._titleItemWindow.activate();
  350.         this._titleItemWindow.select(0);
  351.     };

  352.     Scene_TitleItem.prototype.refreshActor = function() {
  353.         var actor = this.actor();
  354.         this._statusWindow.setActor(actor);
  355.         this._titleItemWindow.setActor(actor);
  356.         this._titleItemWindow.updateHelp();
  357.     };

  358.     Scene_TitleItem.prototype.onItemOk = function() {
  359.         SoundManager.playEquip();
  360.         this.actor().setTitleId(this._titleItemWindow.item())
  361.         this._titleItemWindow.refresh();
  362.         this._statusWindow.refresh();
  363.         this._titleItemWindow.activate();
  364.     };

  365.     Scene_TitleItem.prototype.onActorChange = function() {
  366.         this.refreshActor();
  367.     };

  368.     Scene_TitleItem.prototype.nextActor = function() {
  369.         Scene_MenuBase.prototype.nextActor.call(this);
  370.         this._titleItemWindow.activate();
  371.         this._titleItemWindow.select(0);   
  372.     };

  373.     Scene_TitleItem.prototype.previousActor = function() {
  374.         Scene_MenuBase.prototype.previousActor.call(this);
  375.         this._titleItemWindow.activate();
  376.         this._titleItemWindow.select(0);
  377.     };


  378. //-----------------------------------------------------------------------------
  379. // Window_TitleItemStatus
  380. //
  381. // The window for displaying parameter changes on the titlechange screen.

  382.     function Window_TitleItemStatus() {
  383.         this.initialize.apply(this, arguments);
  384.     }

  385.     Window_TitleItemStatus.prototype = Object.create(Window_Base.prototype);
  386.     Window_TitleItemStatus.prototype.constructor = Window_TitleItemStatus;

  387.     Window_TitleItemStatus.prototype.initialize = function(x, y) {
  388.         var width = this.windowWidth();
  389.         var height = this.windowHeight();
  390.         Window_Base.prototype.initialize.call(this, x, y, width, height);
  391.         this._actor = null;
  392.         this._tempActor = null;
  393.         this.refresh();
  394.     };

  395.     Window_TitleItemStatus.prototype.windowWidth = function() {
  396.         return Graphics.boxWidth;
  397.     };

  398.     Window_TitleItemStatus.prototype.windowHeight = function() {
  399.         return Graphics.boxHeight - this.fittingHeight(listRows);
  400.     };

  401.     Window_TitleItemStatus.prototype.numVisibleRows = function() {
  402.         return 7;
  403.     };

  404.     Window_TitleItemStatus.prototype.setActor = function(actor) {
  405.         if (this._actor !== actor) {
  406.             this._actor = actor;
  407.             this.refresh();
  408.         }
  409.     };

  410.     Window_TitleItemStatus.prototype.refresh = function() {
  411.         this.contents.clear();
  412.         if (this._actor) {
  413.             this.drawActorName(this._actor, this.textPadding(), 0);
  414.             for (var i = 0; i < 8; i++) {
  415.                 this.drawItem(32+i%2*320, this.lineHeight() * (1 + Math.floor(i/2)), i);
  416.             }
  417.             this.drawActorClassChange(240, 0);
  418.             this.drawActorSkillChange(0, 192);
  419.         }
  420.     };

  421.     Window_TitleItemStatus.prototype.setTempActor = function(tempActor) {
  422.         if (this._tempActor !== tempActor) {
  423.             this._tempActor = tempActor;
  424.             this.refresh();
  425.         }
  426.     };

  427.     Window_TitleItemStatus.prototype.drawItem = function(x, y, paramId) {
  428.         this.drawParamName(x + this.textPadding(), y, paramId);
  429.         if (this._actor) {
  430.             this.drawCurrentParam(x + 140, y, paramId);
  431.         }
  432.         this.drawRightArrow(x + 188, y);
  433.         if (this._tempActor) {
  434.             if (this._actor._titleId != this._tempActor._titleId){
  435.                 this.drawNewParam(x + 222, y, paramId);
  436.             }
  437.         }
  438.     };

  439.     Window_TitleItemStatus.prototype.drawActorClassChange = function(x, y) {
  440.         this.drawActorTitle(this._actor, x, y, 168)
  441.         this.drawRightArrow(x + 168 + 16, y);
  442.         if (this._tempActor) {
  443.             if (this._actor._titleId != this._tempActor._titleId){
  444.                 this.drawActorTitle(this._tempActor, x + 168 + 32 + 48, y, 168);
  445.              }
  446.         }
  447.     };

  448.     Window_TitleItemStatus.prototype.drawActorSkillChange = function(x, y) {
  449.         if (this._tempActor) {
  450.             this.changeTextColor(this.systemColor());
  451.             this.drawText("追加スキル", x, y, 240);
  452.             skills = this._tempActor.titleSkills();
  453.             var costWidth = this.costWidth();
  454.             var width = Graphics.boxWidth/2 - this.textPadding() - 48;
  455.             var maxskillid = 2 * (9-listRows);
  456.             if(skills){
  457.             for (i=0; i<skills.length; i++){
  458.                 skill = skills[i];
  459.                 if(skills.length>maxskillid&&i==maxskillid-1){
  460.                     this.changeTextColor(this.normalColor());
  461.                     this.drawText("etc", x+i%2*(width+48), y+this.lineHeight()*(1 + Math.floor(i/2)), width - costWidth);
  462.                 }else if(i<maxskillid-1){
  463.                     this.drawItemName(skill, x+i%2*(width+48), y+this.lineHeight()*(1 + Math.floor(i/2)), width - costWidth);
  464.                     this.drawSkillCost(skill, x+i%2*(width+48), y+this.lineHeight()*(1 + Math.floor(i/2)), width);
  465.                 }
  466.             }
  467.             }
  468.         }
  469.     };

  470.     Window_TitleItemStatus.prototype.drawSkillCost = function(skill, x, y, width) {
  471.         if (this._actor.skillTpCost(skill) > 0) {
  472.             this.changeTextColor(this.tpCostColor());
  473.             this.drawText(this._actor.skillTpCost(skill), x, y, width, 'right');
  474.         } else if (this._actor.skillMpCost(skill) > 0) {
  475.             this.changeTextColor(this.mpCostColor());
  476.             this.drawText(this._actor.skillMpCost(skill), x, y, width, 'right');
  477.         }
  478.     };

  479.     Window_TitleItemStatus.prototype.costWidth = function() {
  480.         return this.textWidth('000');
  481.     };

  482.     Window_TitleItemStatus.prototype.drawParamName = function(x, y, paramId) {
  483.         this.changeTextColor(this.systemColor());
  484.         this.drawText(TextManager.param(paramId), x, y, 120);
  485.     };

  486.     Window_TitleItemStatus.prototype.drawCurrentParam = function(x, y, paramId) {
  487.         this.resetTextColor();
  488.         this.drawText(this._actor.param(paramId), x, y, 48, 'right');
  489.     };

  490.     Window_TitleItemStatus.prototype.drawRightArrow = function(x, y) {
  491.         this.changeTextColor(this.systemColor());
  492.         this.drawText('\u2192', x, y, 32, 'center');
  493.     };

  494.     Window_TitleItemStatus.prototype.drawNewParam = function(x, y, paramId) {
  495.         var newValue = this._tempActor.param(paramId);
  496.         var diffvalue = newValue - this._actor.param(paramId);
  497.         this.changeTextColor(this.paramchangeTextColor(diffvalue));
  498.         this.drawText(newValue, x, y, 48, 'right');
  499.     };


  500. //-----------------------------------------------------------------------------
  501. // Window_TitleItemList
  502. //
  503. // The window for selecting an title on the titlechange screen.

  504.     function Window_TitleItemList() {
  505.         this.initialize.apply(this, arguments);
  506.     }

  507.     Window_TitleItemList.prototype = Object.create(Window_ItemList.prototype);
  508.     Window_TitleItemList.prototype.constructor = Window_TitleItemList;


  509.     Window_TitleItemList.prototype.initialize = function(x, y, width, height) {
  510.         Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  511.         this._category = 'none';
  512.         this._data = [];
  513.         this._data2 = [];
  514.     };

  515.     Window_TitleItemList.prototype.setCategory = function(category) {
  516.         if (this._category !== category) {
  517.             this._category = category;
  518.             this.refresh();
  519.             this.resetScroll();
  520.         }
  521.     };

  522.     Window_TitleItemList.prototype.maxCols = function() {
  523.         return listColumns;
  524.     };

  525.     Window_TitleItemList.prototype.spacing = function() {
  526.         return 48;
  527.     };

  528.     Window_TitleItemList.prototype.maxItems = function() {
  529.         return this._data ? this._data.length : 1;
  530.     };

  531.     Window_TitleItemList.prototype.item = function() {
  532.         var index = this.index();
  533.         return this._data && index >= 0 ? this._data2[index] : null;
  534.     };

  535.     Window_TitleItemList.prototype.isCurrentItemEnabled = function() {
  536.         return this.isEnabled(this.item());
  537.     };

  538.     Window_TitleItemList.prototype.needsNumber = function() {
  539.         return true;
  540.     };

  541.     Window_TitleItemList.prototype.isEnabled = function(item) {
  542.         if (this._actor._titleId == item){
  543.             return false;
  544.         }else{
  545.             return true;
  546.         }
  547.     };

  548.     Window_TitleItemList.prototype.makeItemList = function() {
  549.         this._data = [];
  550.         this._data2 = [];
  551.         actor = this._actor
  552.         for (i=1; i<=99; i++){
  553.             if (actor._titelItemFlags[i]){
  554.                 actor_meta_title = actor.metaTitleFromId(i);
  555.                 if (actor_meta_title) {
  556.                     this._data.push(actor_meta_title.split(",")[0]);
  557.                     this._data2.push(i);
  558.                  }
  559.             }
  560.         }
  561.         if(flagSelectableNotitles||this._data.length==0){
  562.             this._data.push(nonTitlesName);
  563.             this._data2.push(0);
  564.          }
  565.     };

  566.     Window_TitleItemList.prototype.selectLast = function() {
  567.         this.select(0);
  568.     };

  569.     Window_TitleItemList.prototype.drawItem = function(index) {
  570.         var item = this._data[index];
  571.         var item2 = this._data2[index];
  572.         if (item) {
  573.             var rect = this.itemRect(index);
  574.             rect.width -= this.textPadding();
  575.             this.changePaintOpacity(this.isEnabled(item2));
  576.             this.drawText(item, rect.x, rect.y, rect.width);
  577.             this.changePaintOpacity(1);
  578.         }
  579.     };

  580.     Window_TitleItemList.prototype.refresh = function() {
  581.         this.makeItemList();
  582.         this.createContents();
  583.         this.drawAllItems();
  584.     };


  585. //-----------------------------------------------------------------------------
  586. // Window_TitleItem
  587. //
  588. // The window for selecting an equipment item on the equipment screen.

  589.     function Window_TitleItem() {
  590.         this.initialize.apply(this, arguments);
  591.     }

  592.     Window_TitleItem.prototype = Object.create(Window_TitleItemList.prototype);
  593.     Window_TitleItem.prototype.constructor = Window_TitleItem;

  594.     Window_TitleItem.prototype.initialize = function(x, y, width, height) {
  595.         Window_TitleItemList.prototype.initialize.call(this, x, y, width, height);
  596.         this._actor = null;
  597.         this._slotId = 0;
  598.     };

  599.     Window_TitleItem.prototype.setActor = function(actor) {
  600.         if (this._actor !== actor) {
  601.             this._actor = actor;
  602.             this.refresh();
  603.             this.resetScroll();
  604.         }
  605.     };

  606.     Window_TitleItem.prototype.setSlotId = function(slotId) {
  607.         if (this._slotId !== slotId) {
  608.             this._slotId = slotId;
  609.             this.refresh();
  610.             this.resetScroll();
  611.         }
  612.     };

  613.     Window_TitleItem.prototype.setStatusWindow = function(statusWindow) {
  614.         this._statusWindow = statusWindow;
  615.         this.callUpdateHelp();
  616.     };

  617.     Window_TitleItem.prototype.callUpdateHelp = function() {
  618.         if (this.active) {
  619.             this.updateHelp();
  620.         }
  621.     };

  622.     Window_TitleItem.prototype.updateHelp = function() {
  623.         if (this._actor && this._statusWindow) {
  624.             var actor = JsonEx.makeDeepCopy(this._actor);
  625.             actor.setTitleId(this.item())
  626.             this._statusWindow.setTempActor(actor);
  627.         }
  628.     };

  629.     Window_TitleItem.prototype.playOkSound = function() {
  630.     };




  631. })();
复制代码


213340eh9wg9d8t1hfhm9r.png
QQ群:135474765游戏群 [img]http://img2.17getfun.com/FhlesUf3VWxvhVFuc0qdBwYuanyt?imageMogr2/auto-orient/thumbnail/1080x%3E/format/jpg/
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|手机版|Archiver|小黑屋|江湖梦网 ( 粤ICP备18126133号-1 )

GMT+8, 2024-4-23 16:14 , Processed in 0.294012 second(s), 28 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表