Project1
标题: 自用的声望及额外货币显示插件——然而并没有什么乱用 [打印本页]
作者: salvareless 时间: 2016-2-24 17:30
标题: 自用的声望及额外货币显示插件——然而并没有什么乱用
本帖最后由 salvareless 于 2016-2-24 23:08 编辑
RT,自己写自己用的,用途是用显示用变量做的声望,以及显示用变量做的额外货币,和自己用的一个叫做威望的变量。
如果要实现全部用途,需要具备YEP_ShopMenuCore和YEP_X_MoreCurrencies这两个插件。本插件可以配和这两个插件中实现的用变量当货币功能,提供其显示当作变量用的货币的持有数量。
如果只需要声望系统的话,直接屏蔽掉变量货币部分然后改改代码中的备注有//行高变化,那一行的值就行了。
以下是代码,代码中有具体的说明和注释方便大家修改。
最后,由于各种不会,所以代码写得很乱,而且很多数据,例如图标,声望和货币的名字都需要直接在插件中逐个改,而且最好根据游戏的进程一边设计剧情一边改,不然会出现显示上面的不和谐。因为每个框都在固定的地方,如果预先设好的话,可能会出现二号声望没开结果十号先开了,然后就会出现一大片空白,中间莫名其妙显示着一个声望框- -
//=============================================================================
// Salvareless Ownuse System
// SOS_声望系统.js
//=============================================================================
//帮助区段
//因为比较靠前的开关和变量大多情况下都有其他插件占用,所以本插件从62号变量开始,61留空写标注。
//声望开关从62号到79号共18个
//声望变量从62号到79号共18个
//威望变量为80号。威望用以影响部分NPC物价,为0时不显示。
//声望开关62号对应声望变量62号,往下一一对应。对应的开关开启式,才会显示对应的声望计数。
//声望计数从负无穷到正六万,负可以无限负,正只到六万。
//声望值达到0,100,800,5000,20000,60000时进入下一个声望阶段。
//声望阶段依次是:仇恨,冷漠,友善,尊重,尊敬,崇敬,崇拜
//变量货币需要配合YEP_ShopMenuCore和YEP_X_MoreCurrencies才更有意义,必然就只能做固定的物品兑换事件
//变量当货币使用到的变量从42号开始到56号,一共15个。
//已经设置货币当变量用时,大于0才会显示出来。
//默认声望一共18个,变量货币15个,请随意根据需要删减,= =应该不会用到比这个数量更多了吧…………
//由于各种不会,所以图标,和声望名字,货币名字什么的,都需要在插件中直接改。
//由于各种不会,所以代码写得超级乱。
//帮助区段END
//=========================================================================
// 声明区段
//=========================================================================
function Window_Shengwang() {
this.initialize.apply(this, arguments);
};
Window_Shengwang.prototype = Object.create(Window_Selectable.prototype);
Window_Shengwang.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
};
function Scene_Shengwang() {
this.initialize.apply(this, arguments);
};
Scene_Shengwang.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Shengwang.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Shengwang.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._commandWindow = new Window_Shengwang(0, 0, 816, 624);
this.addWindow(this._commandWindow);
};
Scene_Shengwang.prototype.update = function() {
if (Input.isTriggered('escape') || Input.isTriggered('cancel')) {
this._commandWindow.hide();
SceneManager.goto(Scene_Menu);
};
};
// ======================================================================
// * Scene_Menu
// ======================================================================
Scene_Menu.prototype.Shengwang_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
this.Shengwang_createCommandWindow();
this._commandWindow.setHandler('shengwang', this.command_Shengwang.bind(this));
};
Scene_Menu.prototype.command_Shengwang = function() {
SceneManager.push(Scene_Shengwang);
};
// ======================================================================
// * Window_MenuCommand
// ======================================================================
Window_MenuCommand.prototype.Shengwang_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.Shengwang_addOriginalCommands();
this.addCommand('声望货币', 'shengwang', this.areMainCommandsEnabled());
};
//=======================================================================
// 显示区段
//=======================================================================
Window_Shengwang.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this.drawShengwangText();
};
Window_Shengwang.prototype.drawShengwangText = function() {
var dy = 0;
var dx = 34; //左侧文字绘制的X坐标,已经留出图标位置。
var di = 277; //中间图标显示的X坐标,左侧为0
var dxx = 311; //中间文字绘制的X坐标。已经留出图标位置。
var dii = 554; //右侧图标绘制的X坐标。
var dxxx = 588; //右侧文字绘制的X坐标,已经留出图标位置。
var dw = 230; //界面总宽
var gx = 0;
this.contents.fontSize = 20;
this.drawText("声望和货币", 0, -10, dw, 'left');
if ($gameVariables.value(80) > 0){
this.drawText("威望:" + $gameVariables.value(80), 0, -10 ,778, 'right');
};
this.drawText("—————————————————————————————————————————", 0, dy + 8, 784, 'left');
this.contents.fontSize = 20;
//声望区段
//第一行
dy += 32; //行高变化
//左
if ($gameSwitches.value(62) == true){
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(62), gx ,dy ,dw); //条显示的函数,第一个值为要使用的变量
}else{
this.drawText("声望系统尚未开启", 0, dy, dw, 'left');
};
//中
if ($gameSwitches.value(63) == true){
if ($gameVariables.value(63) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(63), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(64) == true){
if ($gameVariables.value(64) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(64), gx + 554 ,dy ,dw);
};};
//第二行
dy += 61; //行高变化
//左
if ($gameSwitches.value(65) == true){
if ($gameVariables.value(65) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(65), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(66) == true){
if ($gameVariables.value(66) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(66), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(67) == true){
if ($gameVariables.value(67) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(67), gx + 554 ,dy ,dw);
};};
//第三行
dy += 61; //行高变化
//左
if ($gameSwitches.value(68) == true){
if ($gameVariables.value(68) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(68), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(69) == true){
if ($gameVariables.value(69) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(69), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(70) == true){
if ($gameVariables.value(70) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(70), gx + 554 ,dy ,dw);
};};
//第四行
dy += 61; //行高变化
//左
if ($gameSwitches.value(71) == true){
if ($gameVariables.value(71) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(71), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(72) == true){
if ($gameVariables.value(72) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(72), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(73) == true){
if ($gameVariables.value(73) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(73), gx + 554 ,dy ,dw);
};};
//第五行
dy += 61; //行高变化
//左
if ($gameSwitches.value(74) == true){
if ($gameVariables.value(74) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(74), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(75) == true){
if ($gameVariables.value(75) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(75), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(76) == true){
if ($gameVariables.value(76) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(76), gx + 554 ,dy ,dw);
};};
//第六行
dy += 61; //行高变化
//左
if ($gameSwitches.value(77) == true){
if ($gameVariables.value(77) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(77), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(78) == true){
if ($gameVariables.value(78) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(78), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(79) == true){
if ($gameVariables.value(79) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(79), gx + 554 ,dy ,dw);
};};
//声望区段END
dy = 387;
this.drawText("————————————————————————————————————", 0, dy, 784, 'left');
var hi = 0; //一位X坐标,框宽加1像素的边距
var hii = 157; //二位X坐标
var hiii = 314 //三位X坐标
var hiv = 471; //四位X坐标
var hv = 628; //五位X坐标
var hw = 156; //每个框宽
//货币区段
dy = 407; //第一行
//左
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hi, dy + 30);
this.drawText("神殿晶体:", hi, dy, hw);
this.drawText("x " + $gameVariables.value(42), hi + 35, dy + 30, hw, 'left' );
} else{
this.drawText("货币系统尚未开启", hi, dy, 784);
};
//左中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hii, dy + 30);
this.drawText("神殿晶体:", hii, dy, hw);
this.drawText("x " + $gameVariables.value(43), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiii, dy + 30);
this.drawText("神殿晶体:", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(44), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiv, dy + 30);
this.drawText("神殿晶体:", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(45), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hv, dy + 30);
this.drawText("神殿晶体:", hv, dy, hw);
this.drawText("x " + $gameVariables.value(46), hv + 35, dy + 30, hw, 'left' );
};
dy = 466; //第二行
//左
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hi, dy + 30);
this.drawText("神殿晶体:", hi, dy, hw);
this.drawText("x " + $gameVariables.value(47), hi + 35, dy + 30, hw, 'left' );
};
//左中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hii, dy + 30);
this.drawText("神殿晶体:", hii, dy, hw);
this.drawText("x " + $gameVariables.value(48), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiii, dy + 30);
this.drawText("神殿晶体:", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(49), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiv, dy + 30);
this.drawText("神殿晶体:", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(50), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hv, dy + 30);
this.drawText("神殿晶体:", hv, dy, hw);
this.drawText("x " + $gameVariables.value(51), hv + 35, dy + 30, hw, 'left' );
};
dy = 525; //第三行
//左
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hi, dy + 30);
this.drawText("神殿晶体:", hi, dy, hw);
this.drawText("x " + $gameVariables.value(52), hi + 35, dy + 30, hw, 'left' );
};
//左中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hii, dy + 30);
this.drawText("神殿晶体:", hii, dy, hw);
this.drawText("x " + $gameVariables.value(53), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiii, dy + 30);
this.drawText("神殿晶体:", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(54), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiv, dy + 30);
this.drawText("神殿晶体:", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(55), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hv, dy + 30);
this.drawText("神殿晶体:", hv, dy, hw);
this.drawText("x " + $gameVariables.value(56), hv + 35, dy + 30, hw, 'left' );
};
//货币区段END
};
//条显示的函数
Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
var v1 = data;
var v2 = 1;
var text = "";
var color = '#000000';
if (v1 >= 60000){ //崇拜
v1 = 60000;
v2 = 60000; //当前阶段的声望上限
color = '#00ff00'; //设置声望条的颜色
text = "崇拜:"+ v1 + "/" + v2; //赋值要显示在声望条上面的文字
}else if (v1 >= 20000){ //崇敬
v2 = 60000;
color = '#00e400';
text = "崇敬:"+ v1 + "/" + v2;
}else if (v1 >= 5000){ //尊敬
v2 = 20000;
color = '#40de5a';
text = "尊敬:"+ v1 + "/" + v2;
}else if (v1 >= 800){ //尊重
v2 = 5000;
color = '#eaff56';
text = "尊重:"+ v1 + "/" + v2;
}else if (v1 >= 100){ //友善
v2 = 800;
color = '#faff72';
text = "友善:"+ v1 + "/" + v2;
}else if (v1 < 0){ //仇恨
v2 = v1;
color = '#ff0000';
text = "仇恨:"+ v1;
/* }else if (v1 == 0){ //为0的状态
v2 = 1;
color = '#ffffff';
text = "???";
*/ }else { //冷漠
v2 = 100;
color = '#ffa400';
var text = "冷漠:"+ v1 + "/" + v2;
}
var rate = v1 / v2; //计算声望条的绘制比例
dy += 30; //行高变化
this.drawGauge(gx, dy, dw, rate, color); //绘制声望条
this.drawText(text, gx + 12, dy - 4 , dw, 'center'); //绘制要显示在声望条上面的文字
};
//绘制条函数
Window_Shengwang.prototype.drawGauge = function(x, y, width, rate, color) {
var fillW = Math.floor(width * rate); //比例换算成彩条长度
this.contents.fillRect(x, y + 8, width, 20, '#000000'); //绘制条的黑底
this.contents.gradientFillRect(x, y + 8, fillW, 20, color, color); //绘制彩条
};
//=============================================================================
// Salvareless Ownuse System
// SOS_声望系统.js
//=============================================================================
//帮助区段
//因为比较靠前的开关和变量大多情况下都有其他插件占用,所以本插件从62号变量开始,61留空写标注。
//声望开关从62号到79号共18个
//声望变量从62号到79号共18个
//威望变量为80号。威望用以影响部分NPC物价,为0时不显示。
//声望开关62号对应声望变量62号,往下一一对应。对应的开关开启式,才会显示对应的声望计数。
//声望计数从负无穷到正六万,负可以无限负,正只到六万。
//声望值达到0,100,800,5000,20000,60000时进入下一个声望阶段。
//声望阶段依次是:仇恨,冷漠,友善,尊重,尊敬,崇敬,崇拜
//变量货币需要配合YEP_ShopMenuCore和YEP_X_MoreCurrencies才更有意义,必然就只能做固定的物品兑换事件
//变量当货币使用到的变量从42号开始到56号,一共15个。
//已经设置货币当变量用时,大于0才会显示出来。
//默认声望一共18个,变量货币15个,请随意根据需要删减,= =应该不会用到比这个数量更多了吧…………
//由于各种不会,所以图标,和声望名字,货币名字什么的,都需要在插件中直接改。
//由于各种不会,所以代码写得超级乱。
//帮助区段END
//=========================================================================
// 声明区段
//=========================================================================
function Window_Shengwang() {
this.initialize.apply(this, arguments);
};
Window_Shengwang.prototype = Object.create(Window_Selectable.prototype);
Window_Shengwang.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
};
function Scene_Shengwang() {
this.initialize.apply(this, arguments);
};
Scene_Shengwang.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Shengwang.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Shengwang.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._commandWindow = new Window_Shengwang(0, 0, 816, 624);
this.addWindow(this._commandWindow);
};
Scene_Shengwang.prototype.update = function() {
if (Input.isTriggered('escape') || Input.isTriggered('cancel')) {
this._commandWindow.hide();
SceneManager.goto(Scene_Menu);
};
};
// ======================================================================
// * Scene_Menu
// ======================================================================
Scene_Menu.prototype.Shengwang_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
this.Shengwang_createCommandWindow();
this._commandWindow.setHandler('shengwang', this.command_Shengwang.bind(this));
};
Scene_Menu.prototype.command_Shengwang = function() {
SceneManager.push(Scene_Shengwang);
};
// ======================================================================
// * Window_MenuCommand
// ======================================================================
Window_MenuCommand.prototype.Shengwang_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.Shengwang_addOriginalCommands();
this.addCommand('声望货币', 'shengwang', this.areMainCommandsEnabled());
};
//=======================================================================
// 显示区段
//=======================================================================
Window_Shengwang.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this.drawShengwangText();
};
Window_Shengwang.prototype.drawShengwangText = function() {
var dy = 0;
var dx = 34; //左侧文字绘制的X坐标,已经留出图标位置。
var di = 277; //中间图标显示的X坐标,左侧为0
var dxx = 311; //中间文字绘制的X坐标。已经留出图标位置。
var dii = 554; //右侧图标绘制的X坐标。
var dxxx = 588; //右侧文字绘制的X坐标,已经留出图标位置。
var dw = 230; //界面总宽
var gx = 0;
this.contents.fontSize = 20;
this.drawText("声望和货币", 0, -10, dw, 'left');
if ($gameVariables.value(80) > 0){
this.drawText("威望:" + $gameVariables.value(80), 0, -10 ,778, 'right');
};
this.drawText("—————————————————————————————————————————", 0, dy + 8, 784, 'left');
this.contents.fontSize = 20;
//声望区段
//第一行
dy += 32; //行高变化
//左
if ($gameSwitches.value(62) == true){
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(62), gx ,dy ,dw); //条显示的函数,第一个值为要使用的变量
}else{
this.drawText("声望系统尚未开启", 0, dy, dw, 'left');
};
//中
if ($gameSwitches.value(63) == true){
if ($gameVariables.value(63) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(63), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(64) == true){
if ($gameVariables.value(64) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(64), gx + 554 ,dy ,dw);
};};
//第二行
dy += 61; //行高变化
//左
if ($gameSwitches.value(65) == true){
if ($gameVariables.value(65) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(65), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(66) == true){
if ($gameVariables.value(66) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(66), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(67) == true){
if ($gameVariables.value(67) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(67), gx + 554 ,dy ,dw);
};};
//第三行
dy += 61; //行高变化
//左
if ($gameSwitches.value(68) == true){
if ($gameVariables.value(68) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(68), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(69) == true){
if ($gameVariables.value(69) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(69), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(70) == true){
if ($gameVariables.value(70) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(70), gx + 554 ,dy ,dw);
};};
//第四行
dy += 61; //行高变化
//左
if ($gameSwitches.value(71) == true){
if ($gameVariables.value(71) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(71), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(72) == true){
if ($gameVariables.value(72) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(72), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(73) == true){
if ($gameVariables.value(73) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(73), gx + 554 ,dy ,dw);
};};
//第五行
dy += 61; //行高变化
//左
if ($gameSwitches.value(74) == true){
if ($gameVariables.value(74) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(74), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(75) == true){
if ($gameVariables.value(75) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(75), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(76) == true){
if ($gameVariables.value(76) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(76), gx + 554 ,dy ,dw);
};};
//第六行
dy += 61; //行高变化
//左
if ($gameSwitches.value(77) == true){
if ($gameVariables.value(77) == 0){
this.drawText("???", 0, dy, dw, 'conter' );
} else{
this.drawIcon( 3, 0, dy + 3);
this.drawText("人类世界-银西法尔特", dx, dy, dw, 'left');
this.dataMath($gameVariables.value(77), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(78) == true){
if ($gameVariables.value(78) == 0){
this.drawText("???", di, dy, dw, 'conter' );
} else{
this.drawIcon( 3, di, dy + 3);
this.drawText("尘隐镇", dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(78), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(79) == true){
if ($gameVariables.value(79) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{
this.drawIcon( 3, dii, dy + 3);
this.drawText("天都", dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(79), gx + 554 ,dy ,dw);
};};
//声望区段END
dy = 387;
this.drawText("————————————————————————————————————", 0, dy, 784, 'left');
var hi = 0; //一位X坐标,框宽加1像素的边距
var hii = 157; //二位X坐标
var hiii = 314 //三位X坐标
var hiv = 471; //四位X坐标
var hv = 628; //五位X坐标
var hw = 156; //每个框宽
//货币区段
dy = 407; //第一行
//左
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hi, dy + 30);
this.drawText("神殿晶体:", hi, dy, hw);
this.drawText("x " + $gameVariables.value(42), hi + 35, dy + 30, hw, 'left' );
} else{
this.drawText("货币系统尚未开启", hi, dy, 784);
};
//左中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hii, dy + 30);
this.drawText("神殿晶体:", hii, dy, hw);
this.drawText("x " + $gameVariables.value(43), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiii, dy + 30);
this.drawText("神殿晶体:", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(44), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiv, dy + 30);
this.drawText("神殿晶体:", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(45), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hv, dy + 30);
this.drawText("神殿晶体:", hv, dy, hw);
this.drawText("x " + $gameVariables.value(46), hv + 35, dy + 30, hw, 'left' );
};
dy = 466; //第二行
//左
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hi, dy + 30);
this.drawText("神殿晶体:", hi, dy, hw);
this.drawText("x " + $gameVariables.value(47), hi + 35, dy + 30, hw, 'left' );
};
//左中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hii, dy + 30);
this.drawText("神殿晶体:", hii, dy, hw);
this.drawText("x " + $gameVariables.value(48), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiii, dy + 30);
this.drawText("神殿晶体:", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(49), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiv, dy + 30);
this.drawText("神殿晶体:", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(50), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hv, dy + 30);
this.drawText("神殿晶体:", hv, dy, hw);
this.drawText("x " + $gameVariables.value(51), hv + 35, dy + 30, hw, 'left' );
};
dy = 525; //第三行
//左
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hi, dy + 30);
this.drawText("神殿晶体:", hi, dy, hw);
this.drawText("x " + $gameVariables.value(52), hi + 35, dy + 30, hw, 'left' );
};
//左中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hii, dy + 30);
this.drawText("神殿晶体:", hii, dy, hw);
this.drawText("x " + $gameVariables.value(53), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiii, dy + 30);
this.drawText("神殿晶体:", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(54), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hiv, dy + 30);
this.drawText("神殿晶体:", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(55), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(42) > 0){
this.drawIcon( 3, hv, dy + 30);
this.drawText("神殿晶体:", hv, dy, hw);
this.drawText("x " + $gameVariables.value(56), hv + 35, dy + 30, hw, 'left' );
};
//货币区段END
};
//条显示的函数
Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
var v1 = data;
var v2 = 1;
var text = "";
var color = '#000000';
if (v1 >= 60000){ //崇拜
v1 = 60000;
v2 = 60000; //当前阶段的声望上限
color = '#00ff00'; //设置声望条的颜色
text = "崇拜:"+ v1 + "/" + v2; //赋值要显示在声望条上面的文字
}else if (v1 >= 20000){ //崇敬
v2 = 60000;
color = '#00e400';
text = "崇敬:"+ v1 + "/" + v2;
}else if (v1 >= 5000){ //尊敬
v2 = 20000;
color = '#40de5a';
text = "尊敬:"+ v1 + "/" + v2;
}else if (v1 >= 800){ //尊重
v2 = 5000;
color = '#eaff56';
text = "尊重:"+ v1 + "/" + v2;
}else if (v1 >= 100){ //友善
v2 = 800;
color = '#faff72';
text = "友善:"+ v1 + "/" + v2;
}else if (v1 < 0){ //仇恨
v2 = v1;
color = '#ff0000';
text = "仇恨:"+ v1;
/* }else if (v1 == 0){ //为0的状态
v2 = 1;
color = '#ffffff';
text = "???";
*/ }else { //冷漠
v2 = 100;
color = '#ffa400';
var text = "冷漠:"+ v1 + "/" + v2;
}
var rate = v1 / v2; //计算声望条的绘制比例
dy += 30; //行高变化
this.drawGauge(gx, dy, dw, rate, color); //绘制声望条
this.drawText(text, gx + 12, dy - 4 , dw, 'center'); //绘制要显示在声望条上面的文字
};
//绘制条函数
Window_Shengwang.prototype.drawGauge = function(x, y, width, rate, color) {
var fillW = Math.floor(width * rate); //比例换算成彩条长度
this.contents.fillRect(x, y + 8, width, 20, '#000000'); //绘制条的黑底
this.contents.gradientFillRect(x, y + 8, fillW, 20, color, color); //绘制彩条
};
全部内容显示状态是下图这样的,密集恐惧症慎看= =
更新列表:
1.1--由347780682提供建议,将声望为0,显示为???。这样即使声望还没有获得声望,也可以开启对应的声望系统,这样一来,在设计剧情的时候如果不按常理出牌,先获得了排在靠后的声望时,也可以直接开启靠后的声望同时打开靠前的声望开关,让其显示为???。更新已经并入上面的脚本,各位客官随意取用修改。
1.2--由347780682提供建议,将声望为开启后声望为0的声望地域显示为???,就不再显示图标和条。已经屏蔽上一个版本的修改区段,有特殊需求的客官也可以手动屏蔽声望区的所有if ($gameVariables.value(76) == 0){
this.drawText("???", dii, dy, dw, 'conter' );
} else{ 这个类型的判断,末尾的其中一个};。然后恢复412-416行的屏蔽即可。
作者: 347780682 时间: 2016-2-24 19:10
本帖最后由 347780682 于 2016-2-24 21:19 编辑
感觉好像对我有用 支持下楼主
ps:话说楼主能不能让声望变量为0的势力显示为???
作者: salvareless 时间: 2016-2-24 19:31
欢迎,随意取用随意修改。
可以啊,你用下面的代码代替条显示函数- //条显示的函数
- Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
- var v1 = data;
- var v2 = 1;
- var text = "";
- var color = '#000000';
- if (v1 >= 60000){ //崇拜
- v1 = 60000;
- v2 = 60000; //当前阶段的声望上限
- color = '#00ff00'; //设置声望条的颜色
- text = "崇拜:"+ v1 + "/" + v2; //赋值要显示在声望条上面的文字
- }else if (v1 >= 20000){ //崇敬
- v2 = 60000;
- color = '#00e400';
- text = "崇敬:"+ v1 + "/" + v2;
- }else if (v1 >= 5000){ //尊敬
- v2 = 20000;
- color = '#40de5a';
- text = "尊敬:"+ v1 + "/" + v2;
- }else if (v1 >= 800){ //尊重
- v2 = 5000;
- color = '#eaff56';
- text = "尊重:"+ v1 + "/" + v2;
- }else if (v1 >= 100){ //友善
- v2 = 800;
- color = '#faff72';
- text = "友善:"+ v1 + "/" + v2;
- }else if (v1 < 0){ //仇恨
- v2 = v1;
- color = '#ff0000';
- text = "仇恨:"+ v1;
- }else if (v1 == 0){ //为0的状态
- v2 = 1;
- color = '#ffffff';
- text = "???";
- }else { //冷漠
- v2 = 100;
- color = '#ffa400';
- var text = "冷漠:"+ v1 + "/" + v2;
- }
- var rate = v1 / v2; //计算声望条的绘制比例
- dy += 30; //行高变化
- this.drawGauge(gx, dy, dw, rate, color); //绘制声望条
- this.drawText(text, gx + 12, dy - 4 , dw, 'center'); //绘制要显示在声望条上面的文字
- };
复制代码 这样的修改并没有取消开关对声望显示的控制,去过要取消的话,屏蔽每一个声望段if ($gameSwitches.value(62) == true){
的判断就行了,记得和断尾的}一起屏蔽。
作者: 347780682 时间: 2019-12-22 20:40
帮楼主唤醒
作者: 无终 时间: 2020-2-25 00:57
本帖最后由 无终 于 2020-2-25 12:04 编辑
修改了一下,添加了一些参数。
说明:
大部分参数不用在代码中修改了
增加了自定义声望条前景色的功能
声望值最大值可以超过最高等级线,会显示为99999/60000这样
添加了唤出菜单的指令
//=============================================================================
// Salvareless Ownuse System
// PrestigeSystem.js
//=============================================================================
//=============================================================================
/*:
* @plugindesc 声望插件
* @author salvareless
*
* @param ---菜单---
* @default
*
* @param Menu Name
* @parent ---菜单---
* @desc 主菜单显示的文字
* 如果使用了YEP_MainMenuManager等主菜单插件,此项无效插件效果会被覆盖
* @default 声望
*
* @param Title Text
* @parent ---菜单---
* @desc 声望窗口最上方显示的文字
* @default 声望和货币
*
* @param Prestige Text
* @parent ---菜单---
* @desc 声望栏标题文字
* @default 声望系统尚未解锁
*
*
* @param Gold Text
* @parent ---菜单---
* @desc 货币栏标题文字
* @default 货币系统尚未解锁
*
* @param ---声望---
* @default
*
* @param Prestige Number
* @parent ---声望---
* @desc 声望达到一定阶段所需要的值,使用逗号分隔
* @default 0,100,800,5000,20000,60000
*
* @param Prestige Phase
* @parent ---声望---
* @desc 声望阶段名称,用逗号分隔,需要和声望分隔值对应
* @default 仇恨,冷漠,中立,友善,尊敬,崇敬,崇拜
*
* @param Prestige Name
* @parent ---声望---
* @desc 声望显示的名称,使用逗号分隔,最大18个。
* @default 声望1,声望2,声望3,声望4,声望5,声望6,声望7,声望8,声望9,声望10,声望11,声望12,声望13,声望14,声望15,声望16,声望17,声望18
*
* @param Prestige Variable
* @parent ---声望---
* @desc 声望对应的变量号,最大18个
* @default 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
*
* @param Prestige Switch
* @parent ---声望---
* @desc 声望对应的开关号,最大18个
* @default 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
*
* @param Prestige Icon
* @parent ---声望---
* @desc 声望对应的图标编号,最大18个
* @default 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81
*
* @param Max
* @parent ---声望---
* @type number
* @desc 声望最大值
* @default 60000
*
* @param ---货币---
* @default
*
* @param Gold Name
* @parent ---货币---
* @desc 货币显示的名称,使用逗号分隔,最大15个,
* 已经设置货币当变量用时,大于0才会显示出来。
* @default 人民币,美元,欧元,日元,英镑,加元,港币,台币,韩元,澳元,克朗,比索,先令,卢比,第纳尔
*
* @param Gold Variable
* @parent ---货币---
* @desc 货币使用的变量,使用逗号分隔
* 已经设置货币当变量用时,大于0才会显示出来。
* @default 42,43,44,45,46,47,48,49,50,51,52,53,54,55,56
*
* @param Gold Icon
* @parent ---货币---
* @desc 货币对应的图标编号,最大15个
* @default 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47
*
*
* @param ---显示---
* @default
*
* @param Colors
* @parent ---显示---
* @desc 声望名称显示的颜色
* @default #930000,#ff0000,#f75000,#00ffff,#01b468,#00db00,#006000
*
* @param Unlock Text
* @parent ---显示---
* @desc 声望未解锁时显示的文字
* @default ?????
*
* @param ---威望---
* @default
*
* @param Reputation Variable
* @parent ---威望---
* @desc 声望界面右上角显示的威望所使用的变量
* @default 80
*
* @param Reputation Text
* @parent ---威望---
* @desc 声望界面右上角显示的威望所使用的文字前缀
* @default 威望:
*
* @help
* ============================================================================
* 声望系统插件
* 作者:Salvareless 优化:无终
* ============================================================================
*
* 已经设置货币当做变量使用时,大于0才会显示出来。
* 变量货币需要配合YEP_ShopMenuCore和YEP_X_MoreCurrencies才更有意义
* 不然就只能做固定的物品兑换事件
*
* 参数中用来分隔的逗号必须是英文半角
*
* 插件指令:
* PRESTIGE OPEN 打开声望界面
*
* 脚本:
* SceneManager.push(Scene_Shengwang); 打开声望界面
*
*
*
*/
//=========================================================================
//声明区段
//=========================================================================
var PrestigeSystem = window.PrestigeSystem || {};
PrestigeSystem.parameters = PluginManager.parameters('PrestigeSystem');
PrestigeSystem.max = parseInt(PrestigeSystem.parameters['Max'] || '60000'); //最大值
PrestigeSystem.menuName = String(PrestigeSystem.parameters['Menu Name'] || '声望');
PrestigeSystem.unlockText = String(PrestigeSystem.parameters['Unlock Text'] || '?????');
PrestigeSystem.titleText = String(PrestigeSystem.parameters['Title Text'] || '声望和货币');
PrestigeSystem.preText = String(PrestigeSystem.parameters['Prestige Text'] || '声望系统尚未解锁');
PrestigeSystem.goldText = String(PrestigeSystem.parameters['Gold Text'] || '货币系统尚未解锁');
PrestigeSystem.colorString = String(PrestigeSystem.parameters['Colors'] || '#930000,#ff0000,#f75000,#00ffff,#01b468,#00db00,#006000');
PrestigeSystem.lineString = String(PrestigeSystem.parameters['Prestige Number'] || '0,100,800,5000,20000,60000');
PrestigeSystem.prePhase = String(PrestigeSystem.parameters['Prestige Phase'] || '仇恨,冷漠,中立,友善,尊敬,崇敬,崇拜');
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');
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');
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');
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');
PrestigeSystem.goldName = String(PrestigeSystem.parameters['Gold Name'] || '人民币,美元,欧元,日元,英镑,加元,港币,台币,韩元,澳元,克朗,比索,先令,卢比,第纳尔');
PrestigeSystem.goldVariable = String(PrestigeSystem.parameters['Gold Variable'] || '42,43,44,45,46,47,48,49,50,51,52,53,54,55,56');
PrestigeSystem.repText = String(PrestigeSystem.parameters['Reputation Text'] || '威望:');
PrestigeSystem.repVariable = String(PrestigeSystem.parameters['Reputation Variable'] || '80');
PrestigeSystem.goldIcon = String(PrestigeSystem.parameters['Gold Icon'] || '32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47');
function Window_Shengwang() {
this.initialize.apply(this, arguments);
};
Window_Shengwang.prototype = Object.create(Window_Selectable.prototype);
Window_Shengwang.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
};
function Scene_Shengwang() {
this.initialize.apply(this, arguments);
};
Scene_Shengwang.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Shengwang.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Shengwang.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._commandWindow = new Window_Shengwang(0, 0, 816, 624);
this.addWindow(this._commandWindow);
};
Scene_Shengwang.prototype.update = function() {
if (Input.isTriggered('escape') || Input.isTriggered('cancel')) {
this._commandWindow.hide();
SceneManager.goto(Scene_Menu);
};
};
// ======================================================================
// 指令读取
// ======================================================================
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
_Game_Interpreter_pluginCommand.apply(this, arguments);
if (command == 'PRESTIGE') {
switch (args[0]) {
case 'OPEN':
SceneManager.push(Scene_Shengwang);
break;
}
}
}
// ======================================================================
// 参数处理
// ======================================================================
//获取声望最大值
PrestigeSystem.getMax = function(){
return PrestigeSystem.max;
}
//获取菜单参数 1,主菜单 2,顶部文字 3,声望栏顶部提示 4,货币栏顶部提示 5,威望的前缀 6,未解锁时的文字
PrestigeSystem.getTitle = function(param) {
var value ;
switch(param){
case 1:
value = PrestigeSystem.menuName.trim();
break;
case 2:
value = PrestigeSystem.titleText.trim();
break
case 3:
value = PrestigeSystem.preText.trim();
break;
case 4:
value = PrestigeSystem.goldText.trim();
break;
case 5:
value = PrestigeSystem.repText.trim();
break;
case 6:
value = PrestigeSystem.unlockText.trim();
break;
}
return value === null ? '' : value;
};
//获取威望所使用的变量
PrestigeSystem.getRepV = function(){
var value = (parseInt(PrestigeSystem.repVariable.trim()));
return value === null ? '' : value;
}
//获取颜色码
PrestigeSystem.getColor = function(param) {
var values = this.getString(PrestigeSystem.colorString);
return values[param];
}
//获取分隔声望值标准
PrestigeSystem.getLine = function(param) {
var values = this.getNumber(PrestigeSystem.lineString);
return values[param];
}
//获取声望等级名称
PrestigeSystem.getLv = function(param) {
var values = this.getString(PrestigeSystem.prePhase);
return values[param];
}
//获取声望名称
PrestigeSystem.getPName = function(param) {
var values = this.getString(PrestigeSystem.preName);
return values[param];
}
//获取变量号
PrestigeSystem.getPreV = function(param) {
var values = this.getNumber(PrestigeSystem.preVariable);
return values[param];
}
//获取开关号
PrestigeSystem.getPreS = function(param) {
var values = this.getNumber(PrestigeSystem.preSwitch);
return values[param];
}
//获取图标号
PrestigeSystem.getPIcon = function(param) {
var values = this.getNumber(PrestigeSystem.preIcon);
return values[param];
}
//获取货币名称
PrestigeSystem.getGName = function(param) {
var values = this.getString(PrestigeSystem.goldName);
return values[param];
}
//获取货币变量号
PrestigeSystem.getGV = function(param) {
var values = this.getNumber(PrestigeSystem.goldVariable);
return values[param];
}
//获取货币图标号
PrestigeSystem.getGIcon = function(param) {
var values = this.getNumber(PrestigeSystem.goldIcon);
return values[param];
}
//获取字符参数
PrestigeSystem.getText = function(param) {
var value = param.trim();
return value === null ? '' : value;
};
//获取字符串参数
PrestigeSystem.getString = function(paramNames) {
var values = this.getText(paramNames).split(',');
for (var i = 0; i < values.length; i++) values[i] = values[i].trim();
return values;
};
//获取Int参数
PrestigeSystem.getNumber = function(paramNames) {
var values = this.getString(paramNames);
for (var i = 0; i < values.length; i++) values[i] = (parseInt(values[i]) || 0);
return values;
};
// ======================================================================
// * Scene_Menu
// ======================================================================
Scene_Menu.prototype.Shengwang_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
this.Shengwang_createCommandWindow();
this._commandWindow.setHandler('shengwang', this.command_Shengwang.bind(this));
};
Scene_Menu.prototype.command_Shengwang = function() {
SceneManager.push(Scene_Shengwang);
};
// ======================================================================
// * Window_MenuCommand
// ======================================================================
Window_MenuCommand.prototype.Shengwang_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.Shengwang_addOriginalCommands();
this.addCommand(PrestigeSystem.getTitle(1), 'shengwang', this.areMainCommandsEnabled());
};
//=======================================================================
// 显示区段
//=======================================================================
Window_Shengwang.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this.drawShengwangText();
};
Window_Shengwang.prototype.drawShengwangText = function() {
var dy = 0;
var dx = 34; //左侧文字绘制的X坐标,已经留出图标位置。
var di = 277; //中间图标显示的X坐标,左侧为0
var dxx = 311; //中间文字绘制的X坐标。已经留出图标位置。
var dii = 554; //右侧图标绘制的X坐标。
var dxxx = 588; //右侧文字绘制的X坐标,已经留出图标位置。
var dw = 230; //界面总宽
var gx = 0;
this.contents.fontSize = 20;
this.drawText(PrestigeSystem.getTitle(2), 0, -10, dw, 'left');
if ($gameVariables.value(PrestigeSystem.getRepV()) > 0){
this.drawText(PrestigeSystem.getTitle(5) + $gameVariables.value(PrestigeSystem.getRepV()), 0, -10 ,778, 'right');
};
this.drawText("————————————————————————————————————————————————————————————————————————————", 0, dy + 8, 784, 'left');
this.contents.fontSize = 20;
//声望区段
//第一行
dy += 32; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(0)) == true){
this.drawIcon(PrestigeSystem.getPIcon(0), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(0), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(0)), gx ,dy ,dw); //条显示的函数,第一个值为要使用的变量
}else{
this.drawText(PrestigeSystem.getTitle(3), 0, dy, dw, 'left');
};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(1)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(1)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(1), di, dy + 3);
this.drawText(PrestigeSystem.getPName(1), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(1)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(2)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(2)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(2), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(2), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(2)), gx + 554 ,dy ,dw);
};};
//第二行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(3)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(3)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(3), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(3), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(3)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(4)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(4)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(4), di, dy + 3);
this.drawText(PrestigeSystem.getPName(4), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(4)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(5)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(5)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(5), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(5), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(5)), gx + 554 ,dy ,dw);
};};
//第三行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(6)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(6)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(6), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(6), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(6)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(7)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(7)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(7), di, dy + 3);
this.drawText(PrestigeSystem.getPName(7), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(7)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(8)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(8)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(8), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(8), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(8)), gx + 554 ,dy ,dw);
};};
//第四行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(9)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(9)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(9), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(9), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(9)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(10)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(10)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(10), di, dy + 3);
this.drawText(PrestigeSystem.getPName(10), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(10)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(11)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(11)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(11), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(11), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(11)), gx + 554 ,dy ,dw);
};};
//第五行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(12)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(12)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(12), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(12), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(12)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(13)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(13)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(13), di, dy + 3);
this.drawText(PrestigeSystem.getPName(13), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(13)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(14)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(14)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(14), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(14), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(14)), gx + 554 ,dy ,dw);
};};
//第六行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(15)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(15)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(15), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(15), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(15)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(16)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(16)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(16), di, dy + 3);
this.drawText(PrestigeSystem.getPName(16), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(16)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(17)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(17)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(17), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(17), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(17)), gx + 554 ,dy ,dw);
};};
//声望区段END
dy = 387;
this.drawText("————————————————————————————————————————————————————————————————————————————", 0, dy, 784, 'left');
var hi = 0; //一位X坐标,框宽加1像素的边距
var hii = 157; //二位X坐标
var hiii = 314 //三位X坐标
var hiv = 471; //四位X坐标
var hv = 628; //五位X坐标
var hw = 156; //每个框宽
//货币区段
dy = 407; //第一行
//左
if ($gameVariables.value(PrestigeSystem.getGV(0)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(0), hi, dy + 30);
this.drawText(PrestigeSystem.getGName(0)+":", hi, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(0)), hi + 35, dy + 30, hw, 'left' );
} else{
this.drawText(PrestigeSystem.getTitle(4), hi, dy, 784);
};
//左中
if ($gameVariables.value(PrestigeSystem.getGV(1)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(1), hii, dy + 30);
this.drawText(PrestigeSystem.getGName(1)+":", hii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(1)), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(PrestigeSystem.getGV(2)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(2), hiii, dy + 30);
this.drawText(PrestigeSystem.getGName(2)+":", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(2)), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(PrestigeSystem.getGV(3)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(3), hiv, dy + 30);
this.drawText(PrestigeSystem.getGName(3)+":", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(3)), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(PrestigeSystem.getGV(4)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(4), hv, dy + 30);
this.drawText(PrestigeSystem.getGName(4)+":", hv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(4)), hv + 35, dy + 30, hw, 'left' );
};
dy = 466; //第二行
//左
if ($gameVariables.value(PrestigeSystem.getGV(5)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(5), hi, dy + 30);
this.drawText(PrestigeSystem.getGName(5)+":", hi, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(5)), hi + 35, dy + 30, hw, 'left' );
};
//左中
if ($gameVariables.value(PrestigeSystem.getGV(6)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(6), hii, dy + 30);
this.drawText(PrestigeSystem.getGName(6)+":", hii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(6)), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(PrestigeSystem.getGV(7)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(7), hiii, dy + 30);
this.drawText(PrestigeSystem.getGName(7)+":", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(7)), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(PrestigeSystem.getGV(8)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(8), hiv, dy + 30);
this.drawText(PrestigeSystem.getGName(8)+":", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(8)), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(PrestigeSystem.getGV(9)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(9), hv, dy + 30);
this.drawText(PrestigeSystem.getGName(9)+":", hv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(9)), hv + 35, dy + 30, hw, 'left' );
};
dy = 525; //第三行
//左
if ($gameVariables.value(PrestigeSystem.getGV(10)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(10), hi, dy + 30);
this.drawText(PrestigeSystem.getGName(10)+":", hi, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(10)), hi + 35, dy + 30, hw, 'left' );
};
//左中
if ($gameVariables.value(PrestigeSystem.getGV(11)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(11), hii, dy + 30);
this.drawText(PrestigeSystem.getGName(11)+":", hii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(11)), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(PrestigeSystem.getGV(12)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(12), hiii, dy + 30);
this.drawText(PrestigeSystem.getGName(12)+":", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(12)), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(PrestigeSystem.getGV(13)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(13), hiv, dy + 30);
this.drawText(PrestigeSystem.getGName(13)+":", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(13)), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(PrestigeSystem.getGV(14)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(14), hv, dy + 30);
this.drawText(PrestigeSystem.getGName(14)+":", hv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(14)), hv + 35, dy + 30, hw, 'left' );
};
//货币区段END
};
//条显示的函数
//Color '#ff0000' faff72 eaff56 40de5a 00e400 00ff00 000000
Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
var v1 = data;
var v2 = 1;
var text = "";
var color = PrestigeSystem.getColor(0);
if (v1 >= PrestigeSystem.getLine(5)){ //崇拜
if(v1 >= PrestigeSystem.getMax()){
v1 = PrestigeSystem.getMax();
}else{
v1 = data;
}
v2 = PrestigeSystem.getLine(5); //当前阶段的声望上限
color = PrestigeSystem.getColor(6); //设置声望条的颜色
text = PrestigeSystem.getLv(6)+":"+ v1 + "/" + v2; //赋值要显示在声望条上面的文字
}else if (v1 >= PrestigeSystem.getLine(4)){ //崇敬
v2 = PrestigeSystem.getLine(5);
color = PrestigeSystem.getColor(5);
text = PrestigeSystem.getLv(5)+":"+ v1 + "/" + v2;
}else if (v1 >= PrestigeSystem.getLine(3)){ //尊敬
v2 = PrestigeSystem.getLine(4);
color = PrestigeSystem.getColor(4);
text = PrestigeSystem.getLv(4)+":"+ v1 + "/" + v2;
}else if (v1 >= PrestigeSystem.getLine(2)){ //尊重
v2 = PrestigeSystem.getLine(3);
color = PrestigeSystem.getColor(3);
text = PrestigeSystem.getLv(3)+":"+ v1 + "/" + v2;
}else if (v1 >= PrestigeSystem.getLine(1)){ //友善
v2 = PrestigeSystem.getLine(2);
color = PrestigeSystem.getColor(2);
text = PrestigeSystem.getLv(2)+":"+ v1 + "/" + v2;
}else if (v1 < PrestigeSystem.getLine(0)){ //仇恨
v2 = v1;
color = PrestigeSystem.getColor(0);
text = PrestigeSystem.getLv(0)+":"+ v1;
/* }else if (v1 == 0){ //为0的状态
v2 = 1;
color = '#ffffff';
text = "???";
*/ }else { //冷漠
v2 = PrestigeSystem.getLine(1);
color = PrestigeSystem.getColor(1);
var text = PrestigeSystem.getLv(1)+":"+ v1 + "/" + v2;
}
var rate = v1 / v2; //计算声望条的绘制比例
dy += 30; //行高变化
this.drawGauge(gx, dy, dw, rate, color); //绘制声望条
this.drawText(text, gx + 12, dy - 4 , dw, 'center'); //绘制要显示在声望条上面的文字
};
//绘制条函数
Window_Shengwang.prototype.drawGauge = function(x, y, width, rate, color) {
var fillW = Math.floor(width * rate); //比例换算成彩条长度
this.contents.fillRect(x, y + 8, width, 20, '#000000'); //绘制条的黑底
this.contents.gradientFillRect(x, y + 8, fillW, 20, color, color); //绘制彩条
};
//=============================================================================
// Salvareless Ownuse System
// PrestigeSystem.js
//=============================================================================
//=============================================================================
/*:
* @plugindesc 声望插件
* @author salvareless
*
* @param ---菜单---
* @default
*
* @param Menu Name
* @parent ---菜单---
* @desc 主菜单显示的文字
* 如果使用了YEP_MainMenuManager等主菜单插件,此项无效插件效果会被覆盖
* @default 声望
*
* @param Title Text
* @parent ---菜单---
* @desc 声望窗口最上方显示的文字
* @default 声望和货币
*
* @param Prestige Text
* @parent ---菜单---
* @desc 声望栏标题文字
* @default 声望系统尚未解锁
*
*
* @param Gold Text
* @parent ---菜单---
* @desc 货币栏标题文字
* @default 货币系统尚未解锁
*
* @param ---声望---
* @default
*
* @param Prestige Number
* @parent ---声望---
* @desc 声望达到一定阶段所需要的值,使用逗号分隔
* @default 0,100,800,5000,20000,60000
*
* @param Prestige Phase
* @parent ---声望---
* @desc 声望阶段名称,用逗号分隔,需要和声望分隔值对应
* @default 仇恨,冷漠,中立,友善,尊敬,崇敬,崇拜
*
* @param Prestige Name
* @parent ---声望---
* @desc 声望显示的名称,使用逗号分隔,最大18个。
* @default 声望1,声望2,声望3,声望4,声望5,声望6,声望7,声望8,声望9,声望10,声望11,声望12,声望13,声望14,声望15,声望16,声望17,声望18
*
* @param Prestige Variable
* @parent ---声望---
* @desc 声望对应的变量号,最大18个
* @default 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
*
* @param Prestige Switch
* @parent ---声望---
* @desc 声望对应的开关号,最大18个
* @default 62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
*
* @param Prestige Icon
* @parent ---声望---
* @desc 声望对应的图标编号,最大18个
* @default 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81
*
* @param Max
* @parent ---声望---
* @type number
* @desc 声望最大值
* @default 60000
*
* @param ---货币---
* @default
*
* @param Gold Name
* @parent ---货币---
* @desc 货币显示的名称,使用逗号分隔,最大15个,
* 已经设置货币当变量用时,大于0才会显示出来。
* @default 人民币,美元,欧元,日元,英镑,加元,港币,台币,韩元,澳元,克朗,比索,先令,卢比,第纳尔
*
* @param Gold Variable
* @parent ---货币---
* @desc 货币使用的变量,使用逗号分隔
* 已经设置货币当变量用时,大于0才会显示出来。
* @default 42,43,44,45,46,47,48,49,50,51,52,53,54,55,56
*
* @param Gold Icon
* @parent ---货币---
* @desc 货币对应的图标编号,最大15个
* @default 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47
*
*
* @param ---显示---
* @default
*
* @param Colors
* @parent ---显示---
* @desc 声望名称显示的颜色
* @default #930000,#ff0000,#f75000,#00ffff,#01b468,#00db00,#006000
*
* @param Unlock Text
* @parent ---显示---
* @desc 声望未解锁时显示的文字
* @default ?????
*
* @param ---威望---
* @default
*
* @param Reputation Variable
* @parent ---威望---
* @desc 声望界面右上角显示的威望所使用的变量
* @default 80
*
* @param Reputation Text
* @parent ---威望---
* @desc 声望界面右上角显示的威望所使用的文字前缀
* @default 威望:
*
* @help
* ============================================================================
* 声望系统插件
* 作者:Salvareless 优化:无终
* ============================================================================
*
* 已经设置货币当做变量使用时,大于0才会显示出来。
* 变量货币需要配合YEP_ShopMenuCore和YEP_X_MoreCurrencies才更有意义
* 不然就只能做固定的物品兑换事件
*
* 参数中用来分隔的逗号必须是英文半角
*
* 插件指令:
* PRESTIGE OPEN 打开声望界面
*
* 脚本:
* SceneManager.push(Scene_Shengwang); 打开声望界面
*
*
*
*/
//=========================================================================
//声明区段
//=========================================================================
var PrestigeSystem = window.PrestigeSystem || {};
PrestigeSystem.parameters = PluginManager.parameters('PrestigeSystem');
PrestigeSystem.max = parseInt(PrestigeSystem.parameters['Max'] || '60000'); //最大值
PrestigeSystem.menuName = String(PrestigeSystem.parameters['Menu Name'] || '声望');
PrestigeSystem.unlockText = String(PrestigeSystem.parameters['Unlock Text'] || '?????');
PrestigeSystem.titleText = String(PrestigeSystem.parameters['Title Text'] || '声望和货币');
PrestigeSystem.preText = String(PrestigeSystem.parameters['Prestige Text'] || '声望系统尚未解锁');
PrestigeSystem.goldText = String(PrestigeSystem.parameters['Gold Text'] || '货币系统尚未解锁');
PrestigeSystem.colorString = String(PrestigeSystem.parameters['Colors'] || '#930000,#ff0000,#f75000,#00ffff,#01b468,#00db00,#006000');
PrestigeSystem.lineString = String(PrestigeSystem.parameters['Prestige Number'] || '0,100,800,5000,20000,60000');
PrestigeSystem.prePhase = String(PrestigeSystem.parameters['Prestige Phase'] || '仇恨,冷漠,中立,友善,尊敬,崇敬,崇拜');
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');
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');
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');
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');
PrestigeSystem.goldName = String(PrestigeSystem.parameters['Gold Name'] || '人民币,美元,欧元,日元,英镑,加元,港币,台币,韩元,澳元,克朗,比索,先令,卢比,第纳尔');
PrestigeSystem.goldVariable = String(PrestigeSystem.parameters['Gold Variable'] || '42,43,44,45,46,47,48,49,50,51,52,53,54,55,56');
PrestigeSystem.repText = String(PrestigeSystem.parameters['Reputation Text'] || '威望:');
PrestigeSystem.repVariable = String(PrestigeSystem.parameters['Reputation Variable'] || '80');
PrestigeSystem.goldIcon = String(PrestigeSystem.parameters['Gold Icon'] || '32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47');
function Window_Shengwang() {
this.initialize.apply(this, arguments);
};
Window_Shengwang.prototype = Object.create(Window_Selectable.prototype);
Window_Shengwang.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
};
function Scene_Shengwang() {
this.initialize.apply(this, arguments);
};
Scene_Shengwang.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Shengwang.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Shengwang.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this._commandWindow = new Window_Shengwang(0, 0, 816, 624);
this.addWindow(this._commandWindow);
};
Scene_Shengwang.prototype.update = function() {
if (Input.isTriggered('escape') || Input.isTriggered('cancel')) {
this._commandWindow.hide();
SceneManager.goto(Scene_Menu);
};
};
// ======================================================================
// 指令读取
// ======================================================================
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
_Game_Interpreter_pluginCommand.apply(this, arguments);
if (command == 'PRESTIGE') {
switch (args[0]) {
case 'OPEN':
SceneManager.push(Scene_Shengwang);
break;
}
}
}
// ======================================================================
// 参数处理
// ======================================================================
//获取声望最大值
PrestigeSystem.getMax = function(){
return PrestigeSystem.max;
}
//获取菜单参数 1,主菜单 2,顶部文字 3,声望栏顶部提示 4,货币栏顶部提示 5,威望的前缀 6,未解锁时的文字
PrestigeSystem.getTitle = function(param) {
var value ;
switch(param){
case 1:
value = PrestigeSystem.menuName.trim();
break;
case 2:
value = PrestigeSystem.titleText.trim();
break
case 3:
value = PrestigeSystem.preText.trim();
break;
case 4:
value = PrestigeSystem.goldText.trim();
break;
case 5:
value = PrestigeSystem.repText.trim();
break;
case 6:
value = PrestigeSystem.unlockText.trim();
break;
}
return value === null ? '' : value;
};
//获取威望所使用的变量
PrestigeSystem.getRepV = function(){
var value = (parseInt(PrestigeSystem.repVariable.trim()));
return value === null ? '' : value;
}
//获取颜色码
PrestigeSystem.getColor = function(param) {
var values = this.getString(PrestigeSystem.colorString);
return values[param];
}
//获取分隔声望值标准
PrestigeSystem.getLine = function(param) {
var values = this.getNumber(PrestigeSystem.lineString);
return values[param];
}
//获取声望等级名称
PrestigeSystem.getLv = function(param) {
var values = this.getString(PrestigeSystem.prePhase);
return values[param];
}
//获取声望名称
PrestigeSystem.getPName = function(param) {
var values = this.getString(PrestigeSystem.preName);
return values[param];
}
//获取变量号
PrestigeSystem.getPreV = function(param) {
var values = this.getNumber(PrestigeSystem.preVariable);
return values[param];
}
//获取开关号
PrestigeSystem.getPreS = function(param) {
var values = this.getNumber(PrestigeSystem.preSwitch);
return values[param];
}
//获取图标号
PrestigeSystem.getPIcon = function(param) {
var values = this.getNumber(PrestigeSystem.preIcon);
return values[param];
}
//获取货币名称
PrestigeSystem.getGName = function(param) {
var values = this.getString(PrestigeSystem.goldName);
return values[param];
}
//获取货币变量号
PrestigeSystem.getGV = function(param) {
var values = this.getNumber(PrestigeSystem.goldVariable);
return values[param];
}
//获取货币图标号
PrestigeSystem.getGIcon = function(param) {
var values = this.getNumber(PrestigeSystem.goldIcon);
return values[param];
}
//获取字符参数
PrestigeSystem.getText = function(param) {
var value = param.trim();
return value === null ? '' : value;
};
//获取字符串参数
PrestigeSystem.getString = function(paramNames) {
var values = this.getText(paramNames).split(',');
for (var i = 0; i < values.length; i++) values[i] = values[i].trim();
return values;
};
//获取Int参数
PrestigeSystem.getNumber = function(paramNames) {
var values = this.getString(paramNames);
for (var i = 0; i < values.length; i++) values[i] = (parseInt(values[i]) || 0);
return values;
};
// ======================================================================
// * Scene_Menu
// ======================================================================
Scene_Menu.prototype.Shengwang_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
this.Shengwang_createCommandWindow();
this._commandWindow.setHandler('shengwang', this.command_Shengwang.bind(this));
};
Scene_Menu.prototype.command_Shengwang = function() {
SceneManager.push(Scene_Shengwang);
};
// ======================================================================
// * Window_MenuCommand
// ======================================================================
Window_MenuCommand.prototype.Shengwang_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands;
Window_MenuCommand.prototype.addOriginalCommands = function() {
this.Shengwang_addOriginalCommands();
this.addCommand(PrestigeSystem.getTitle(1), 'shengwang', this.areMainCommandsEnabled());
};
//=======================================================================
// 显示区段
//=======================================================================
Window_Shengwang.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this.drawShengwangText();
};
Window_Shengwang.prototype.drawShengwangText = function() {
var dy = 0;
var dx = 34; //左侧文字绘制的X坐标,已经留出图标位置。
var di = 277; //中间图标显示的X坐标,左侧为0
var dxx = 311; //中间文字绘制的X坐标。已经留出图标位置。
var dii = 554; //右侧图标绘制的X坐标。
var dxxx = 588; //右侧文字绘制的X坐标,已经留出图标位置。
var dw = 230; //界面总宽
var gx = 0;
this.contents.fontSize = 20;
this.drawText(PrestigeSystem.getTitle(2), 0, -10, dw, 'left');
if ($gameVariables.value(PrestigeSystem.getRepV()) > 0){
this.drawText(PrestigeSystem.getTitle(5) + $gameVariables.value(PrestigeSystem.getRepV()), 0, -10 ,778, 'right');
};
this.drawText("————————————————————————————————————————————————————————————————————————————", 0, dy + 8, 784, 'left');
this.contents.fontSize = 20;
//声望区段
//第一行
dy += 32; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(0)) == true){
this.drawIcon(PrestigeSystem.getPIcon(0), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(0), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(0)), gx ,dy ,dw); //条显示的函数,第一个值为要使用的变量
}else{
this.drawText(PrestigeSystem.getTitle(3), 0, dy, dw, 'left');
};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(1)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(1)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(1), di, dy + 3);
this.drawText(PrestigeSystem.getPName(1), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(1)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(2)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(2)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(2), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(2), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(2)), gx + 554 ,dy ,dw);
};};
//第二行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(3)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(3)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(3), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(3), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(3)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(4)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(4)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(4), di, dy + 3);
this.drawText(PrestigeSystem.getPName(4), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(4)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(5)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(5)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(5), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(5), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(5)), gx + 554 ,dy ,dw);
};};
//第三行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(6)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(6)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(6), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(6), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(6)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(7)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(7)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(7), di, dy + 3);
this.drawText(PrestigeSystem.getPName(7), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(7)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(8)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(8)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(8), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(8), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(8)), gx + 554 ,dy ,dw);
};};
//第四行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(9)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(9)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(9), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(9), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(9)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(10)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(10)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(10), di, dy + 3);
this.drawText(PrestigeSystem.getPName(10), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(10)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(11)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(11)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(11), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(11), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(11)), gx + 554 ,dy ,dw);
};};
//第五行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(12)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(12)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(12), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(12), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(12)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(13)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(13)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(13), di, dy + 3);
this.drawText(PrestigeSystem.getPName(13), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(13)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(14)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(14)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(14), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(14), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(14)), gx + 554 ,dy ,dw);
};};
//第六行
dy += 61; //行高变化
//左
if ($gameSwitches.value(PrestigeSystem.getPreS(15)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(15)) == 0){
this.drawText(PrestigeSystem.getTitle(6), 0, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(15), 0, dy + 3);
this.drawText(PrestigeSystem.getPName(15), dx, dy, dw, 'left');
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(15)), gx ,dy ,dw);
};};
//中
if ($gameSwitches.value(PrestigeSystem.getPreS(16)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(16)) == 0){
this.drawText(PrestigeSystem.getTitle(6), di, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(16), di, dy + 3);
this.drawText(PrestigeSystem.getPName(16), dxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(16)), gx + 277 ,dy ,dw);
};};
//右
if ($gameSwitches.value(PrestigeSystem.getPreS(17)) == true){
if ($gameVariables.value(PrestigeSystem.getPreV(17)) == 0){
this.drawText(PrestigeSystem.getTitle(6), dii, dy, dw, 'conter' );
} else{
this.drawIcon( PrestigeSystem.getPIcon(17), dii, dy + 3);
this.drawText(PrestigeSystem.getPName(17), dxxx, dy, dw, 'left' );
this.dataMath($gameVariables.value(PrestigeSystem.getPreV(17)), gx + 554 ,dy ,dw);
};};
//声望区段END
dy = 387;
this.drawText("————————————————————————————————————————————————————————————————————————————", 0, dy, 784, 'left');
var hi = 0; //一位X坐标,框宽加1像素的边距
var hii = 157; //二位X坐标
var hiii = 314 //三位X坐标
var hiv = 471; //四位X坐标
var hv = 628; //五位X坐标
var hw = 156; //每个框宽
//货币区段
dy = 407; //第一行
//左
if ($gameVariables.value(PrestigeSystem.getGV(0)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(0), hi, dy + 30);
this.drawText(PrestigeSystem.getGName(0)+":", hi, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(0)), hi + 35, dy + 30, hw, 'left' );
} else{
this.drawText(PrestigeSystem.getTitle(4), hi, dy, 784);
};
//左中
if ($gameVariables.value(PrestigeSystem.getGV(1)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(1), hii, dy + 30);
this.drawText(PrestigeSystem.getGName(1)+":", hii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(1)), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(PrestigeSystem.getGV(2)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(2), hiii, dy + 30);
this.drawText(PrestigeSystem.getGName(2)+":", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(2)), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(PrestigeSystem.getGV(3)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(3), hiv, dy + 30);
this.drawText(PrestigeSystem.getGName(3)+":", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(3)), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(PrestigeSystem.getGV(4)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(4), hv, dy + 30);
this.drawText(PrestigeSystem.getGName(4)+":", hv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(4)), hv + 35, dy + 30, hw, 'left' );
};
dy = 466; //第二行
//左
if ($gameVariables.value(PrestigeSystem.getGV(5)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(5), hi, dy + 30);
this.drawText(PrestigeSystem.getGName(5)+":", hi, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(5)), hi + 35, dy + 30, hw, 'left' );
};
//左中
if ($gameVariables.value(PrestigeSystem.getGV(6)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(6), hii, dy + 30);
this.drawText(PrestigeSystem.getGName(6)+":", hii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(6)), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(PrestigeSystem.getGV(7)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(7), hiii, dy + 30);
this.drawText(PrestigeSystem.getGName(7)+":", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(7)), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(PrestigeSystem.getGV(8)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(8), hiv, dy + 30);
this.drawText(PrestigeSystem.getGName(8)+":", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(8)), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(PrestigeSystem.getGV(9)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(9), hv, dy + 30);
this.drawText(PrestigeSystem.getGName(9)+":", hv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(9)), hv + 35, dy + 30, hw, 'left' );
};
dy = 525; //第三行
//左
if ($gameVariables.value(PrestigeSystem.getGV(10)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(10), hi, dy + 30);
this.drawText(PrestigeSystem.getGName(10)+":", hi, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(10)), hi + 35, dy + 30, hw, 'left' );
};
//左中
if ($gameVariables.value(PrestigeSystem.getGV(11)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(11), hii, dy + 30);
this.drawText(PrestigeSystem.getGName(11)+":", hii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(11)), hii + 35, dy + 30, hw, 'left' );
};
//中
if ($gameVariables.value(PrestigeSystem.getGV(12)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(12), hiii, dy + 30);
this.drawText(PrestigeSystem.getGName(12)+":", hiii, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(12)), hiii + 35, dy + 30, hw, 'left' );
};
//右中
if ($gameVariables.value(PrestigeSystem.getGV(13)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(13), hiv, dy + 30);
this.drawText(PrestigeSystem.getGName(13)+":", hiv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(13)), hiv + 35, dy + 30, hw, 'left' );
};
//右
if ($gameVariables.value(PrestigeSystem.getGV(14)) > 0){
this.drawIcon( PrestigeSystem.getGIcon(14), hv, dy + 30);
this.drawText(PrestigeSystem.getGName(14)+":", hv, dy, hw);
this.drawText("x " + $gameVariables.value(PrestigeSystem.getGV(14)), hv + 35, dy + 30, hw, 'left' );
};
//货币区段END
};
//条显示的函数
//Color '#ff0000' faff72 eaff56 40de5a 00e400 00ff00 000000
Window_Shengwang.prototype.dataMath = function(data, gx, dy, dw) {
var v1 = data;
var v2 = 1;
var text = "";
var color = PrestigeSystem.getColor(0);
if (v1 >= PrestigeSystem.getLine(5)){ //崇拜
if(v1 >= PrestigeSystem.getMax()){
v1 = PrestigeSystem.getMax();
}else{
v1 = data;
}
v2 = PrestigeSystem.getLine(5); //当前阶段的声望上限
color = PrestigeSystem.getColor(6); //设置声望条的颜色
text = PrestigeSystem.getLv(6)+":"+ v1 + "/" + v2; //赋值要显示在声望条上面的文字
}else if (v1 >= PrestigeSystem.getLine(4)){ //崇敬
v2 = PrestigeSystem.getLine(5);
color = PrestigeSystem.getColor(5);
text = PrestigeSystem.getLv(5)+":"+ v1 + "/" + v2;
}else if (v1 >= PrestigeSystem.getLine(3)){ //尊敬
v2 = PrestigeSystem.getLine(4);
color = PrestigeSystem.getColor(4);
text = PrestigeSystem.getLv(4)+":"+ v1 + "/" + v2;
}else if (v1 >= PrestigeSystem.getLine(2)){ //尊重
v2 = PrestigeSystem.getLine(3);
color = PrestigeSystem.getColor(3);
text = PrestigeSystem.getLv(3)+":"+ v1 + "/" + v2;
}else if (v1 >= PrestigeSystem.getLine(1)){ //友善
v2 = PrestigeSystem.getLine(2);
color = PrestigeSystem.getColor(2);
text = PrestigeSystem.getLv(2)+":"+ v1 + "/" + v2;
}else if (v1 < PrestigeSystem.getLine(0)){ //仇恨
v2 = v1;
color = PrestigeSystem.getColor(0);
text = PrestigeSystem.getLv(0)+":"+ v1;
/* }else if (v1 == 0){ //为0的状态
v2 = 1;
color = '#ffffff';
text = "???";
*/ }else { //冷漠
v2 = PrestigeSystem.getLine(1);
color = PrestigeSystem.getColor(1);
var text = PrestigeSystem.getLv(1)+":"+ v1 + "/" + v2;
}
var rate = v1 / v2; //计算声望条的绘制比例
dy += 30; //行高变化
this.drawGauge(gx, dy, dw, rate, color); //绘制声望条
this.drawText(text, gx + 12, dy - 4 , dw, 'center'); //绘制要显示在声望条上面的文字
};
//绘制条函数
Window_Shengwang.prototype.drawGauge = function(x, y, width, rate, color) {
var fillW = Math.floor(width * rate); //比例换算成彩条长度
this.contents.fillRect(x, y + 8, width, 20, '#000000'); //绘制条的黑底
this.contents.gradientFillRect(x, y + 8, fillW, 20, color, color); //绘制彩条
};
作者: 574656549 时间: 2020-3-25 20:28
提示: 作者被禁止或删除 内容自动屏蔽
作者: salvareless 时间: 2021-8-9 20:47
我的号终于复活了,感谢您对这个插件的优化,没想到几年过去,还有人能帮我优化插件。大赞
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |