查看: 5598|回复: 6

[原创发布] 自用的声望及额外货币显示插件——然而并没有什么乱用

[复制链接]
梦石
0
星屑
647
在线时间
165 小时
注册时间
2012-4-18
回帖
237
发表于 2016-2-24 17:30:09 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 salvareless 于 2016-2-24 23:08 编辑

RT,自己写自己用的,用途是用显示用变量做的声望,以及显示用变量做的额外货币,和自己用的一个叫做威望的变量。

如果要实现全部用途,需要具备YEP_ShopMenuCore和YEP_X_MoreCurrencies这两个插件。本插件可以配和这两个插件中实现的用变量当货币功能,提供其显示当作变量用的货币的持有数量。

如果只需要声望系统的话,直接屏蔽掉变量货币部分然后改改代码中的备注有//行高变化,那一行的值就行了。
以下是代码,代码中有具体的说明和注释方便大家修改。
最后,由于各种不会,所以代码写得很乱,而且很多数据,例如图标,声望和货币的名字都需要直接在插件中逐个改,而且最好根据游戏的进程一边设计剧情一边改,不然会出现显示上面的不和谐。因为每个框都在固定的地方,如果预先设好的话,可能会出现二号声望没开结果十号先开了,然后就会出现一大片空白,中间莫名其妙显示着一个声望框- -

  1. //=============================================================================
  2. // Salvareless Ownuse System
  3. // SOS_声望系统.js
  4. //=============================================================================
  5. //帮助区段
  6. //因为比较靠前的开关和变量大多情况下都有其他插件占用,所以本插件从62号变量开始,61留空写标注。
  7. //声望开关从62号到79号共18个
  8. //声望变量从62号到79号共18个
  9. //威望变量为80号。威望用以影响部分NPC物价,为0时不显示。
  10. //声望开关62号对应声望变量62号,往下一一对应。对应的开关开启式,才会显示对应的声望计数。
  11. //声望计数从负无穷到正六万,负可以无限负,正只到六万。
  12. //声望值达到0,100,800,5000,20000,60000时进入下一个声望阶段。
  13. //声望阶段依次是:仇恨,冷漠,友善,尊重,尊敬,崇敬,崇拜
  14. //变量货币需要配合YEP_ShopMenuCore和YEP_X_MoreCurrencies才更有意义,必然就只能做固定的物品兑换事件
  15. //变量当货币使用到的变量从42号开始到56号,一共15个。
  16. //已经设置货币当变量用时,大于0才会显示出来。
  17. //默认声望一共18个,变量货币15个,请随意根据需要删减,= =应该不会用到比这个数量更多了吧…………
  18. //由于各种不会,所以图标,和声望名字,货币名字什么的,都需要在插件中直接改。
  19. //由于各种不会,所以代码写得超级乱。
  20. //帮助区段END
  21. //=========================================================================
  22. //        声明区段
  23. //=========================================================================
  24. function Window_Shengwang() {
  25.         this.initialize.apply(this, arguments);
  26. };

  27. Window_Shengwang.prototype = Object.create(Window_Selectable.prototype);
  28. Window_Shengwang.prototype.initialize = function(x, y, width, height) {
  29.     Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  30. };

  31. function Scene_Shengwang() {
  32.         this.initialize.apply(this, arguments);
  33. };

  34. Scene_Shengwang.prototype = Object.create(Scene_MenuBase.prototype);
  35. Scene_Shengwang.prototype.initialize = function() {
  36.     Scene_MenuBase.prototype.initialize.call(this);
  37. };

  38. Scene_Shengwang.prototype.create = function() {
  39. Scene_MenuBase.prototype.create.call(this);
  40.     this._commandWindow = new Window_Shengwang(0, 0, 816, 624);
  41.     this.addWindow(this._commandWindow);
  42. };

  43. Scene_Shengwang.prototype.update = function() {
  44.     if (Input.isTriggered('escape') || Input.isTriggered('cancel')) {
  45.         this._commandWindow.hide();
  46.         SceneManager.goto(Scene_Menu);
  47.     };
  48. };

  49. // ======================================================================
  50. // * Scene_Menu
  51. // ======================================================================
  52. Scene_Menu.prototype.Shengwang_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  53. Scene_Menu.prototype.createCommandWindow = function() {
  54.         this.Shengwang_createCommandWindow();
  55.         this._commandWindow.setHandler('shengwang',   this.command_Shengwang.bind(this));
  56. };
  57. Scene_Menu.prototype.command_Shengwang = function() {
  58.         SceneManager.push(Scene_Shengwang);
  59. };

  60. // ======================================================================
  61. // * Window_MenuCommand
  62. // ======================================================================
  63. Window_MenuCommand.prototype.Shengwang_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
  64. Window_MenuCommand.prototype.addOriginalCommands = function() {
  65.         this.Shengwang_addOriginalCommands();
  66.         this.addCommand('声望货币', 'shengwang', this.areMainCommandsEnabled());
  67. };

  68. //=======================================================================
  69. // 显示区段
  70. //=======================================================================
  71. Window_Shengwang.prototype.initialize = function(x, y, width, height) {
  72.     Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  73.     this.drawShengwangText();
  74. };

  75. Window_Shengwang.prototype.drawShengwangText = function() {
  76.         var dy = 0;
  77.         var dx = 34;                                //左侧文字绘制的X坐标,已经留出图标位置。
  78.         var di = 277;                                //中间图标显示的X坐标,左侧为0
  79.         var dxx = 311;                                //中间文字绘制的X坐标。已经留出图标位置。
  80.         var dii = 554;                                //右侧图标绘制的X坐标。
  81.         var dxxx = 588;                                //右侧文字绘制的X坐标,已经留出图标位置。
  82.         var dw = 230;                                //界面总宽
  83.         var gx = 0;                               
  84.         this.contents.fontSize = 20;
  85.     this.drawText("声望和货币", 0, -10, dw, 'left');
  86.         if ($gameVariables.value(80) > 0){
  87.         this.drawText("威望:" + $gameVariables.value(80), 0, -10 ,778, 'right');       
  88.         };
  89.         this.drawText("—————————————————————————————————————————", 0, dy + 8, 784, 'left');
  90.         this.contents.fontSize = 20;
  91.         //声望区段
  92.         //第一行
  93.         dy += 32;        //行高变化
  94.         //左
  95.         if ($gameSwitches.value(62) == true){
  96.         this.drawIcon( 3, 0, dy + 3);               
  97.         this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
  98.         this.dataMath($gameVariables.value(62), gx ,dy ,dw);        //条显示的函数,第一个值为要使用的变量       
  99.         }else{
  100.         this.drawText("声望系统尚未开启", 0, dy, dw, 'left');
  101.         };
  102.         //中
  103.         if ($gameSwitches.value(63) == true){
  104.         if ($gameVariables.value(63) == 0){
  105.         this.drawText("???", di, dy, dw, 'conter' );
  106.         } else{
  107.         this.drawIcon( 3, di, dy + 3);
  108.         this.drawText("尘隐镇", dxx, dy, dw, 'left' );
  109.         this.dataMath($gameVariables.value(63), gx + 277 ,dy ,dw);
  110.         };};
  111.         //右
  112.         if ($gameSwitches.value(64) == true){
  113.         if ($gameVariables.value(64) == 0){
  114.         this.drawText("???", dii, dy, dw, 'conter' );
  115.         } else{
  116.         this.drawIcon( 3, dii, dy + 3);
  117.         this.drawText("天都", dxxx, dy, dw, 'left' );
  118.         this.dataMath($gameVariables.value(64), gx + 554 ,dy ,dw);
  119.         };};
  120.         //第二行
  121.         dy += 61;                        //行高变化
  122.         //左
  123.         if ($gameSwitches.value(65) == true){
  124.         if ($gameVariables.value(65) == 0){
  125.         this.drawText("???", 0, dy, dw, 'conter' );
  126.         } else{
  127.         this.drawIcon( 3, 0, dy + 3);               
  128.         this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
  129.         this.dataMath($gameVariables.value(65), gx ,dy ,dw);       
  130.         };};
  131.         //中
  132.         if ($gameSwitches.value(66) == true){
  133.         if ($gameVariables.value(66) == 0){
  134.         this.drawText("???", di, dy, dw, 'conter' );
  135.         } else{
  136.         this.drawIcon( 3, di, dy + 3);
  137.         this.drawText("尘隐镇", dxx, dy, dw, 'left' );
  138.         this.dataMath($gameVariables.value(66), gx + 277 ,dy ,dw);
  139.         };};
  140.         //右
  141.         if ($gameSwitches.value(67) == true){
  142.         if ($gameVariables.value(67) == 0){
  143.         this.drawText("???", dii, dy, dw, 'conter' );
  144.         } else{
  145.         this.drawIcon( 3, dii, dy + 3);
  146.         this.drawText("天都", dxxx, dy, dw, 'left' );
  147.         this.dataMath($gameVariables.value(67), gx + 554 ,dy ,dw);
  148.         };};
  149.         //第三行
  150.         dy += 61;                        //行高变化
  151.         //左
  152.         if ($gameSwitches.value(68) == true){
  153.         if ($gameVariables.value(68) == 0){
  154.         this.drawText("???", 0, dy, dw, 'conter' );
  155.         } else{
  156.         this.drawIcon( 3, 0, dy + 3);               
  157.         this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
  158.         this.dataMath($gameVariables.value(68), gx ,dy ,dw);               
  159.         };};
  160.         //中
  161.         if ($gameSwitches.value(69) == true){
  162.         if ($gameVariables.value(69) == 0){
  163.         this.drawText("???", di, dy, dw, 'conter' );
  164.         } else{
  165.         this.drawIcon( 3, di, dy + 3);
  166.         this.drawText("尘隐镇", dxx, dy, dw, 'left' );
  167.         this.dataMath($gameVariables.value(69), gx + 277 ,dy ,dw);
  168.         };};
  169.         //右
  170.         if ($gameSwitches.value(70) == true){
  171.         if ($gameVariables.value(70) == 0){
  172.         this.drawText("???", dii, dy, dw, 'conter' );
  173.         } else{
  174.         this.drawIcon( 3, dii, dy + 3);
  175.         this.drawText("天都", dxxx, dy, dw, 'left' );
  176.         this.dataMath($gameVariables.value(70), gx + 554 ,dy ,dw);
  177.         };};
  178.         //第四行
  179.         dy += 61;                        //行高变化
  180.         //左
  181.         if ($gameSwitches.value(71) == true){
  182.         if ($gameVariables.value(71) == 0){
  183.         this.drawText("???", 0, dy, dw, 'conter' );
  184.         } else{
  185.         this.drawIcon( 3, 0, dy + 3);               
  186.         this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
  187.         this.dataMath($gameVariables.value(71), gx ,dy ,dw);               
  188.         };};
  189.         //中
  190.         if ($gameSwitches.value(72) == true){
  191.         if ($gameVariables.value(72) == 0){
  192.         this.drawText("???", di, dy, dw, 'conter' );
  193.         } else{
  194.         this.drawIcon( 3, di, dy + 3);
  195.         this.drawText("尘隐镇", dxx, dy, dw, 'left' );
  196.         this.dataMath($gameVariables.value(72), gx + 277 ,dy ,dw);
  197.         };};
  198.         //右
  199.         if ($gameSwitches.value(73) == true){
  200.         if ($gameVariables.value(73) == 0){
  201.         this.drawText("???", dii, dy, dw, 'conter' );
  202.         } else{
  203.         this.drawIcon( 3, dii, dy + 3);
  204.         this.drawText("天都", dxxx, dy, dw, 'left' );
  205.         this.dataMath($gameVariables.value(73), gx + 554 ,dy ,dw);
  206.         };};
  207.         //第五行
  208.         dy += 61;                        //行高变化
  209.         //左
  210.         if ($gameSwitches.value(74) == true){
  211.         if ($gameVariables.value(74) == 0){
  212.         this.drawText("???", 0, dy, dw, 'conter' );
  213.         } else{
  214.         this.drawIcon( 3, 0, dy + 3);               
  215.         this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
  216.         this.dataMath($gameVariables.value(74), gx ,dy ,dw);       
  217.         };};
  218.         //中
  219.         if ($gameSwitches.value(75) == true){
  220.         if ($gameVariables.value(75) == 0){
  221.         this.drawText("???", di, dy, dw, 'conter' );
  222.         } else{
  223.         this.drawIcon( 3, di, dy + 3);
  224.         this.drawText("尘隐镇", dxx, dy, dw, 'left' );
  225.         this.dataMath($gameVariables.value(75), gx + 277 ,dy ,dw);
  226.         };};
  227.         //右
  228.         if ($gameSwitches.value(76) == true){
  229.         if ($gameVariables.value(76) == 0){
  230.         this.drawText("???", dii, dy, dw, 'conter' );
  231.         } else{
  232.         this.drawIcon( 3, dii, dy + 3);
  233.         this.drawText("天都", dxxx, dy, dw, 'left' );
  234.         this.dataMath($gameVariables.value(76), gx + 554 ,dy ,dw);
  235.         };};
  236.         //第六行
  237.         dy += 61;                        //行高变化
  238.         //左
  239.         if ($gameSwitches.value(77) == true){
  240.         if ($gameVariables.value(77) == 0){
  241.         this.drawText("???", 0, dy, dw, 'conter' );
  242.         } else{
  243.         this.drawIcon( 3, 0, dy + 3);               
  244.         this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
  245.         this.dataMath($gameVariables.value(77), gx ,dy ,dw);       
  246.         };};
  247.         //中
  248.         if ($gameSwitches.value(78) == true){
  249.         if ($gameVariables.value(78) == 0){
  250.         this.drawText("???", di, dy, dw, 'conter' );
  251.         } else{
  252.         this.drawIcon( 3, di, dy + 3);
  253.         this.drawText("尘隐镇", dxx, dy, dw, 'left' );
  254.         this.dataMath($gameVariables.value(78), gx + 277 ,dy ,dw);
  255.         };};
  256.         //右
  257.         if ($gameSwitches.value(79) == true){
  258.         if ($gameVariables.value(79) == 0){
  259.         this.drawText("???", dii, dy, dw, 'conter' );
  260.         } else{
  261.         this.drawIcon( 3, dii, dy + 3);
  262.         this.drawText("天都", dxxx, dy, dw, 'left' );
  263.         this.dataMath($gameVariables.value(79), gx + 554 ,dy ,dw);
  264.         };};
  265.         //声望区段END
  266.         dy = 387;
  267.         this.drawText("————————————————————————————————————", 0, dy, 784, 'left');
  268.         var hi = 0;                 //一位X坐标,框宽加1像素的边距
  269.         var hii = 157;                //二位X坐标
  270.         var hiii = 314                //三位X坐标
  271.         var hiv = 471;                //四位X坐标
  272.         var hv = 628;                //五位X坐标
  273.         var hw = 156;                //每个框宽
  274.         //货币区段
  275.         dy = 407;                        //第一行
  276.         //左
  277.         if ($gameVariables.value(42) > 0){
  278.         this.drawIcon( 3, hi, dy + 30);
  279.         this.drawText("神殿晶体:", hi, dy, hw);
  280.         this.drawText("x " + $gameVariables.value(42), hi + 35, dy + 30, hw, 'left' );
  281.         } else{
  282.         this.drawText("货币系统尚未开启", hi, dy, 784);
  283.         };
  284.         //左中
  285.         if ($gameVariables.value(42) > 0){
  286.         this.drawIcon( 3, hii, dy + 30);       
  287.         this.drawText("神殿晶体:", hii, dy, hw);
  288.         this.drawText("x " + $gameVariables.value(43), hii + 35, dy + 30, hw, 'left' );
  289.         };
  290.         //中
  291.         if ($gameVariables.value(42) > 0){
  292.         this.drawIcon( 3, hiii, dy + 30);
  293.         this.drawText("神殿晶体:", hiii, dy, hw);
  294.         this.drawText("x " + $gameVariables.value(44), hiii + 35, dy + 30, hw, 'left' );
  295.         };
  296.         //右中
  297.         if ($gameVariables.value(42) > 0){
  298.         this.drawIcon( 3, hiv, dy + 30);
  299.         this.drawText("神殿晶体:", hiv, dy, hw);
  300.         this.drawText("x " + $gameVariables.value(45), hiv + 35, dy + 30, hw, 'left' );
  301.         };
  302.         //右
  303.         if ($gameVariables.value(42) > 0){
  304.         this.drawIcon( 3, hv, dy + 30);
  305.         this.drawText("神殿晶体:", hv, dy, hw);
  306.         this.drawText("x " + $gameVariables.value(46), hv + 35, dy + 30, hw, 'left' );
  307.         };
  308.         dy = 466;                        //第二行
  309.         //左
  310.         if ($gameVariables.value(42) > 0){
  311.         this.drawIcon( 3, hi, dy + 30);
  312.         this.drawText("神殿晶体:", hi, dy, hw);
  313.         this.drawText("x " + $gameVariables.value(47), hi + 35, dy + 30, hw, 'left' );
  314.         };
  315.         //左中
  316.         if ($gameVariables.value(42) > 0){
  317.         this.drawIcon( 3, hii, dy + 30);
  318.         this.drawText("神殿晶体:", hii, dy, hw);
  319.         this.drawText("x " + $gameVariables.value(48), hii + 35, dy + 30, hw, 'left' );
  320.         };
  321.         //中
  322.         if ($gameVariables.value(42) > 0){
  323.         this.drawIcon( 3, hiii, dy + 30);
  324.         this.drawText("神殿晶体:", hiii, dy, hw);
  325.         this.drawText("x " + $gameVariables.value(49), hiii + 35, dy + 30, hw, 'left' );
  326.         };
  327.         //右中
  328.         if ($gameVariables.value(42) > 0){
  329.         this.drawIcon( 3, hiv, dy + 30);
  330.         this.drawText("神殿晶体:", hiv, dy, hw);
  331.         this.drawText("x " + $gameVariables.value(50), hiv + 35, dy + 30, hw, 'left' );
  332.         };
  333.         //右
  334.         if ($gameVariables.value(42) > 0){
  335.         this.drawIcon( 3, hv, dy + 30);
  336.         this.drawText("神殿晶体:", hv, dy, hw);
  337.         this.drawText("x " + $gameVariables.value(51), hv + 35, dy + 30, hw, 'left' );
  338.         };
  339.         dy = 525;                        //第三行
  340.         //左
  341.         if ($gameVariables.value(42) > 0){
  342.         this.drawIcon( 3, hi, dy + 30);
  343.         this.drawText("神殿晶体:", hi, dy, hw);
  344.         this.drawText("x " + $gameVariables.value(52), hi + 35, dy + 30, hw, 'left' );
  345.         };
  346.         //左中
  347.         if ($gameVariables.value(42) > 0){
  348.         this.drawIcon( 3, hii, dy + 30);
  349.         this.drawText("神殿晶体:", hii, dy, hw);
  350.         this.drawText("x " + $gameVariables.value(53), hii + 35, dy + 30, hw, 'left' );
  351.         };
  352.         //中
  353.         if ($gameVariables.value(42) > 0){
  354.         this.drawIcon( 3, hiii, dy + 30);
  355.         this.drawText("神殿晶体:", hiii, dy, hw);
  356.         this.drawText("x " + $gameVariables.value(54), hiii + 35, dy + 30, hw, 'left' );
  357.         };
  358.         //右中
  359.         if ($gameVariables.value(42) > 0){
  360.         this.drawIcon( 3, hiv, dy + 30);
  361.         this.drawText("神殿晶体:", hiv, dy, hw);
  362.         this.drawText("x " + $gameVariables.value(55), hiv + 35, dy + 30, hw, 'left' );
  363.         };
  364.         //右
  365.         if ($gameVariables.value(42) > 0){
  366.         this.drawIcon( 3, hv, dy + 30);
  367.         this.drawText("神殿晶体:", hv, dy, hw);
  368.         this.drawText("x " + $gameVariables.value(56), hv + 35, dy + 30, hw, 'left' );
  369.         };
  370.         //货币区段END
  371. };
  372. //条显示的函数
  373. Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
  374.         var v1 = data;       
  375.         var v2 = 1;
  376.         var text = "";
  377.         var color = '#000000';
  378.         if (v1 >= 60000){        //崇拜
  379.         v1 = 60000;
  380.         v2 = 60000;                                                        //当前阶段的声望上限
  381.         color = '#00ff00';                                        //设置声望条的颜色
  382.         text = "崇拜:"+ v1 + "/" + v2;                //赋值要显示在声望条上面的文字
  383.         }else if (v1 >= 20000){                //崇敬
  384.         v2 = 60000;
  385.         color = '#00e400';
  386.         text = "崇敬:"+ v1 + "/" + v2;
  387.         }else if (v1 >= 5000){                //尊敬
  388.         v2 = 20000;
  389.         color = '#40de5a';
  390.         text = "尊敬:"+ v1 + "/" + v2;
  391.         }else if (v1 >= 800){                //尊重
  392.         v2 = 5000;
  393.         color = '#eaff56';
  394.         text = "尊重:"+ v1 + "/" + v2;
  395.         }else if (v1 >= 100){                //友善
  396.         v2 = 800;
  397.         color = '#faff72';
  398.         text = "友善:"+ v1 + "/" + v2;
  399.         }else if (v1 < 0){                        //仇恨
  400.         v2 = v1;
  401.         color = '#ff0000';
  402.         text = "仇恨:"+ v1;
  403. /*         }else if (v1 == 0){                        //为0的状态
  404.         v2 = 1;
  405.         color = '#ffffff';
  406.         text = "???";
  407. */        }else {                                                //冷漠
  408.         v2 = 100;
  409.         color = '#ffa400';
  410.         var text = "冷漠:"+ v1 + "/" + v2;       
  411.         }
  412.         var rate = v1 / v2;                                        //计算声望条的绘制比例
  413.         dy += 30;                                                        //行高变化
  414.         this.drawGauge(gx, dy, dw, rate, color);        //绘制声望条
  415.         this.drawText(text, gx + 12, dy - 4 , dw, 'center');        //绘制要显示在声望条上面的文字
  416. };
  417. //绘制条函数
  418. Window_Shengwang.prototype.drawGauge = function(x, y, width, rate, color) {
  419.         var fillW = Math.floor(width * rate);                        //比例换算成彩条长度
  420.     this.contents.fillRect(x, y + 8, width, 20, '#000000');        //绘制条的黑底
  421.     this.contents.gradientFillRect(x, y + 8, fillW, 20, color, color);                //绘制彩条

  422. };
复制代码


全部内容显示状态是下图这样的,密集恐惧症慎看= =


更新列表:
1.1--由347780682提供建议,将声望为0,显示为???。这样即使声望还没有获得声望,也可以开启对应的声望系统,这样一来,在设计剧情的时候如果不按常理出牌,先获得了排在靠后的声望时,也可以直接开启靠后的声望同时打开靠前的声望开关,让其显示为???。更新已经并入上面的脚本,各位客官随意取用修改。
1.2--由347780682提供建议,将声望为开启后声望为0的声望地域显示为???,就不再显示图标和条。已经屏蔽上一个版本的修改区段,有特殊需求的客官也可以手动屏蔽声望区的所有if ($gameVariables.value(76) == 0){
        this.drawText("???", dii, dy, dw, 'conter' );
        } else{ 这个类型的判断,末尾的其中一个};。然后恢复412-416行的屏蔽即可。

评分

参与人数 5赞 +5 收起 理由
一个果粒橙 + 1 塞糖
frost_king_hw + 1 谢谢,分享
347780682 + 1 期待回归
白嫩白嫩的 + 1 好久没见楼主了,期待回归
j296196585 + 1 塞糖

查看全部评分

梦石
0
星屑
6963
在线时间
1557 小时
注册时间
2011-6-14
回帖
425
发表于 2016-2-24 19:10:33 来自手机 | 显示全部楼层
本帖最后由 347780682 于 2016-2-24 21:19 编辑

感觉好像对我有用 支持下楼主
ps:话说楼主能不能让声望变量为0的势力显示为???

点评

这个建议好,我要并到一楼去。  发表于 2016-2-24 19:34
回复

使用道具 举报

梦石
0
星屑
647
在线时间
165 小时
注册时间
2012-4-18
回帖
237
 楼主| 发表于 2016-2-24 19:31:28 | 显示全部楼层
欢迎,随意取用随意修改。
可以啊,你用下面的代码代替条显示函数
  1. //条显示的函数
  2. Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
  3.         var v1 = data;       
  4.         var v2 = 1;
  5.         var text = "";
  6.         var color = '#000000';
  7.         if (v1 >= 60000){        //崇拜
  8.         v1 = 60000;
  9.         v2 = 60000;                                                        //当前阶段的声望上限
  10.         color = '#00ff00';                                        //设置声望条的颜色
  11.         text = "崇拜:"+ v1 + "/" + v2;                //赋值要显示在声望条上面的文字
  12.         }else if (v1 >= 20000){                //崇敬
  13.         v2 = 60000;
  14.         color = '#00e400';
  15.         text = "崇敬:"+ v1 + "/" + v2;
  16.         }else if (v1 >= 5000){                //尊敬
  17.         v2 = 20000;
  18.         color = '#40de5a';
  19.         text = "尊敬:"+ v1 + "/" + v2;
  20.         }else if (v1 >= 800){                //尊重
  21.         v2 = 5000;
  22.         color = '#eaff56';
  23.         text = "尊重:"+ v1 + "/" + v2;
  24.         }else if (v1 >= 100){                //友善
  25.         v2 = 800;
  26.         color = '#faff72';
  27.         text = "友善:"+ v1 + "/" + v2;
  28.         }else if (v1 < 0){                        //仇恨
  29.         v2 = v1;
  30.         color = '#ff0000';
  31.         text = "仇恨:"+ v1;
  32.         }else if (v1 == 0){                        //为0的状态
  33.         v2 = 1;
  34.         color = '#ffffff';
  35.         text = "???";
  36.         }else {                                                //冷漠
  37.         v2 = 100;
  38.         color = '#ffa400';
  39.         var text = "冷漠:"+ v1 + "/" + v2;       
  40.         }
  41.         var rate = v1 / v2;                                        //计算声望条的绘制比例
  42.         dy += 30;                                                        //行高变化
  43.         this.drawGauge(gx, dy, dw, rate, color);        //绘制声望条
  44.         this.drawText(text, gx + 12, dy - 4 , dw, 'center');        //绘制要显示在声望条上面的文字
  45. };
复制代码
这样的修改并没有取消开关对声望显示的控制,去过要取消的话,屏蔽每一个声望段if ($gameSwitches.value(62) == true){
的判断就行了,记得和断尾的}一起屏蔽。

点评

欸= =应为我地名和条是分开绘制的啊…………改地名好痛苦- -不过我还是会改的= =  发表于 2016-2-24 22:54
话说楼主为什么不把变量为0的地名也用问号代替.................................  发表于 2016-2-24 21:33
回复

使用道具 举报

梦石
0
星屑
6963
在线时间
1557 小时
注册时间
2011-6-14
回帖
425
发表于 2019-12-22 20:40:40 | 显示全部楼层
帮楼主唤醒
回复

使用道具 举报

梦石
0
星屑
553
在线时间
73 小时
注册时间
2017-12-22
回帖
33
发表于 2020-2-25 00:57:12 | 显示全部楼层
本帖最后由 无终 于 2020-2-25 12:04 编辑

修改了一下,添加了一些参数。
说明:
        大部分参数不用在代码中修改了
        增加了自定义声望条前景色的功能
        声望值最大值可以超过最高等级线,会显示为99999/60000这样
        添加了唤出菜单的指令
       
       


  1. //=============================================================================
  2. // Salvareless Ownuse System
  3. // PrestigeSystem.js
  4. //=============================================================================
  5. //=============================================================================
  6. /*:
  7. * @plugindesc 声望插件
  8. * @author salvareless
  9. *
  10. * @param ---菜单---       
  11. * @default       
  12. *
  13. * @param Menu Name
  14. * @parent ---菜单---                                                                                                       
  15. * @desc 主菜单显示的文字
  16. * 如果使用了YEP_MainMenuManager等主菜单插件,此项无效插件效果会被覆盖                       
  17. * @default 声望
  18. *
  19. * @param Title Text
  20. * @parent ---菜单---                                                                                                       
  21. * @desc 声望窗口最上方显示的文字       
  22. * @default 声望和货币
  23. *
  24. * @param Prestige Text
  25. * @parent ---菜单---                                                                                                       
  26. * @desc 声望栏标题文字       
  27. * @default 声望系统尚未解锁
  28. *
  29. *
  30. * @param Gold Text
  31. * @parent ---菜单---                                                                                                       
  32. * @desc 货币栏标题文字       
  33. * @default 货币系统尚未解锁
  34. *  
  35. * @param ---声望---       
  36. * @default       
  37. *
  38. * @param Prestige Number                                                                                               
  39. * @parent ---声望---                                                                                                       
  40. * @desc 声望达到一定阶段所需要的值,使用逗号分隔                                                                               
  41. * @default 0,100,800,5000,20000,60000
  42. *  
  43. * @param Prestige Phase                                                                                               
  44. * @parent ---声望---                                                                                                       
  45. * @desc 声望阶段名称,用逗号分隔,需要和声望分隔值对应                                                                       
  46. * @default 仇恨,冷漠,中立,友善,尊敬,崇敬,崇拜
  47. *
  48. * @param Prestige Name                                                               
  49. * @parent ---声望---                                                                                                                                                                                                                               
  50. * @desc 声望显示的名称,使用逗号分隔,最大18个。                                                                               
  51. * @default 声望1,声望2,声望3,声望4,声望5,声望6,声望7,声望8,声望9,声望10,声望11,声望12,声望13,声望14,声望15,声望16,声望17,声望18  
  52. *
  53. * @param Prestige Variable                                                       
  54. * @parent ---声望---                                                                                                                                                                                                                               
  55. * @desc 声望对应的变量号,最大18个                                                                               
  56. * @default 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
  57. *     
  58. * @param Prestige Switch                                                       
  59. * @parent ---声望---                                                                                                                                                                                                                               
  60. * @desc 声望对应的开关号,最大18个                                                                               
  61. * @default 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
  62. *     
  63. * @param Prestige Icon                                                       
  64. * @parent ---声望---                                                                                                                                                                                                                               
  65. * @desc 声望对应的图标编号,最大18个                                                                       
  66. * @default 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81  
  67. *
  68. * @param Max                                       
  69. * @parent ---声望---
  70. * @type number
  71. * @desc  声望最大值
  72. * @default 60000
  73. *
  74. * @param ---货币---       
  75. * @default       
  76. *
  77. * @param Gold Name                                                               
  78. * @parent ---货币---
  79. * @desc 货币显示的名称,使用逗号分隔,最大15个,
  80. * 已经设置货币当变量用时,大于0才会显示出来。                                                                               
  81. * @default 人民币,美元,欧元,日元,英镑,加元,港币,台币,韩元,澳元,克朗,比索,先令,卢比,第纳尔
  82. *
  83. * @param Gold Variable                                                               
  84. * @parent ---货币---                                                                                                                                                                                                                               
  85. * @desc 货币使用的变量,使用逗号分隔
  86. * 已经设置货币当变量用时,大于0才会显示出来。                                                                               
  87. * @default 42,43,44,45,46,47,48,49,50,51,52,53,54,55,56
  88. *     
  89. * @param Gold Icon                                                       
  90. * @parent ---货币---                                                                                                                                                                                                                               
  91. * @desc 货币对应的图标编号,最大15个                                                                       
  92. * @default 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47
  93. *  
  94. *
  95. * @param ---显示---       
  96. * @default       
  97. *
  98. * @param Colors                                                       
  99. * @parent ---显示---       
  100. * @desc  声望名称显示的颜色
  101. * @default #930000,#ff0000,#f75000,#00ffff,#01b468,#00db00,#006000
  102. *  
  103. * @param Unlock Text
  104. * @parent ---显示---                                                                                                       
  105. * @desc 声望未解锁时显示的文字               
  106. * @default ?????
  107. *  
  108. * @param ---威望---       
  109. * @default       
  110. *
  111. * @param Reputation Variable                                                               
  112. * @parent ---威望---                                                                                                                                                                                                                               
  113. * @desc 声望界面右上角显示的威望所使用的变量                                                                               
  114. * @default 80
  115. *
  116. * @param Reputation Text                                                                                               
  117. * @parent ---威望---                                                                                                       
  118. * @desc 声望界面右上角显示的威望所使用的文字前缀                                                                       
  119. * @default 威望:
  120. *
  121. * @help
  122. * ============================================================================
  123. * 声望系统插件
  124. * 作者:Salvareless      优化:无终
  125. * ============================================================================
  126. *  
  127. * 已经设置货币当做变量使用时,大于0才会显示出来。
  128. * 变量货币需要配合YEP_ShopMenuCore和YEP_X_MoreCurrencies才更有意义
  129. * 不然就只能做固定的物品兑换事件
  130. *
  131. * 参数中用来分隔的逗号必须是英文半角
  132. *
  133. * 插件指令:
  134. *      PRESTIGE OPEN       打开声望界面
  135. *
  136. * 脚本:
  137. *      SceneManager.push(Scene_Shengwang);     打开声望界面
  138. *
  139. *
  140. *
  141. */
  142. //=========================================================================
  143. //声明区段
  144. //=========================================================================
  145. var PrestigeSystem = window.PrestigeSystem || {};
  146. PrestigeSystem.parameters = PluginManager.parameters('PrestigeSystem');

  147. PrestigeSystem.max = parseInt(PrestigeSystem.parameters['Max'] || '60000'); //最大值
  148. PrestigeSystem.menuName = String(PrestigeSystem.parameters['Menu Name'] || '声望');
  149. PrestigeSystem.unlockText = String(PrestigeSystem.parameters['Unlock Text'] || '?????');
  150. PrestigeSystem.titleText = String(PrestigeSystem.parameters['Title Text'] || '声望和货币');
  151. PrestigeSystem.preText = String(PrestigeSystem.parameters['Prestige Text'] || '声望系统尚未解锁');
  152. PrestigeSystem.goldText = String(PrestigeSystem.parameters['Gold Text'] || '货币系统尚未解锁');
  153. PrestigeSystem.colorString = String(PrestigeSystem.parameters['Colors'] || '#930000,#ff0000,#f75000,#00ffff,#01b468,#00db00,#006000');
  154. PrestigeSystem.lineString = String(PrestigeSystem.parameters['Prestige Number'] || '0,100,800,5000,20000,60000');
  155. PrestigeSystem.prePhase = String(PrestigeSystem.parameters['Prestige Phase'] || '仇恨,冷漠,中立,友善,尊敬,崇敬,崇拜');
  156. PrestigeSystem.preName = String(PrestigeSystem.parameters['Prestige Name'] || '声望1,声望2,声望3,声望4,声望5,声望6,声望7,声望8,声望9,声望10,声望11,声望12,声望13,声望14,声望15,声望16,声望17,声望18');
  157. PrestigeSystem.preVariable = String(PrestigeSystem.parameters['Prestige Variable'] || '62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79');
  158. PrestigeSystem.preSwitch = String(PrestigeSystem.parameters['Prestige Switch'] || '62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79');
  159. PrestigeSystem.preIcon = String(PrestigeSystem.parameters['Prestige Icon'] || '64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81');
  160. PrestigeSystem.goldName = String(PrestigeSystem.parameters['Gold Name'] || '人民币,美元,欧元,日元,英镑,加元,港币,台币,韩元,澳元,克朗,比索,先令,卢比,第纳尔');
  161. PrestigeSystem.goldVariable = String(PrestigeSystem.parameters['Gold Variable'] || '42,43,44,45,46,47,48,49,50,51,52,53,54,55,56');
  162. PrestigeSystem.repText = String(PrestigeSystem.parameters['Reputation Text'] || '威望:');
  163. PrestigeSystem.repVariable = String(PrestigeSystem.parameters['Reputation Variable'] || '80');
  164. PrestigeSystem.goldIcon = String(PrestigeSystem.parameters['Gold Icon'] || '32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47');

  165. function Window_Shengwang() {
  166.     this.initialize.apply(this, arguments);
  167. };

  168. Window_Shengwang.prototype = Object.create(Window_Selectable.prototype);
  169. Window_Shengwang.prototype.initialize = function(x, y, width, height) {
  170.     Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  171. };

  172. function Scene_Shengwang() {
  173.     this.initialize.apply(this, arguments);
  174. };

  175. Scene_Shengwang.prototype = Object.create(Scene_MenuBase.prototype);
  176. Scene_Shengwang.prototype.initialize = function() {
  177. Scene_MenuBase.prototype.initialize.call(this);
  178. };

  179. Scene_Shengwang.prototype.create = function() {
  180. Scene_MenuBase.prototype.create.call(this);
  181. this._commandWindow = new Window_Shengwang(0, 0, 816, 624);
  182. this.addWindow(this._commandWindow);
  183. };

  184. Scene_Shengwang.prototype.update = function() {
  185. if (Input.isTriggered('escape') || Input.isTriggered('cancel')) {
  186.     this._commandWindow.hide();
  187.     SceneManager.goto(Scene_Menu);
  188. };
  189. };


  190. // ======================================================================
  191. // 指令读取
  192. // ======================================================================

  193. var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  194. Game_Interpreter.prototype.pluginCommand = function (command, args) {
  195.         _Game_Interpreter_pluginCommand.apply(this, arguments);       
  196.         if (command == 'PRESTIGE') {
  197.                 switch (args[0]) {
  198.                         case 'OPEN':
  199.                                 SceneManager.push(Scene_Shengwang);
  200.                 break;
  201.                 }
  202.         }
  203. }

  204. // ======================================================================
  205. // 参数处理
  206. // ======================================================================

  207. //获取声望最大值
  208. PrestigeSystem.getMax = function(){
  209.     return PrestigeSystem.max;
  210. }

  211. //获取菜单参数   1,主菜单  2,顶部文字   3,声望栏顶部提示   4,货币栏顶部提示     5,威望的前缀    6,未解锁时的文字
  212. PrestigeSystem.getTitle = function(param) {
  213.     var value ;
  214.     switch(param){
  215.         case 1:
  216.             value = PrestigeSystem.menuName.trim();
  217.             break;
  218.         case 2:
  219.             value = PrestigeSystem.titleText.trim();
  220.             break
  221.         case 3:
  222.             value = PrestigeSystem.preText.trim();
  223.             break;
  224.         case 4:
  225.             value = PrestigeSystem.goldText.trim();
  226.             break;
  227.         case 5:
  228.             value = PrestigeSystem.repText.trim();
  229.             break;
  230.         case 6:
  231.             value = PrestigeSystem.unlockText.trim();
  232.             break;
  233.     }
  234.     return value === null ? '' : value;
  235. };

  236. //获取威望所使用的变量
  237. PrestigeSystem.getRepV = function(){
  238.     var value = (parseInt(PrestigeSystem.repVariable.trim()));
  239.     return value === null ? '' : value;
  240. }

  241. //获取颜色码
  242. PrestigeSystem.getColor = function(param) {
  243.     var values = this.getString(PrestigeSystem.colorString);
  244.     return values[param];
  245. }

  246. //获取分隔声望值标准
  247. PrestigeSystem.getLine = function(param) {
  248.     var values = this.getNumber(PrestigeSystem.lineString);
  249.     return values[param];
  250. }

  251. //获取声望等级名称
  252. PrestigeSystem.getLv = function(param) {
  253.     var values = this.getString(PrestigeSystem.prePhase);
  254.     return values[param];
  255. }

  256. //获取声望名称
  257. PrestigeSystem.getPName = function(param) {
  258.     var values = this.getString(PrestigeSystem.preName);
  259.     return values[param];
  260. }

  261. //获取变量号
  262. PrestigeSystem.getPreV = function(param) {
  263.     var values = this.getNumber(PrestigeSystem.preVariable);
  264.     return values[param];
  265. }

  266. //获取开关号
  267. PrestigeSystem.getPreS = function(param) {
  268.     var values = this.getNumber(PrestigeSystem.preSwitch);
  269.     return values[param];
  270. }

  271. //获取图标号
  272. PrestigeSystem.getPIcon = function(param) {
  273.     var values = this.getNumber(PrestigeSystem.preIcon);
  274.     return values[param];
  275. }

  276. //获取货币名称
  277. PrestigeSystem.getGName = function(param) {
  278.     var values = this.getString(PrestigeSystem.goldName);
  279.     return values[param];
  280. }

  281. //获取货币变量号
  282. PrestigeSystem.getGV = function(param) {
  283.     var values = this.getNumber(PrestigeSystem.goldVariable);
  284.     return values[param];
  285. }

  286. //获取货币图标号
  287. PrestigeSystem.getGIcon = function(param) {
  288.     var values = this.getNumber(PrestigeSystem.goldIcon);
  289.     return values[param];
  290. }

  291. //获取字符参数
  292. PrestigeSystem.getText = function(param) {
  293.     var value = param.trim();
  294.     return value === null ? '' : value;
  295. };

  296. //获取字符串参数
  297. PrestigeSystem.getString = function(paramNames) {
  298.     var values = this.getText(paramNames).split(',');
  299.     for (var i = 0; i < values.length; i++) values[i] = values[i].trim();
  300.     return values;
  301. };

  302. //获取Int参数
  303. PrestigeSystem.getNumber = function(paramNames) {
  304.     var values = this.getString(paramNames);
  305.     for (var i = 0; i < values.length; i++) values[i] = (parseInt(values[i]) || 0);
  306.     return values;
  307. };

  308. // ======================================================================
  309. // * Scene_Menu
  310. // ======================================================================
  311. Scene_Menu.prototype.Shengwang_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  312. Scene_Menu.prototype.createCommandWindow = function() {
  313.     this.Shengwang_createCommandWindow();
  314.     this._commandWindow.setHandler('shengwang',   this.command_Shengwang.bind(this));
  315. };
  316. Scene_Menu.prototype.command_Shengwang = function() {
  317.     SceneManager.push(Scene_Shengwang);
  318. };

  319. // ======================================================================
  320. // * Window_MenuCommand
  321. // ======================================================================
  322. Window_MenuCommand.prototype.Shengwang_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
  323. Window_MenuCommand.prototype.addOriginalCommands = function() {
  324.     this.Shengwang_addOriginalCommands();
  325.     this.addCommand(PrestigeSystem.getTitle(1), 'shengwang', this.areMainCommandsEnabled());
  326. };

  327. //=======================================================================
  328. // 显示区段
  329. //=======================================================================
  330. Window_Shengwang.prototype.initialize = function(x, y, width, height) {
  331. Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  332. this.drawShengwangText();
  333. };

  334. Window_Shengwang.prototype.drawShengwangText = function() {
  335.     var dy = 0;
  336.     var dx = 34;                                //左侧文字绘制的X坐标,已经留出图标位置。
  337.     var di = 277;                                //中间图标显示的X坐标,左侧为0
  338.     var dxx = 311;                                //中间文字绘制的X坐标。已经留出图标位置。
  339.     var dii = 554;                                //右侧图标绘制的X坐标。
  340.     var dxxx = 588;                                //右侧文字绘制的X坐标,已经留出图标位置。
  341.     var dw = 230;                                //界面总宽
  342.     var gx = 0;                                
  343.     this.contents.fontSize = 20;
  344.     this.drawText(PrestigeSystem.getTitle(2), 0, -10, dw, 'left');
  345.     if ($gameVariables.value(PrestigeSystem.getRepV()) > 0){
  346.     this.drawText(PrestigeSystem.getTitle(5) + $gameVariables.value(PrestigeSystem.getRepV()), 0, -10 ,778, 'right');        
  347.     };
  348.     this.drawText("————————————————————————————————————————————————————————————————————————————", 0, dy + 8, 784, 'left');
  349.     this.contents.fontSize = 20;
  350.     //声望区段
  351.     //第一行
  352.     dy += 32;        //行高变化
  353.     //左
  354.     if ($gameSwitches.value(PrestigeSystem.getPreS(0)) == true){
  355.     this.drawIcon(PrestigeSystem.getPIcon(0), 0, dy + 3);               
  356.     this.drawText(PrestigeSystem.getPName(0), dx, dy, dw, 'left');
  357.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(0)), gx ,dy ,dw);        //条显示的函数,第一个值为要使用的变量        
  358.     }else{
  359.     this.drawText(PrestigeSystem.getTitle(3), 0, dy, dw, 'left');
  360.     };
  361.     //中
  362.     if ($gameSwitches.value(PrestigeSystem.getPreS(1)) == true){
  363.     if ($gameVariables.value(PrestigeSystem.getPreV(1)) == 0){
  364.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  365.     } else{
  366.     this.drawIcon( PrestigeSystem.getPIcon(1), di, dy + 3);
  367.     this.drawText(PrestigeSystem.getPName(1), dxx, dy, dw, 'left' );
  368.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(1)), gx + 277 ,dy ,dw);
  369.     };};
  370.     //右
  371.     if ($gameSwitches.value(PrestigeSystem.getPreS(2)) == true){
  372.     if ($gameVariables.value(PrestigeSystem.getPreV(2)) == 0){
  373.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  374.     } else{
  375.     this.drawIcon( PrestigeSystem.getPIcon(2), dii, dy + 3);
  376.     this.drawText(PrestigeSystem.getPName(2), dxxx, dy, dw, 'left' );
  377.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(2)), gx + 554 ,dy ,dw);
  378.     };};
  379.     //第二行
  380.     dy += 61;                        //行高变化
  381.     //左
  382.     if ($gameSwitches.value(PrestigeSystem.getPreS(3)) == true){
  383.     if ($gameVariables.value(PrestigeSystem.getPreV(3)) == 0){
  384.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  385.     } else{
  386.     this.drawIcon( PrestigeSystem.getPIcon(3), 0, dy + 3);               
  387.     this.drawText(PrestigeSystem.getPName(3), dx, dy, dw, 'left');
  388.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(3)), gx ,dy ,dw);        
  389.     };};
  390.     //中
  391.     if ($gameSwitches.value(PrestigeSystem.getPreS(4)) == true){
  392.     if ($gameVariables.value(PrestigeSystem.getPreV(4)) == 0){
  393.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  394.     } else{
  395.     this.drawIcon( PrestigeSystem.getPIcon(4), di, dy + 3);
  396.     this.drawText(PrestigeSystem.getPName(4), dxx, dy, dw, 'left' );
  397.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(4)), gx + 277 ,dy ,dw);
  398.     };};
  399.     //右
  400.     if ($gameSwitches.value(PrestigeSystem.getPreS(5)) == true){
  401.     if ($gameVariables.value(PrestigeSystem.getPreV(5)) == 0){
  402.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  403.     } else{
  404.     this.drawIcon( PrestigeSystem.getPIcon(5), dii, dy + 3);
  405.     this.drawText(PrestigeSystem.getPName(5), dxxx, dy, dw, 'left' );
  406.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(5)), gx + 554 ,dy ,dw);
  407.     };};
  408.     //第三行
  409.     dy += 61;                        //行高变化
  410.     //左
  411.     if ($gameSwitches.value(PrestigeSystem.getPreS(6)) == true){
  412.     if ($gameVariables.value(PrestigeSystem.getPreV(6)) == 0){
  413.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  414.     } else{
  415.     this.drawIcon( PrestigeSystem.getPIcon(6), 0, dy + 3);               
  416.     this.drawText(PrestigeSystem.getPName(6), dx, dy, dw, 'left');
  417.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(6)), gx ,dy ,dw);               
  418.     };};
  419.     //中
  420.     if ($gameSwitches.value(PrestigeSystem.getPreS(7)) == true){
  421.     if ($gameVariables.value(PrestigeSystem.getPreV(7)) == 0){
  422.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  423.     } else{
  424.     this.drawIcon( PrestigeSystem.getPIcon(7), di, dy + 3);
  425.     this.drawText(PrestigeSystem.getPName(7), dxx, dy, dw, 'left' );
  426.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(7)), gx + 277 ,dy ,dw);
  427.     };};
  428.     //右
  429.     if ($gameSwitches.value(PrestigeSystem.getPreS(8)) == true){
  430.     if ($gameVariables.value(PrestigeSystem.getPreV(8)) == 0){
  431.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  432.     } else{
  433.     this.drawIcon( PrestigeSystem.getPIcon(8), dii, dy + 3);
  434.     this.drawText(PrestigeSystem.getPName(8), dxxx, dy, dw, 'left' );
  435.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(8)), gx + 554 ,dy ,dw);
  436.     };};
  437.     //第四行
  438.     dy += 61;                        //行高变化
  439.     //左
  440.     if ($gameSwitches.value(PrestigeSystem.getPreS(9)) == true){
  441.     if ($gameVariables.value(PrestigeSystem.getPreV(9)) == 0){
  442.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  443.     } else{
  444.     this.drawIcon( PrestigeSystem.getPIcon(9), 0, dy + 3);               
  445.     this.drawText(PrestigeSystem.getPName(9), dx, dy, dw, 'left');
  446.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(9)), gx ,dy ,dw);               
  447.     };};
  448.     //中
  449.     if ($gameSwitches.value(PrestigeSystem.getPreS(10)) == true){
  450.     if ($gameVariables.value(PrestigeSystem.getPreV(10)) == 0){
  451.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  452.     } else{
  453.     this.drawIcon( PrestigeSystem.getPIcon(10), di, dy + 3);
  454.     this.drawText(PrestigeSystem.getPName(10), dxx, dy, dw, 'left' );
  455.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(10)), gx + 277 ,dy ,dw);
  456.     };};
  457.     //右
  458.     if ($gameSwitches.value(PrestigeSystem.getPreS(11)) == true){
  459.     if ($gameVariables.value(PrestigeSystem.getPreV(11)) == 0){
  460.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  461.     } else{
  462.     this.drawIcon( PrestigeSystem.getPIcon(11), dii, dy + 3);
  463.     this.drawText(PrestigeSystem.getPName(11), dxxx, dy, dw, 'left' );
  464.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(11)), gx + 554 ,dy ,dw);
  465.     };};
  466.     //第五行
  467.     dy += 61;                        //行高变化
  468.     //左
  469.     if ($gameSwitches.value(PrestigeSystem.getPreS(12)) == true){
  470.     if ($gameVariables.value(PrestigeSystem.getPreV(12)) == 0){
  471.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  472.     } else{
  473.     this.drawIcon( PrestigeSystem.getPIcon(12), 0, dy + 3);               
  474.     this.drawText(PrestigeSystem.getPName(12), dx, dy, dw, 'left');
  475.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(12)), gx ,dy ,dw);        
  476.     };};
  477.     //中
  478.     if ($gameSwitches.value(PrestigeSystem.getPreS(13)) == true){
  479.     if ($gameVariables.value(PrestigeSystem.getPreV(13)) == 0){
  480.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  481.     } else{
  482.     this.drawIcon( PrestigeSystem.getPIcon(13), di, dy + 3);
  483.     this.drawText(PrestigeSystem.getPName(13), dxx, dy, dw, 'left' );
  484.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(13)), gx + 277 ,dy ,dw);
  485.     };};
  486.     //右
  487.     if ($gameSwitches.value(PrestigeSystem.getPreS(14)) == true){
  488.     if ($gameVariables.value(PrestigeSystem.getPreV(14)) == 0){
  489.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  490.     } else{
  491.     this.drawIcon( PrestigeSystem.getPIcon(14), dii, dy + 3);
  492.     this.drawText(PrestigeSystem.getPName(14), dxxx, dy, dw, 'left' );
  493.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(14)), gx + 554 ,dy ,dw);
  494.     };};
  495.     //第六行
  496.     dy += 61;                        //行高变化
  497.     //左
  498.     if ($gameSwitches.value(PrestigeSystem.getPreS(15)) == true){
  499.     if ($gameVariables.value(PrestigeSystem.getPreV(15)) == 0){
  500.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  501.     } else{
  502.     this.drawIcon( PrestigeSystem.getPIcon(15), 0, dy + 3);               
  503.     this.drawText(PrestigeSystem.getPName(15), dx, dy, dw, 'left');
  504.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(15)), gx ,dy ,dw);        
  505.     };};
  506.     //中
  507.     if ($gameSwitches.value(PrestigeSystem.getPreS(16)) == true){
  508.     if ($gameVariables.value(PrestigeSystem.getPreV(16)) == 0){
  509.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  510.     } else{
  511.     this.drawIcon( PrestigeSystem.getPIcon(16), di, dy + 3);
  512.     this.drawText(PrestigeSystem.getPName(16), dxx, dy, dw, 'left' );
  513.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(16)), gx + 277 ,dy ,dw);
  514.     };};
  515.     //右
  516.     if ($gameSwitches.value(PrestigeSystem.getPreS(17)) == true){
  517.     if ($gameVariables.value(PrestigeSystem.getPreV(17)) == 0){
  518.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  519.     } else{
  520.     this.drawIcon( PrestigeSystem.getPIcon(17), dii, dy + 3);
  521.     this.drawText(PrestigeSystem.getPName(17), dxxx, dy, dw, 'left' );
  522.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(17)), gx + 554 ,dy ,dw);
  523.     };};
  524.     //声望区段END
  525.     dy = 387;
  526.     this.drawText("————————————————————————————————————————————————————————————————————————————", 0, dy, 784, 'left');
  527.     var hi = 0;                 //一位X坐标,框宽加1像素的边距
  528.     var hii = 157;                //二位X坐标
  529.     var hiii = 314                //三位X坐标
  530.     var hiv = 471;                //四位X坐标
  531.     var hv = 628;                //五位X坐标
  532.     var hw = 156;                //每个框宽

  533.     //货币区段
  534.     dy = 407;                        //第一行
  535.     //左
  536.     if ($gameVariables.value(PrestigeSystem.getGV(0)) > 0){
  537.     this.drawIcon( PrestigeSystem.getGIcon(0), hi, dy + 30);
  538.     this.drawText(PrestigeSystem.getGName(0)+":", hi, dy, hw);
  539.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(0)), hi + 35, dy + 30, hw, 'left' );
  540.     } else{
  541.     this.drawText(PrestigeSystem.getTitle(4), hi, dy, 784);
  542.     };
  543.     //左中
  544.     if ($gameVariables.value(PrestigeSystem.getGV(1)) > 0){
  545.     this.drawIcon( PrestigeSystem.getGIcon(1), hii, dy + 30);        
  546.     this.drawText(PrestigeSystem.getGName(1)+":", hii, dy, hw);
  547.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(1)), hii + 35, dy + 30, hw, 'left' );
  548.     };
  549.     //中
  550.     if ($gameVariables.value(PrestigeSystem.getGV(2)) > 0){
  551.     this.drawIcon( PrestigeSystem.getGIcon(2), hiii, dy + 30);
  552.     this.drawText(PrestigeSystem.getGName(2)+":", hiii, dy, hw);
  553.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(2)), hiii + 35, dy + 30, hw, 'left' );
  554.     };
  555.     //右中
  556.     if ($gameVariables.value(PrestigeSystem.getGV(3)) > 0){
  557.     this.drawIcon( PrestigeSystem.getGIcon(3), hiv, dy + 30);
  558.     this.drawText(PrestigeSystem.getGName(3)+":", hiv, dy, hw);
  559.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(3)), hiv + 35, dy + 30, hw, 'left' );
  560.     };
  561.     //右
  562.     if ($gameVariables.value(PrestigeSystem.getGV(4)) > 0){
  563.     this.drawIcon( PrestigeSystem.getGIcon(4), hv, dy + 30);
  564.     this.drawText(PrestigeSystem.getGName(4)+":", hv, dy, hw);
  565.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(4)), hv + 35, dy + 30, hw, 'left' );
  566.     };
  567.     dy = 466;                        //第二行
  568.     //左
  569.     if ($gameVariables.value(PrestigeSystem.getGV(5)) > 0){
  570.     this.drawIcon( PrestigeSystem.getGIcon(5), hi, dy + 30);
  571.     this.drawText(PrestigeSystem.getGName(5)+":", hi, dy, hw);
  572.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(5)), hi + 35, dy + 30, hw, 'left' );
  573.     };
  574.     //左中
  575.     if ($gameVariables.value(PrestigeSystem.getGV(6)) > 0){
  576.     this.drawIcon( PrestigeSystem.getGIcon(6), hii, dy + 30);
  577.     this.drawText(PrestigeSystem.getGName(6)+":", hii, dy, hw);
  578.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(6)), hii + 35, dy + 30, hw, 'left' );
  579.     };
  580.     //中
  581.     if ($gameVariables.value(PrestigeSystem.getGV(7)) > 0){
  582.     this.drawIcon( PrestigeSystem.getGIcon(7), hiii, dy + 30);
  583.     this.drawText(PrestigeSystem.getGName(7)+":", hiii, dy, hw);
  584.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(7)), hiii + 35, dy + 30, hw, 'left' );
  585.     };
  586.     //右中
  587.     if ($gameVariables.value(PrestigeSystem.getGV(8)) > 0){
  588.     this.drawIcon( PrestigeSystem.getGIcon(8), hiv, dy + 30);
  589.     this.drawText(PrestigeSystem.getGName(8)+":", hiv, dy, hw);
  590.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(8)), hiv + 35, dy + 30, hw, 'left' );
  591.     };
  592.     //右
  593.     if ($gameVariables.value(PrestigeSystem.getGV(9)) > 0){
  594.     this.drawIcon( PrestigeSystem.getGIcon(9), hv, dy + 30);
  595.     this.drawText(PrestigeSystem.getGName(9)+":", hv, dy, hw);
  596.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(9)), hv + 35, dy + 30, hw, 'left' );
  597.     };
  598.     dy = 525;                        //第三行
  599.     //左
  600.     if ($gameVariables.value(PrestigeSystem.getGV(10)) > 0){
  601.     this.drawIcon( PrestigeSystem.getGIcon(10), hi, dy + 30);
  602.     this.drawText(PrestigeSystem.getGName(10)+":", hi, dy, hw);
  603.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(10)), hi + 35, dy + 30, hw, 'left' );
  604.     };
  605.     //左中
  606.     if ($gameVariables.value(PrestigeSystem.getGV(11)) > 0){
  607.     this.drawIcon( PrestigeSystem.getGIcon(11), hii, dy + 30);
  608.     this.drawText(PrestigeSystem.getGName(11)+":", hii, dy, hw);
  609.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(11)), hii + 35, dy + 30, hw, 'left' );
  610.     };
  611.     //中
  612.     if ($gameVariables.value(PrestigeSystem.getGV(12)) > 0){
  613.     this.drawIcon( PrestigeSystem.getGIcon(12), hiii, dy + 30);
  614.     this.drawText(PrestigeSystem.getGName(12)+":", hiii, dy, hw);
  615.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(12)), hiii + 35, dy + 30, hw, 'left' );
  616.     };
  617.     //右中
  618.     if ($gameVariables.value(PrestigeSystem.getGV(13)) > 0){
  619.     this.drawIcon( PrestigeSystem.getGIcon(13), hiv, dy + 30);
  620.     this.drawText(PrestigeSystem.getGName(13)+":", hiv, dy, hw);
  621.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(13)), hiv + 35, dy + 30, hw, 'left' );
  622.     };
  623.     //右
  624.     if ($gameVariables.value(PrestigeSystem.getGV(14)) > 0){
  625.     this.drawIcon( PrestigeSystem.getGIcon(14), hv, dy + 30);
  626.     this.drawText(PrestigeSystem.getGName(14)+":", hv, dy, hw);
  627.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(14)), hv + 35, dy + 30, hw, 'left' );
  628.     };
  629.     //货币区段END  
  630. };
  631. //条显示的函数
  632. //Color  '#ff0000'   faff72   eaff56   40de5a   00e400    00ff00   000000
  633. Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
  634.     var v1 = data;        
  635.     var v2 = 1;
  636.     var text = "";
  637.     var color = PrestigeSystem.getColor(0);
  638.     if (v1 >= PrestigeSystem.getLine(5)){        //崇拜
  639.         if(v1 >= PrestigeSystem.getMax()){
  640.             v1 = PrestigeSystem.getMax();
  641.         }else{
  642.             v1 = data;
  643.         }   
  644.     v2 = PrestigeSystem.getLine(5);                                                        //当前阶段的声望上限
  645.     color = PrestigeSystem.getColor(6);                                        //设置声望条的颜色
  646.     text = PrestigeSystem.getLv(6)+":"+ v1 + "/" + v2;                //赋值要显示在声望条上面的文字
  647.     }else if (v1 >= PrestigeSystem.getLine(4)){                //崇敬
  648.     v2 = PrestigeSystem.getLine(5);
  649.     color = PrestigeSystem.getColor(5);
  650.     text = PrestigeSystem.getLv(5)+":"+ v1 + "/" + v2;
  651.     }else if (v1 >= PrestigeSystem.getLine(3)){                //尊敬
  652.     v2 = PrestigeSystem.getLine(4);
  653.     color = PrestigeSystem.getColor(4);
  654.     text = PrestigeSystem.getLv(4)+":"+ v1 + "/" + v2;
  655.     }else if (v1 >= PrestigeSystem.getLine(2)){                //尊重
  656.     v2 = PrestigeSystem.getLine(3);
  657.     color = PrestigeSystem.getColor(3);
  658.     text = PrestigeSystem.getLv(3)+":"+ v1 + "/" + v2;
  659.     }else if (v1 >= PrestigeSystem.getLine(1)){                //友善
  660.     v2 = PrestigeSystem.getLine(2);
  661.     color = PrestigeSystem.getColor(2);
  662.     text = PrestigeSystem.getLv(2)+":"+ v1 + "/" + v2;
  663.     }else if (v1 < PrestigeSystem.getLine(0)){                        //仇恨
  664.     v2 = v1;
  665.     color = PrestigeSystem.getColor(0);
  666.     text = PrestigeSystem.getLv(0)+":"+ v1;
  667. /*         }else if (v1 == 0){                        //为0的状态
  668.     v2 = 1;
  669.     color = '#ffffff';
  670.     text = "???";
  671. */        }else {                                                //冷漠
  672.     v2 = PrestigeSystem.getLine(1);
  673.     color = PrestigeSystem.getColor(1);
  674.     var text = PrestigeSystem.getLv(1)+":"+ v1 + "/" + v2;        
  675.     }
  676.     var rate = v1 / v2;                                        //计算声望条的绘制比例
  677.     dy += 30;                                                        //行高变化
  678.     this.drawGauge(gx, dy, dw, rate, color);        //绘制声望条
  679.     this.drawText(text, gx + 12, dy - 4 , dw, 'center');        //绘制要显示在声望条上面的文字
  680. };
  681. //绘制条函数
  682. Window_Shengwang.prototype.drawGauge = function(x, y, width, rate, color) {
  683.     var fillW = Math.floor(width * rate);                        //比例换算成彩条长度
  684. this.contents.fillRect(x, y + 8, width, 20, '#000000');        //绘制条的黑底
  685. this.contents.gradientFillRect(x, y + 8, fillW, 20, color, color);                //绘制彩条

  686. };
复制代码

评分

参与人数 2赞 +2 收起 理由
salvareless + 1 我很赞同
白嫩白嫩的 + 1 666

查看全部评分

游戏爱好者
回复

使用道具 举报

头像被屏蔽
梦石
0
星屑
177
在线时间
936 小时
注册时间
2010-11-13
回帖
897
发表于 2020-3-25 20:28:29 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复

使用道具 举报

梦石
0
星屑
647
在线时间
165 小时
注册时间
2012-4-18
回帖
237
 楼主| 发表于 2021-8-9 20:47:26 | 显示全部楼层
无终 发表于 2020-2-25 00:57
修改了一下,添加了一些参数。
说明:
        大部分参数不用在代码中修改了

我的号终于复活了,感谢您对这个插件的优化,没想到几年过去,还有人能帮我优化插件。大赞
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部