设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 4467|回复: 6

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
637
在线时间
164 小时
注册时间
2012-4-18
帖子
264
发表于 2016-2-24 17:30:09 | 显示全部楼层 |阅读模式

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

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

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

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

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

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

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


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


更新列表:
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 塞糖

查看全部评分

Lv4.逐梦者

梦石
0
星屑
5692
在线时间
1556 小时
注册时间
2011-6-14
帖子
520
发表于 2016-2-24 19:10:33 手机端发表。 | 显示全部楼层
本帖最后由 347780682 于 2016-2-24 21:19 编辑

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

点评

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

使用道具 举报

Lv2.观梦者

梦石
0
星屑
637
在线时间
164 小时
注册时间
2012-4-18
帖子
264
 楼主| 发表于 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
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5692
在线时间
1556 小时
注册时间
2011-6-14
帖子
520
发表于 2019-12-22 20:40:40 | 显示全部楼层
帮楼主唤醒
回复 支持 反对

使用道具 举报

Lv2.观梦者

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

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


JAVASCRIPT 代码复制
  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.  
  148. PrestigeSystem.max = parseInt(PrestigeSystem.parameters['Max'] || '60000'); //最大值
  149. PrestigeSystem.menuName = String(PrestigeSystem.parameters['Menu Name'] || '声望');
  150. PrestigeSystem.unlockText = String(PrestigeSystem.parameters['Unlock Text'] || '?????');
  151. PrestigeSystem.titleText = String(PrestigeSystem.parameters['Title Text'] || '声望和货币');
  152. PrestigeSystem.preText = String(PrestigeSystem.parameters['Prestige Text'] || '声望系统尚未解锁');
  153. PrestigeSystem.goldText = String(PrestigeSystem.parameters['Gold Text'] || '货币系统尚未解锁');
  154. PrestigeSystem.colorString = String(PrestigeSystem.parameters['Colors'] || '#930000,#ff0000,#f75000,#00ffff,#01b468,#00db00,#006000');
  155. PrestigeSystem.lineString = String(PrestigeSystem.parameters['Prestige Number'] || '0,100,800,5000,20000,60000');
  156. PrestigeSystem.prePhase = String(PrestigeSystem.parameters['Prestige Phase'] || '仇恨,冷漠,中立,友善,尊敬,崇敬,崇拜');
  157. 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');
  158. 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');
  159. 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');
  160. 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');
  161. PrestigeSystem.goldName = String(PrestigeSystem.parameters['Gold Name'] || '人民币,美元,欧元,日元,英镑,加元,港币,台币,韩元,澳元,克朗,比索,先令,卢比,第纳尔');
  162. PrestigeSystem.goldVariable = String(PrestigeSystem.parameters['Gold Variable'] || '42,43,44,45,46,47,48,49,50,51,52,53,54,55,56');
  163. PrestigeSystem.repText = String(PrestigeSystem.parameters['Reputation Text'] || '威望:');
  164. PrestigeSystem.repVariable = String(PrestigeSystem.parameters['Reputation Variable'] || '80');
  165. PrestigeSystem.goldIcon = String(PrestigeSystem.parameters['Gold Icon'] || '32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47');
  166.  
  167. function Window_Shengwang() {
  168.     this.initialize.apply(this, arguments);
  169. };
  170.  
  171. Window_Shengwang.prototype = Object.create(Window_Selectable.prototype);
  172. Window_Shengwang.prototype.initialize = function(x, y, width, height) {
  173.     Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  174. };
  175.  
  176. function Scene_Shengwang() {
  177.     this.initialize.apply(this, arguments);
  178. };
  179.  
  180. Scene_Shengwang.prototype = Object.create(Scene_MenuBase.prototype);
  181. Scene_Shengwang.prototype.initialize = function() {
  182. Scene_MenuBase.prototype.initialize.call(this);
  183. };
  184.  
  185. Scene_Shengwang.prototype.create = function() {
  186. Scene_MenuBase.prototype.create.call(this);
  187. this._commandWindow = new Window_Shengwang(0, 0, 816, 624);
  188. this.addWindow(this._commandWindow);
  189. };
  190.  
  191. Scene_Shengwang.prototype.update = function() {
  192. if (Input.isTriggered('escape') || Input.isTriggered('cancel')) {
  193.     this._commandWindow.hide();
  194.     SceneManager.goto(Scene_Menu);
  195. };
  196. };
  197.  
  198.  
  199. // ======================================================================
  200. // 指令读取
  201. // ======================================================================
  202.  
  203. var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  204. Game_Interpreter.prototype.pluginCommand = function (command, args) {
  205.         _Game_Interpreter_pluginCommand.apply(this, arguments);       
  206.         if (command == 'PRESTIGE') {
  207.                 switch (args[0]) {
  208.                         case 'OPEN':
  209.                                 SceneManager.push(Scene_Shengwang);
  210.                 break;
  211.                 }
  212.         }
  213. }
  214.  
  215. // ======================================================================
  216. // 参数处理
  217. // ======================================================================
  218.  
  219. //获取声望最大值
  220. PrestigeSystem.getMax = function(){
  221.     return PrestigeSystem.max;
  222. }
  223.  
  224. //获取菜单参数   1,主菜单  2,顶部文字   3,声望栏顶部提示   4,货币栏顶部提示     5,威望的前缀    6,未解锁时的文字
  225. PrestigeSystem.getTitle = function(param) {
  226.     var value ;
  227.     switch(param){
  228.         case 1:
  229.             value = PrestigeSystem.menuName.trim();
  230.             break;
  231.         case 2:
  232.             value = PrestigeSystem.titleText.trim();
  233.             break
  234.         case 3:
  235.             value = PrestigeSystem.preText.trim();
  236.             break;
  237.         case 4:
  238.             value = PrestigeSystem.goldText.trim();
  239.             break;
  240.         case 5:
  241.             value = PrestigeSystem.repText.trim();
  242.             break;
  243.         case 6:
  244.             value = PrestigeSystem.unlockText.trim();
  245.             break;
  246.     }
  247.     return value === null ? '' : value;
  248. };
  249.  
  250. //获取威望所使用的变量
  251. PrestigeSystem.getRepV = function(){
  252.     var value = (parseInt(PrestigeSystem.repVariable.trim()));
  253.     return value === null ? '' : value;
  254. }
  255.  
  256. //获取颜色码
  257. PrestigeSystem.getColor = function(param) {
  258.     var values = this.getString(PrestigeSystem.colorString);
  259.     return values[param];
  260. }
  261.  
  262. //获取分隔声望值标准
  263. PrestigeSystem.getLine = function(param) {
  264.     var values = this.getNumber(PrestigeSystem.lineString);
  265.     return values[param];
  266. }
  267.  
  268. //获取声望等级名称
  269. PrestigeSystem.getLv = function(param) {
  270.     var values = this.getString(PrestigeSystem.prePhase);
  271.     return values[param];
  272. }
  273.  
  274. //获取声望名称
  275. PrestigeSystem.getPName = function(param) {
  276.     var values = this.getString(PrestigeSystem.preName);
  277.     return values[param];
  278. }
  279.  
  280. //获取变量号
  281. PrestigeSystem.getPreV = function(param) {
  282.     var values = this.getNumber(PrestigeSystem.preVariable);
  283.     return values[param];
  284. }
  285.  
  286. //获取开关号
  287. PrestigeSystem.getPreS = function(param) {
  288.     var values = this.getNumber(PrestigeSystem.preSwitch);
  289.     return values[param];
  290. }
  291.  
  292. //获取图标号
  293. PrestigeSystem.getPIcon = function(param) {
  294.     var values = this.getNumber(PrestigeSystem.preIcon);
  295.     return values[param];
  296. }
  297.  
  298. //获取货币名称
  299. PrestigeSystem.getGName = function(param) {
  300.     var values = this.getString(PrestigeSystem.goldName);
  301.     return values[param];
  302. }
  303.  
  304. //获取货币变量号
  305. PrestigeSystem.getGV = function(param) {
  306.     var values = this.getNumber(PrestigeSystem.goldVariable);
  307.     return values[param];
  308. }
  309.  
  310. //获取货币图标号
  311. PrestigeSystem.getGIcon = function(param) {
  312.     var values = this.getNumber(PrestigeSystem.goldIcon);
  313.     return values[param];
  314. }
  315.  
  316. //获取字符参数
  317. PrestigeSystem.getText = function(param) {
  318.     var value = param.trim();
  319.     return value === null ? '' : value;
  320. };
  321.  
  322. //获取字符串参数
  323. PrestigeSystem.getString = function(paramNames) {
  324.     var values = this.getText(paramNames).split(',');
  325.     for (var i = 0; i < values.length; i++) values[i] = values[i].trim();
  326.     return values;
  327. };
  328.  
  329. //获取Int参数
  330. PrestigeSystem.getNumber = function(paramNames) {
  331.     var values = this.getString(paramNames);
  332.     for (var i = 0; i < values.length; i++) values[i] = (parseInt(values[i]) || 0);
  333.     return values;
  334. };
  335.  
  336. // ======================================================================
  337. // * Scene_Menu
  338. // ======================================================================
  339. Scene_Menu.prototype.Shengwang_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
  340. Scene_Menu.prototype.createCommandWindow = function() {
  341.     this.Shengwang_createCommandWindow();
  342.     this._commandWindow.setHandler('shengwang',   this.command_Shengwang.bind(this));
  343. };
  344. Scene_Menu.prototype.command_Shengwang = function() {
  345.     SceneManager.push(Scene_Shengwang);
  346. };
  347.  
  348. // ======================================================================
  349. // * Window_MenuCommand
  350. // ======================================================================
  351. Window_MenuCommand.prototype.Shengwang_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
  352. Window_MenuCommand.prototype.addOriginalCommands = function() {
  353.     this.Shengwang_addOriginalCommands();
  354.     this.addCommand(PrestigeSystem.getTitle(1), 'shengwang', this.areMainCommandsEnabled());
  355. };
  356.  
  357. //=======================================================================
  358. // 显示区段
  359. //=======================================================================
  360. Window_Shengwang.prototype.initialize = function(x, y, width, height) {
  361. Window_Selectable.prototype.initialize.call(this, x, y, width, height);
  362. this.drawShengwangText();
  363. };
  364.  
  365. Window_Shengwang.prototype.drawShengwangText = function() {
  366.     var dy = 0;
  367.     var dx = 34;                                //左侧文字绘制的X坐标,已经留出图标位置。
  368.     var di = 277;                                //中间图标显示的X坐标,左侧为0
  369.     var dxx = 311;                                //中间文字绘制的X坐标。已经留出图标位置。
  370.     var dii = 554;                                //右侧图标绘制的X坐标。
  371.     var dxxx = 588;                                //右侧文字绘制的X坐标,已经留出图标位置。
  372.     var dw = 230;                                //界面总宽
  373.     var gx = 0;                                
  374.     this.contents.fontSize = 20;
  375.     this.drawText(PrestigeSystem.getTitle(2), 0, -10, dw, 'left');
  376.     if ($gameVariables.value(PrestigeSystem.getRepV()) > 0){
  377.     this.drawText(PrestigeSystem.getTitle(5) + $gameVariables.value(PrestigeSystem.getRepV()), 0, -10 ,778, 'right');        
  378.     };
  379.     this.drawText("————————————————————————————————————————————————————————————————————————————", 0, dy + 8, 784, 'left');
  380.     this.contents.fontSize = 20;
  381.     //声望区段
  382.     //第一行
  383.     dy += 32;        //行高变化
  384.     //左
  385.     if ($gameSwitches.value(PrestigeSystem.getPreS(0)) == true){
  386.     this.drawIcon(PrestigeSystem.getPIcon(0), 0, dy + 3);               
  387.     this.drawText(PrestigeSystem.getPName(0), dx, dy, dw, 'left');
  388.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(0)), gx ,dy ,dw);        //条显示的函数,第一个值为要使用的变量        
  389.     }else{
  390.     this.drawText(PrestigeSystem.getTitle(3), 0, dy, dw, 'left');
  391.     };
  392.     //中
  393.     if ($gameSwitches.value(PrestigeSystem.getPreS(1)) == true){
  394.     if ($gameVariables.value(PrestigeSystem.getPreV(1)) == 0){
  395.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  396.     } else{
  397.     this.drawIcon( PrestigeSystem.getPIcon(1), di, dy + 3);
  398.     this.drawText(PrestigeSystem.getPName(1), dxx, dy, dw, 'left' );
  399.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(1)), gx + 277 ,dy ,dw);
  400.     };};
  401.     //右
  402.     if ($gameSwitches.value(PrestigeSystem.getPreS(2)) == true){
  403.     if ($gameVariables.value(PrestigeSystem.getPreV(2)) == 0){
  404.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  405.     } else{
  406.     this.drawIcon( PrestigeSystem.getPIcon(2), dii, dy + 3);
  407.     this.drawText(PrestigeSystem.getPName(2), dxxx, dy, dw, 'left' );
  408.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(2)), gx + 554 ,dy ,dw);
  409.     };};
  410.     //第二行
  411.     dy += 61;                        //行高变化
  412.     //左
  413.     if ($gameSwitches.value(PrestigeSystem.getPreS(3)) == true){
  414.     if ($gameVariables.value(PrestigeSystem.getPreV(3)) == 0){
  415.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  416.     } else{
  417.     this.drawIcon( PrestigeSystem.getPIcon(3), 0, dy + 3);               
  418.     this.drawText(PrestigeSystem.getPName(3), dx, dy, dw, 'left');
  419.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(3)), gx ,dy ,dw);        
  420.     };};
  421.     //中
  422.     if ($gameSwitches.value(PrestigeSystem.getPreS(4)) == true){
  423.     if ($gameVariables.value(PrestigeSystem.getPreV(4)) == 0){
  424.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  425.     } else{
  426.     this.drawIcon( PrestigeSystem.getPIcon(4), di, dy + 3);
  427.     this.drawText(PrestigeSystem.getPName(4), dxx, dy, dw, 'left' );
  428.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(4)), gx + 277 ,dy ,dw);
  429.     };};
  430.     //右
  431.     if ($gameSwitches.value(PrestigeSystem.getPreS(5)) == true){
  432.     if ($gameVariables.value(PrestigeSystem.getPreV(5)) == 0){
  433.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  434.     } else{
  435.     this.drawIcon( PrestigeSystem.getPIcon(5), dii, dy + 3);
  436.     this.drawText(PrestigeSystem.getPName(5), dxxx, dy, dw, 'left' );
  437.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(5)), gx + 554 ,dy ,dw);
  438.     };};
  439.     //第三行
  440.     dy += 61;                        //行高变化
  441.     //左
  442.     if ($gameSwitches.value(PrestigeSystem.getPreS(6)) == true){
  443.     if ($gameVariables.value(PrestigeSystem.getPreV(6)) == 0){
  444.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  445.     } else{
  446.     this.drawIcon( PrestigeSystem.getPIcon(6), 0, dy + 3);               
  447.     this.drawText(PrestigeSystem.getPName(6), dx, dy, dw, 'left');
  448.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(6)), gx ,dy ,dw);               
  449.     };};
  450.     //中
  451.     if ($gameSwitches.value(PrestigeSystem.getPreS(7)) == true){
  452.     if ($gameVariables.value(PrestigeSystem.getPreV(7)) == 0){
  453.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  454.     } else{
  455.     this.drawIcon( PrestigeSystem.getPIcon(7), di, dy + 3);
  456.     this.drawText(PrestigeSystem.getPName(7), dxx, dy, dw, 'left' );
  457.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(7)), gx + 277 ,dy ,dw);
  458.     };};
  459.     //右
  460.     if ($gameSwitches.value(PrestigeSystem.getPreS(8)) == true){
  461.     if ($gameVariables.value(PrestigeSystem.getPreV(8)) == 0){
  462.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  463.     } else{
  464.     this.drawIcon( PrestigeSystem.getPIcon(8), dii, dy + 3);
  465.     this.drawText(PrestigeSystem.getPName(8), dxxx, dy, dw, 'left' );
  466.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(8)), gx + 554 ,dy ,dw);
  467.     };};
  468.     //第四行
  469.     dy += 61;                        //行高变化
  470.     //左
  471.     if ($gameSwitches.value(PrestigeSystem.getPreS(9)) == true){
  472.     if ($gameVariables.value(PrestigeSystem.getPreV(9)) == 0){
  473.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  474.     } else{
  475.     this.drawIcon( PrestigeSystem.getPIcon(9), 0, dy + 3);               
  476.     this.drawText(PrestigeSystem.getPName(9), dx, dy, dw, 'left');
  477.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(9)), gx ,dy ,dw);               
  478.     };};
  479.     //中
  480.     if ($gameSwitches.value(PrestigeSystem.getPreS(10)) == true){
  481.     if ($gameVariables.value(PrestigeSystem.getPreV(10)) == 0){
  482.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  483.     } else{
  484.     this.drawIcon( PrestigeSystem.getPIcon(10), di, dy + 3);
  485.     this.drawText(PrestigeSystem.getPName(10), dxx, dy, dw, 'left' );
  486.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(10)), gx + 277 ,dy ,dw);
  487.     };};
  488.     //右
  489.     if ($gameSwitches.value(PrestigeSystem.getPreS(11)) == true){
  490.     if ($gameVariables.value(PrestigeSystem.getPreV(11)) == 0){
  491.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  492.     } else{
  493.     this.drawIcon( PrestigeSystem.getPIcon(11), dii, dy + 3);
  494.     this.drawText(PrestigeSystem.getPName(11), dxxx, dy, dw, 'left' );
  495.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(11)), gx + 554 ,dy ,dw);
  496.     };};
  497.     //第五行
  498.     dy += 61;                        //行高变化
  499.     //左
  500.     if ($gameSwitches.value(PrestigeSystem.getPreS(12)) == true){
  501.     if ($gameVariables.value(PrestigeSystem.getPreV(12)) == 0){
  502.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  503.     } else{
  504.     this.drawIcon( PrestigeSystem.getPIcon(12), 0, dy + 3);               
  505.     this.drawText(PrestigeSystem.getPName(12), dx, dy, dw, 'left');
  506.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(12)), gx ,dy ,dw);        
  507.     };};
  508.     //中
  509.     if ($gameSwitches.value(PrestigeSystem.getPreS(13)) == true){
  510.     if ($gameVariables.value(PrestigeSystem.getPreV(13)) == 0){
  511.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  512.     } else{
  513.     this.drawIcon( PrestigeSystem.getPIcon(13), di, dy + 3);
  514.     this.drawText(PrestigeSystem.getPName(13), dxx, dy, dw, 'left' );
  515.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(13)), gx + 277 ,dy ,dw);
  516.     };};
  517.     //右
  518.     if ($gameSwitches.value(PrestigeSystem.getPreS(14)) == true){
  519.     if ($gameVariables.value(PrestigeSystem.getPreV(14)) == 0){
  520.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  521.     } else{
  522.     this.drawIcon( PrestigeSystem.getPIcon(14), dii, dy + 3);
  523.     this.drawText(PrestigeSystem.getPName(14), dxxx, dy, dw, 'left' );
  524.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(14)), gx + 554 ,dy ,dw);
  525.     };};
  526.     //第六行
  527.     dy += 61;                        //行高变化
  528.     //左
  529.     if ($gameSwitches.value(PrestigeSystem.getPreS(15)) == true){
  530.     if ($gameVariables.value(PrestigeSystem.getPreV(15)) == 0){
  531.     this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
  532.     } else{
  533.     this.drawIcon( PrestigeSystem.getPIcon(15), 0, dy + 3);               
  534.     this.drawText(PrestigeSystem.getPName(15), dx, dy, dw, 'left');
  535.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(15)), gx ,dy ,dw);        
  536.     };};
  537.     //中
  538.     if ($gameSwitches.value(PrestigeSystem.getPreS(16)) == true){
  539.     if ($gameVariables.value(PrestigeSystem.getPreV(16)) == 0){
  540.     this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
  541.     } else{
  542.     this.drawIcon( PrestigeSystem.getPIcon(16), di, dy + 3);
  543.     this.drawText(PrestigeSystem.getPName(16), dxx, dy, dw, 'left' );
  544.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(16)), gx + 277 ,dy ,dw);
  545.     };};
  546.     //右
  547.     if ($gameSwitches.value(PrestigeSystem.getPreS(17)) == true){
  548.     if ($gameVariables.value(PrestigeSystem.getPreV(17)) == 0){
  549.     this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
  550.     } else{
  551.     this.drawIcon( PrestigeSystem.getPIcon(17), dii, dy + 3);
  552.     this.drawText(PrestigeSystem.getPName(17), dxxx, dy, dw, 'left' );
  553.     this.dataMath($gameVariables.value(PrestigeSystem.getPreV(17)), gx + 554 ,dy ,dw);
  554.     };};
  555.     //声望区段END
  556.     dy = 387;
  557.     this.drawText("————————————————————————————————————————————————————————————————————————————", 0, dy, 784, 'left');
  558.     var hi = 0;                 //一位X坐标,框宽加1像素的边距
  559.     var hii = 157;                //二位X坐标
  560.     var hiii = 314                //三位X坐标
  561.     var hiv = 471;                //四位X坐标
  562.     var hv = 628;                //五位X坐标
  563.     var hw = 156;                //每个框宽
  564.  
  565.     //货币区段
  566.     dy = 407;                        //第一行
  567.     //左
  568.     if ($gameVariables.value(PrestigeSystem.getGV(0)) > 0){
  569.     this.drawIcon( PrestigeSystem.getGIcon(0), hi, dy + 30);
  570.     this.drawText(PrestigeSystem.getGName(0)+":", hi, dy, hw);
  571.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(0)), hi + 35, dy + 30, hw, 'left' );
  572.     } else{
  573.     this.drawText(PrestigeSystem.getTitle(4), hi, dy, 784);
  574.     };
  575.     //左中
  576.     if ($gameVariables.value(PrestigeSystem.getGV(1)) > 0){
  577.     this.drawIcon( PrestigeSystem.getGIcon(1), hii, dy + 30);        
  578.     this.drawText(PrestigeSystem.getGName(1)+":", hii, dy, hw);
  579.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(1)), hii + 35, dy + 30, hw, 'left' );
  580.     };
  581.     //中
  582.     if ($gameVariables.value(PrestigeSystem.getGV(2)) > 0){
  583.     this.drawIcon( PrestigeSystem.getGIcon(2), hiii, dy + 30);
  584.     this.drawText(PrestigeSystem.getGName(2)+":", hiii, dy, hw);
  585.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(2)), hiii + 35, dy + 30, hw, 'left' );
  586.     };
  587.     //右中
  588.     if ($gameVariables.value(PrestigeSystem.getGV(3)) > 0){
  589.     this.drawIcon( PrestigeSystem.getGIcon(3), hiv, dy + 30);
  590.     this.drawText(PrestigeSystem.getGName(3)+":", hiv, dy, hw);
  591.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(3)), hiv + 35, dy + 30, hw, 'left' );
  592.     };
  593.     //右
  594.     if ($gameVariables.value(PrestigeSystem.getGV(4)) > 0){
  595.     this.drawIcon( PrestigeSystem.getGIcon(4), hv, dy + 30);
  596.     this.drawText(PrestigeSystem.getGName(4)+":", hv, dy, hw);
  597.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(4)), hv + 35, dy + 30, hw, 'left' );
  598.     };
  599.     dy = 466;                        //第二行
  600.     //左
  601.     if ($gameVariables.value(PrestigeSystem.getGV(5)) > 0){
  602.     this.drawIcon( PrestigeSystem.getGIcon(5), hi, dy + 30);
  603.     this.drawText(PrestigeSystem.getGName(5)+":", hi, dy, hw);
  604.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(5)), hi + 35, dy + 30, hw, 'left' );
  605.     };
  606.     //左中
  607.     if ($gameVariables.value(PrestigeSystem.getGV(6)) > 0){
  608.     this.drawIcon( PrestigeSystem.getGIcon(6), hii, dy + 30);
  609.     this.drawText(PrestigeSystem.getGName(6)+":", hii, dy, hw);
  610.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(6)), hii + 35, dy + 30, hw, 'left' );
  611.     };
  612.     //中
  613.     if ($gameVariables.value(PrestigeSystem.getGV(7)) > 0){
  614.     this.drawIcon( PrestigeSystem.getGIcon(7), hiii, dy + 30);
  615.     this.drawText(PrestigeSystem.getGName(7)+":", hiii, dy, hw);
  616.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(7)), hiii + 35, dy + 30, hw, 'left' );
  617.     };
  618.     //右中
  619.     if ($gameVariables.value(PrestigeSystem.getGV(8)) > 0){
  620.     this.drawIcon( PrestigeSystem.getGIcon(8), hiv, dy + 30);
  621.     this.drawText(PrestigeSystem.getGName(8)+":", hiv, dy, hw);
  622.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(8)), hiv + 35, dy + 30, hw, 'left' );
  623.     };
  624.     //右
  625.     if ($gameVariables.value(PrestigeSystem.getGV(9)) > 0){
  626.     this.drawIcon( PrestigeSystem.getGIcon(9), hv, dy + 30);
  627.     this.drawText(PrestigeSystem.getGName(9)+":", hv, dy, hw);
  628.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(9)), hv + 35, dy + 30, hw, 'left' );
  629.     };
  630.     dy = 525;                        //第三行
  631.     //左
  632.     if ($gameVariables.value(PrestigeSystem.getGV(10)) > 0){
  633.     this.drawIcon( PrestigeSystem.getGIcon(10), hi, dy + 30);
  634.     this.drawText(PrestigeSystem.getGName(10)+":", hi, dy, hw);
  635.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(10)), hi + 35, dy + 30, hw, 'left' );
  636.     };
  637.     //左中
  638.     if ($gameVariables.value(PrestigeSystem.getGV(11)) > 0){
  639.     this.drawIcon( PrestigeSystem.getGIcon(11), hii, dy + 30);
  640.     this.drawText(PrestigeSystem.getGName(11)+":", hii, dy, hw);
  641.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(11)), hii + 35, dy + 30, hw, 'left' );
  642.     };
  643.     //中
  644.     if ($gameVariables.value(PrestigeSystem.getGV(12)) > 0){
  645.     this.drawIcon( PrestigeSystem.getGIcon(12), hiii, dy + 30);
  646.     this.drawText(PrestigeSystem.getGName(12)+":", hiii, dy, hw);
  647.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(12)), hiii + 35, dy + 30, hw, 'left' );
  648.     };
  649.     //右中
  650.     if ($gameVariables.value(PrestigeSystem.getGV(13)) > 0){
  651.     this.drawIcon( PrestigeSystem.getGIcon(13), hiv, dy + 30);
  652.     this.drawText(PrestigeSystem.getGName(13)+":", hiv, dy, hw);
  653.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(13)), hiv + 35, dy + 30, hw, 'left' );
  654.     };
  655.     //右
  656.     if ($gameVariables.value(PrestigeSystem.getGV(14)) > 0){
  657.     this.drawIcon( PrestigeSystem.getGIcon(14), hv, dy + 30);
  658.     this.drawText(PrestigeSystem.getGName(14)+":", hv, dy, hw);
  659.     this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(14)), hv + 35, dy + 30, hw, 'left' );
  660.     };
  661.     //货币区段END  
  662. };
  663. //条显示的函数
  664. //Color  '#ff0000'   faff72   eaff56   40de5a   00e400    00ff00   000000
  665. Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
  666.     var v1 = data;        
  667.     var v2 = 1;
  668.     var text = "";
  669.     var color = PrestigeSystem.getColor(0);
  670.     if (v1 >= PrestigeSystem.getLine(5)){        //崇拜
  671.         if(v1 >= PrestigeSystem.getMax()){
  672.             v1 = PrestigeSystem.getMax();
  673.         }else{
  674.             v1 = data;
  675.         }   
  676.     v2 = PrestigeSystem.getLine(5);                                                        //当前阶段的声望上限
  677.     color = PrestigeSystem.getColor(6);                                        //设置声望条的颜色
  678.     text = PrestigeSystem.getLv(6)+":"+ v1 + "/" + v2;                //赋值要显示在声望条上面的文字
  679.     }else if (v1 >= PrestigeSystem.getLine(4)){                //崇敬
  680.     v2 = PrestigeSystem.getLine(5);
  681.     color = PrestigeSystem.getColor(5);
  682.     text = PrestigeSystem.getLv(5)+":"+ v1 + "/" + v2;
  683.     }else if (v1 >= PrestigeSystem.getLine(3)){                //尊敬
  684.     v2 = PrestigeSystem.getLine(4);
  685.     color = PrestigeSystem.getColor(4);
  686.     text = PrestigeSystem.getLv(4)+":"+ v1 + "/" + v2;
  687.     }else if (v1 >= PrestigeSystem.getLine(2)){                //尊重
  688.     v2 = PrestigeSystem.getLine(3);
  689.     color = PrestigeSystem.getColor(3);
  690.     text = PrestigeSystem.getLv(3)+":"+ v1 + "/" + v2;
  691.     }else if (v1 >= PrestigeSystem.getLine(1)){                //友善
  692.     v2 = PrestigeSystem.getLine(2);
  693.     color = PrestigeSystem.getColor(2);
  694.     text = PrestigeSystem.getLv(2)+":"+ v1 + "/" + v2;
  695.     }else if (v1 < PrestigeSystem.getLine(0)){                        //仇恨
  696.     v2 = v1;
  697.     color = PrestigeSystem.getColor(0);
  698.     text = PrestigeSystem.getLv(0)+":"+ v1;
  699. /*         }else if (v1 == 0){                        //为0的状态
  700.     v2 = 1;
  701.     color = '#ffffff';
  702.     text = "???";
  703. */        }else {                                                //冷漠
  704.     v2 = PrestigeSystem.getLine(1);
  705.     color = PrestigeSystem.getColor(1);
  706.     var text = PrestigeSystem.getLv(1)+":"+ v1 + "/" + v2;        
  707.     }
  708.     var rate = v1 / v2;                                        //计算声望条的绘制比例
  709.     dy += 30;                                                        //行高变化
  710.     this.drawGauge(gx, dy, dw, rate, color);        //绘制声望条
  711.     this.drawText(text, gx + 12, dy - 4 , dw, 'center');        //绘制要显示在声望条上面的文字
  712. };
  713. //绘制条函数
  714. Window_Shengwang.prototype.drawGauge = function(x, y, width, rate, color) {
  715.     var fillW = Math.floor(width * rate);                        //比例换算成彩条长度
  716. this.contents.fillRect(x, y + 8, width, 20, '#000000');        //绘制条的黑底
  717. this.contents.gradientFillRect(x, y + 8, fillW, 20, color, color);                //绘制彩条
  718.  
  719. };

评分

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

查看全部评分

游戏爱好者
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv2.观梦者 (禁止发言)

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

使用道具 举报

Lv2.观梦者

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

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-16 15:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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