查看: 6885|回复: 7

[搬运汉化] 部分插件汉化

[复制链接]
梦石
0
星屑
50
在线时间
93 小时
注册时间
2013-11-20
回帖
11
发表于 2015-10-30 11:39:02 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 苏利亚 于 2015-10-30 11:48 编辑

似乎大家都在汉化插件,为了不进行多余的重复工作,现在把我翻译的一些内容贴上来。

机翻!
机翻!
机翻!

一切功劳属于谷歌,我只是个人形润色器。
如有纰漏还请海涵。

所有插件未经测试,在大神们出手之前聊作辅助。

[fold=ATB系统]1.ATB系统
[pre lang="JavaScript" file="ellye's_simple_atb_(rpg_maker_mv)"]// File must be named "EllyeSimpleATB.js"
//=============================================================================
// Ellye's Simple Active Time Battle
//=============================================================================
/*:
*
* Lastest updates:
* Added a parameter for the gauge name.
* Added a parameter that allows the developer to select if At-End-Of-Turn effects should happen after an actor takes its action, or for everyone at the end of Turn Timer. (thanks, atreyoray)
* Corrected a few bugs regarding monsters with the same agility not attacking;
* Corrected a few bugs regarding Auto-Battle;
* Corrected a few bugs regarding Status Effects that happened per turn.
*
* @plugindesc 简单的计时回合值战斗系统。
* @author http://steamcommunity.com/id/Ellye
*
* @param Agility Weight
* @desc 这个数值越高,同一敏捷差值之间的时间差距越明显。
* 默认值为100(权重数值为整数)。
* @default 100
*
* @param Turn Timer
* @desc 虚拟“回合”所包含的时间。
* 详见帮助。
* @default 150
*
* @param Base Fill Speed
* @desc 槽值本身的填充速度,区别于人物的敏捷值。
* 以同样的方式影响虚拟回合。
* @default 100
*
* @param End-Of-Turn Effects
* @desc 0= 按照各人行动执行; 1= 按照虚拟回合执行。
* 详见帮助。
* @default 0
*
* @param Gauge Name
* @desc 在槽值上显示的名称。
* @default AT
*  
* @help Turn Timer
* -影响战斗第N回合发生的事件中的“回合”,或者N回合后敌人使用技能中的“回合”等。
* -这里输入的数值将是虚拟回合所拥有的“敏捷”值。这个数值对玩家不可见。
* End-Of-Turn Effects
* -选择处理回合性状态(如中毒伤害)的方式,
* -每个人按照各人行动单独执行,或是所有人按照虚拟回合每回合结束统一执行。
*
* 人物将会根据他们的敏捷属性采取尽可能多的行动,取代了固定轮流的方式。
* 他们将获得一个从0到1000的“AT”计时槽,并且在达到1000时进行行动。
* 当玩家选择指令或者播放动画时,计时将被暂停。
* 你可以通过“.atb”属性使技能受ATB系统作用影响。
* 例如,一个“快速打击”类型的技能在它的公式里可以写“a.atb+25000;”
* 全通径需求50000ATB (多余的ATB不会丢失,并且数值可以是负数)。
*/

//Our plugin needs to be inside a function:
(function() {
   
    var turn_atb = 0;
    var full_atb = 50000;
    var parameters = PluginManager.parameters('EllyeSimpleATB');
    var agi_weight = Number(parameters['Agility Weight'] || 100);
    var turn_timer = Number(parameters['Turn Timer'] || 150);
    var base_atb_increase = Number(parameters['Base Fill Speed'] || 100);
    var end_of_turn_effects = Number(parameters['End-Of-Turn Effects'] || 0);
    var gauge_name = String(parameters['Gauge Name'] || "AT");
   
    //==================================================
    // INTERFACE
    //==================================================
   
    //Let's increase the area for gauges in the battlescreen from the default value of 330 to 400.
    Window_BattleStatus.prototype.gaugeAreaWidth = function() {
    return 400;
    };
   
    //let's change the DrawGaugeArea methods, to include our ATB gauge.
    //The version with TP:
    Window_BattleStatus.prototype.drawGaugeAreaWithTp = function(rect, actor) {
        this.drawActorHp(actor, rect.x + 0, rect.y, 97);
        this.drawActorMp(actor, rect.x + 112, rect.y, 86);
        this.drawActorTp(actor, rect.x + 213, rect.y, 86);
        this.drawActorATB(actor, rect.x + 314, rect.y, 86);
    };
   
    //The version without TP:
    Window_BattleStatus.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
        this.drawActorHp(actor, rect.x + 0, rect.y, 130);
        this.drawActorMp(actor, rect.x + 145,  rect.y, 120);
        this.drawActorATB(actor, rect.x + 280,  rect.y, 120);
    };
   
    //Let's create the method that draw the ATB gauge:
    Window_Base.prototype.drawActorATB = function(actor, x, y, width) {
        var color1 = "#303050";
        var color2 = "#6060A0";
        this.drawGauge(x, y, width, actor.atbRate(), color1, color2);
        this.changeTextColor(this.systemColor());
        this.drawText(gauge_name, x, y, 44);
    };
   
    //Let's create the method for calculating ATB percent for the gauge:
    Game_BattlerBase.prototype.atbRate = function() {
        if (typeof this.atb !== 'undefined') {
            if (this.atb / full_atb >= 1)
            {
                return 1;
            }
            return this.atb / full_atb;
        }
        return 0;
    };

    //==================================================
    // SYSTEM
    //==================================================

    //Let's add a new property for battlers, called "atb":
    Object.defineProperties(Game_BattlerBase.prototype, {
        atb: {
            writable: true,
            value: 0,
            configurable: true,
            enumerable: true
        }
    });

   //At the start of battle, ATB values are reset to 0:
    _Game_Battler_prototype_onBattleStart = Game_Battler.prototype.onBattleStart;
    Game_Battler.prototype.onBattleStart = function() {
        this.atb = 0;
        _Game_Battler_prototype_onBattleStart.call(this);
    };

    //Battle starts in the new phase "atb"
    _BattleManager_startBattle = BattleManager.startBattle;
    BattleManager.startBattle = function() {
        _BattleManager_startBattle.call(this);
        $gameParty.makeActions();
        $gameTroop.makeActions();
        this.makeActionOrders();
        this._phase = 'atb';
        this._pending_atb_removal = false;
    };
   
    //Change the end of turn:
    BattleManager.updateTurnEnd = function() {
        $gameParty.makeActions();
        $gameTroop.makeActions();
        this._phase = 'atb';
    };
   
    //Changing the flow of battle
    _BattleManager_update = BattleManager.update;
    BattleManager.update = function() {
        if (!this.isBusy() && !this.updateEvent())
        {
            switch (this._phase)
            {
                case 'atb':
                    this.increaseAtbGauges();
                    break;
                default:
                    _BattleManager_update.call(this);
                    break;
            }
        }
    };
   
    //Increases the ATB gauges when idle:
    BattleManager.increaseAtbGauges = function() {
        turn_atb += (base_atb_increase + turn_timer * (agi_weight/100));
        if (turn_atb >= full_atb)
        {
            turn_atb -= full_atb;
            $gameTroop.increaseTurn();
            if (end_of_turn_effects !== 0)
            {
                this.allBattleMembers().forEach(function(battler)
                {
                    battler.onTurnEnd();
                    this.refreshStatus();
                    this._logWindow.displayAutoAffectedStatus(battler);
                    this._logWindow.displayRegeneration(battler);
                }, this);
            }
        }
        this.allBattleMembers().forEach(function(battler)
        {
            battler.atb += (base_atb_increase + battler.agi * (agi_weight/100));
            if (battler.atb >= full_atb)
            {        
                this.battlerHasFullAtb(battler);
            }
        }, this);
        this.refreshStatus();
    };

    //When a Battler (might be party or enemy) has full ATB:
    BattleManager.battlerHasFullAtb = function(battler) {
        this._subject = battler;
        this._turn_end_subject = battler;
        this._pending_atb_removal = true;
        if (battler.isActor())
        {
            battler.makeActions();
            if (battler.canInput())
            {
                this._actorIndex = battler.index();
                this._phase = 'input';
            }
            else
            {
                this._phase = 'turn';
            }
        }
        else if (battler.isEnemy())
        {
            battler.makeActions();
            this._phase = 'turn';
        }
      };
   
    //Never jumps to another battler, we will control them individually:
    BattleManager.getNextSubject = function() {
        return null;
    };
   
    //Process turn when we finish inputing command
    BattleManager.selectNextCommand = function() {
        do {
            if (!this.actor() || !this.actor().selectNextCommand()) {
                this._phase = 'turn';
                $gameParty.requestMotionRefresh();
                break;
            }
        } while (!this.actor().canInput());
    };
   
    //Don't let us jump to another character by cancelling.
    BattleManager.selectPreviousCommand = function() {
        do {
            if (!this.actor() || !this.actor().selectPreviousCommand()) {
                    return;
            }
        } while (!this.actor().canInput());
    };
   
    //We need to change the OnTurnEnd method, because otherwise it will apply to all battlers whenever anyone acts:
    BattleManager.endTurn = function() {
        this._phase = 'turnEnd';
        this._preemptive = false;
        this._surprise = false;
        if (typeof this._turn_end_subject !== 'undefined' && end_of_turn_effects === 0) {
            this._turn_end_subject.onTurnEnd();
            this.refreshStatus();
            this._logWindow.displayAutoAffectedStatus(this._turn_end_subject);
            this._logWindow.displayRegeneration(this._turn_end_subject);
        }
    };
   
   
    //Remove the ATB value when a turn is processed:
    _BattleManager_processTurn = BattleManager.processTurn;
    BattleManager.processTurn = function() {
        if (this._pending_atb_removal === true)
        {
            this._subject.atb -= full_atb;
            this._pending_atb_removal = false;
        }
        _BattleManager_processTurn.call(this);
    };
})();[/pre]
[/fold]

[fold=装备核心]2.装备核心
[pre lang="JavaScript" file="Equip Core"]//=============================================================================
// Yanfly Engine Plugins - Equip Core
// YEP_EquipCore.js
// Version: 1.01
//=============================================================================

var Imported = Imported || {};
Imported.YEP_EquipCore = true;

var Yanfly = Yanfly || {};
Yanfly.Equip = Yanfly.Equip || {};

//=============================================================================
/*:
* @plugindesc 更灵活的装备系统。
* 各职业拥有独特的装备槽。
* @author Yanfly Engine Plugins
*
* @param ---General---
* @default
*
* @param Text Align
* @desc 在指令窗口中如何对齐文字。
* left(靠左)  center(居中)  right(靠右)
* @default center
*
* @param Finish Command
* @desc 用于退出装备界面的指令名称。
* @default 完成
*
* @param Remove Text
* @desc 用于装备界面中卸下装备的指令名称。
* @default 清除
*
* @param Remove Icon
* @desc 用于装备界面中卸下装备的指令图标序号。
* @default 16
*
* @param Empty Text
* @desc 用于表示装备位置留空的名称。
* @default <空>
*
* @param Empty Icon
* @desc 用于留空装备位置的图标序号。
* @default 16
*
* @param ---Rules---
* @default
*
* @param Non-Removable Types
* @desc 这种装备槽类型必须始终处于被装备的状态,不可留空。
* 用空格分隔类型ID
* @default 1
*
* @param Non-Optimized Types
* @desc 这种装备槽类型不会受自动优化法则影响,当玩家使用最优搭配时会被忽略。
* 用空格分隔类型ID
* @default 5
*
* @help
* ============================================================================
* 简介
* ============================================================================
*
* 本插件会改变装备系统的各个方面,有以下改变。
*
* 1. 装备界面
* 装备界面会看起来有所区别。这主要是为了使界面看起来更加整齐,并且方便玩家熟悉
* 所有功能。此外,指令窗口被调整以更好地适应未来可能的扩展插件————在指令窗口或
* 者装备界面中添加进新的命令。
*
* 2. 装备处理
* 人物将不再使用通用的装备槽类型设置。现在,不同的职业可以通过在职业备注中简单
* 地标记来使用不同的设置。此外,过去名称一致的装备类型依然被视作不同的类型,而
* 现在,名称一致的装备类型将会被视作同一个类型。
*
* 3. 装备设置
* 现在,装备类型可以设置为允许被卸下或不允许被卸下。例如,本插件可以将武器槽设
* 置为必须始终被某个项目装备,并且玩家不可手动使其留空(另一方面,游戏中也可通
* 过事件实现这一功能)。此外,可以限制某些最好手动决定的装备不被自动优化法则作
* 用影响(如饰品)。
*
* 4. 参数控制
* 装备参数现在可以通过备注调整,以拥有更高的数据或特有的数值(通过代码),这使
* 得装备不再是静态的,而是动态的,并且可以在游戏过程中更改。
*
* ============================================================================
* 备注
* ============================================================================
*
* 你可以通过以下备注来改变职业装备设置。
*
* 职业备注:
*   <Equip Slot: x>      例如: <Equip Slot: 1, 2, 3, 4, 5, 5, 5, 5>
*   <Equip Slot: x, x, x>
*   改变该职业的装备槽为 X。可以使用相同的数字重复同一装备类型,这意味着该职业
*   可装备多个该类型的装备。装备类型ID位于数据库类型设定中。
*
*   如果你不喜欢用上面的方法来设置装备槽,可以使用以下备注代替:
*
*   <Equip Slot>            示例: <Equip Slot>
*    string                        Weapon
*    string                        Armor
*    string                        Accessory
*    string                        Accessory
*   </Equip Slot>                 </Equip Slot>
*   将更换的装备类型名称插入字符串中。名称区分大小写,所以如果字符串中的名称不
*   完全一致的话,被设置的装备槽将不会生效。插入多个相同名称意味着该职业可以装
*   备该类型的多个装备。和上一种备注的运行效果完全一样。
*
* 武器和盔甲备注:
*   <stat: +x>
*   <stat: -x>
*   允许该武器或盔甲增加或减少X属性值。可以用“hp”,“mp”,“atk”,“def”,“mat”,
*   “mdf”,“agi”或者“luk”代替“stat”来改变独特的stat。这将允许装备属性超过系统
*   默认的最大值。在这里改变基础参数。
*
* ============================================================================
* 疯狂模式 - 定制参数
* ============================================================================
*
*   <Custom Parameters>     示例: <Custom Parameters>
*    code                          atk = $gameVariables.value(1);
*    code                          mat = atk / 2;
*    code                          all = $gameParty.members().length;
*    code                         </Custom Parameters>
*   </Code Parameters>
*   允许参数通过代码调整获得特定的比例。下列参数可被定义:‘maxhp’,‘maxmp’,
*   ‘atk’,‘def’,‘mat’,‘mdf’,‘agi’,‘luk’和‘all’。参数‘all’将会影响所有参数。  
*   在这里的改变不会影响基础参数,而是叠加在基础参数上。
*
* ============================================================================
* 更新日志
* ============================================================================
*
* Version 1.01:
* - Fixed a bug that did not update the stats properly when compared.
*
* Version 1.00:
* - Finished plugin!
*/
//=============================================================================

//=============================================================================
// Parameter Variables
//=============================================================================

Yanfly.Parameters = PluginManager.parameters('YEP_EquipCore');
Yanfly.Param = Yanfly.Param || {};
Yanfly.Icon = Yanfly.Icon || {};

Yanfly.Param.EquipTextAlign = String(Yanfly.Parameters['Text Align']);
Yanfly.Param.EquipFinishCmd = String(Yanfly.Parameters['Finish Command']);
Yanfly.Param.EquipRemoveText = String(Yanfly.Parameters['Remove Text']);
Yanfly.Icon.RemoveEquip = Number(Yanfly.Parameters['Remove Icon']);
Yanfly.Param.EquipEmptyText = String(Yanfly.Parameters['Empty Text']);
Yanfly.Icon.EmptyEquip = Number(Yanfly.Parameters['Empty Icon']);
Yanfly.Data = String(Yanfly.Parameters['Non-Removable Types']);
Yanfly.Data = Yanfly.Data.split(' ');
Yanfly.Param.EquipNonRemove = [];
for (Yanfly.i = 0; Yanfly.i < Yanfly.Data.length; ++Yanfly.i) {
  Yanfly.Param.EquipNonRemove.push(parseInt(Yanfly.Data[Yanfly.i]));
};
Yanfly.Data = String(Yanfly.Parameters['Non-Optimized Types']);
Yanfly.Data = Yanfly.Data.split(' ');
Yanfly.Param.EquipNonOptimized = [];
for (Yanfly.i = 0; Yanfly.i < Yanfly.Data.length; ++Yanfly.i) {
  Yanfly.Param.EquipNonOptimized.push(parseInt(Yanfly.Data[Yanfly.i]));
};

//=============================================================================
// DataManager
//=============================================================================

Yanfly.Equip.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
    if (!Yanfly.Equip.DataManager_isDatabaseLoaded.call(this)) return false;
                DataManager.processEquipNotetags1($dataClasses);
    DataManager.processEquipNotetags2($dataWeapons);
    DataManager.processEquipNotetags2($dataArmors);
                return true;
};

DataManager.processEquipNotetags1 = function(group) {
        var note1 = /<(?:EQUIP SLOT|equip slots):[ ]*(\d+(?:\s*,\s*\d+)*)>/i;
  var note2 = /<(?:EQUIP SLOT|equip slots)>/i;
  var note3 = /<\/(?:EQUIP SLOT|equip slots)>/i;
        for (var n = 1; n < group.length; n++) {
                var obj = group[n];
                var notedata = obj.note.split(/[\r\n]+/);

    obj.equipSlots = [];
    var equipSlots = false;

                for (var i = 0; i < notedata.length; i++) {
                        var line = notedata;
                        if (line.match(note1)) {
        var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
        obj.equipSlots = obj.equipSlots.concat(array);
                        } else if (line.match(note2)) {
        equipSlots = true;
      } else if (line.match(note3)) {
        equipSlots = false;
      } else if (equipSlots && line.match(/[ ]*(.*)/i)) {
        var name = String(RegExp.$1);
        var slotId = $dataSystem.equipTypes.indexOf(name);
        if (slotId >= 0) obj.equipSlots.push(slotId);
      }
                }
    if (obj.equipSlots.length <= 0) this.setDefaultEquipSlots(obj);
        }
};

DataManager.setDefaultEquipSlots = function(obj) {
    for (var i = 1; i < $dataSystem.equipTypes.length; ++i) {
      var name = $dataSystem.equipTypes;
      var slotId = $dataSystem.equipTypes.indexOf(name);
      if (slotId >= 0) obj.equipSlots.push(slotId);
    }
};

DataManager.processEquipNotetags2 = function(group) {
        var note1 = /<(?:PARAMETER EVAL|custom parameter|custom parameters)>/i;
  var note2 = /<\/(?:PARAMETER EVAL|custom parameter|custom parameters)>/i;
  var note3 = /<(.*):[ ]([\+\-]\d+)>/i;
        for (var n = 1; n < group.length; n++) {
                var obj = group[n];
                var notedata = obj.note.split(/[\r\n]+/);

    obj.parameterEval = '';
    var parameterEval = false;

                for (var i = 0; i < notedata.length; i++) {
                        var line = notedata;
                        if (line.match(note1)) {
        parameterEval = true;
                        } else if (line.match(note2)) {
        parameterEval = false;
      } else if (parameterEval) {
        obj.parameterEval = obj.parameterEval + line + '\n';
      } else if (line.match(note3)) {
        var stat = String(RegExp.$1).toUpperCase();
                                var value = parseInt(RegExp.$2);
                                switch (stat) {
                                        case 'HP':
                      case 'MAXHP':
                      case 'MAX HP':
                                                obj.params[0] = value;
                                                break;
                                        case 'MP':
                      case 'MAXMP':
                      case 'MAX MP':
                      case 'SP':
                      case 'MAXSP':
                      case 'MAX SP':
                                                obj.params[1] = value;
                                                break;
                                        case 'ATK':
                      case 'STR':
                                                obj.params[2] = value;
                                                break;
                                        case 'DEF':
                                                obj.params[3] = value;
                                                break;
                                        case 'MAT':
                      case 'INT' || 'SPI':
                                                obj.params[4] = value;
                                                break;
                                        case 'MDF':
                      case 'RES':
                                                obj.params[5] = value;
                                                break;
                                        case 'AGI':
                      case 'SPD':
                                                obj.params[6] = value;
                                                break;
                                        case 'LUK':
                                                obj.params[7] = value;
                                                break;
          }
                        }
                }
        }
};

//=============================================================================
// Game_Actor
//=============================================================================

Game_Actor.prototype.initEquips = function(equips) {
    var array = [];
    for (var i = 0; i < equips.length; ++i) {
      var equipId = equips;
      if (equipId <= 0) continue;
      var equipType = $dataSystem.equipTypes[i + 1];
      if (equipType === $dataSystem.equipTypes[1] ||
      (i === 1 && this.isDualWield())) {
        var equip = $dataWeapons[equipId];
      } else {
        var equip = $dataArmors[equipId];
      }
      array.push(equip);
    }
    var slots = this.equipSlots();
    var maxSlots = slots.length;
    this._equips = [];
    for (var i = 0; i < maxSlots; ++i) {
      this._equips = new Game_Item();
    }
    for (var i = 0; i < array.length; ++i) {
      var equip = array;
      if (!equip) continue;
      var etypeId = equip.etypeId;
      if (!slots.contains(etypeId)) continue;
      var slotId = slots.indexOf(etypeId);
      if (this._equips[slotId].isWeapon() && this.isDualWield()) slotId += 1;
      this._equips[slotId].setObject(equip);
    }
    this.releaseUnequippableItems(true);
    this.recoverAll();
    this.refresh();
};

Game_Actor.prototype.equipSlots = function() {
    var slots = this.currentClass().equipSlots.slice();
    if (slots.length >= 2 && this.isDualWield()) slots[1] = 1;
    return slots;
};

Yanfly.Equip.Game_Actor_equips = Game_Actor.prototype.equips;
Game_Actor.prototype.equips = function() {
    for (var i = 0; i < this.currentClass().equipSlots.length; ++i) {
      if (!this._equips) this._equips = new Game_Item();
    }
    return Yanfly.Equip.Game_Actor_equips.call(this);
};

Yanfly.Equip.Game_Actor_changeEquip = Game_Actor.prototype.changeEquip;
Game_Actor.prototype.changeEquip = function(slotId, item) {
    if (!this._equips[slotId]) this._equips[slotId] = new Game_Item();
    Yanfly.Equip.Game_Actor_changeEquip.call(this, slotId, item);
};

Yanfly.Equip.Game_Actor_forceChangeEquip =
    Game_Actor.prototype.forceChangeEquip;
Game_Actor.prototype.forceChangeEquip = function(slotId, item) {
    if (!this._equips[slotId]) this._equips[slotId] = new Game_Item();
    Yanfly.Equip.Game_Actor_forceChangeEquip.call(this, slotId, item);
};

Yanfly.Equip.Game_Actor_isEquipChangeOk = Game_Actor.prototype.isEquipChangeOk;
Game_Actor.prototype.isEquipChangeOk = function(slotId) {
    if ($gameTemp._clearEquipments) {
      var typeId = this.equipSlots()[slotId];
      if (Yanfly.Param.EquipNonRemove.contains(typeId)) return false;
    }
    if ($gameTemp._optimizeEquipments) {
      var typeId = this.equipSlots()[slotId];
      if (Yanfly.Param.EquipNonOptimized.contains(typeId)) return false;
    }
    return Yanfly.Equip.Game_Actor_isEquipChangeOk.call(this, slotId);
};

Yanfly.Equip.Game_Actor_paramPlus = Game_Actor.prototype.paramPlus;
Game_Actor.prototype.paramPlus = function(paramId) {
    value = Yanfly.Equip.Game_Actor_paramPlus.call(this, paramId);
    var equips = this.equips();
    for (var i = 0; i < equips.length; i++) {
      var item = equips;
      if (!item) continue;
      value += this.customParamPlus(item, paramId);
      value += this.evalParamPlus(item, paramId);
    }

    return value;
};

Game_Actor.prototype.customParamPlus = function(item, paramId) {
    return 0;
};

Game_Actor.prototype.evalParamPlus = function(item, paramId) {
    if (!item) return 0;
    if (!item.parameterEval || item.parameterEval === '') return 0;
    var value = 0;
    var hp = 0;
    var maxhp = 0;
    var mhp = 0;
    var mp = 0;
    var maxmp = 0;
    var mmp = 0;
    var sp = 0;
    var maxsp = 0;
    var msp = 0;
    var atk = 0;
    var str = 0;
    var def = 0;
    var mat = 0;
    var int = 0;
    var spi = 0;
    var mdf = 0;
    var res = 0;
    var agi = 0;
    var spd = 0;
    var luk = 0;
    var all = 0;
    var a = this;
    var user = this;
    var s = $gameSwitches._data;
    var v = $gameVariables._data;
    eval(item.parameterEval);
    switch (paramId) {
      case 0:
        value += hp + maxhp + mhp;
        break;
      case 1:
        value += mp + maxmp + mmp + sp + maxsp + msp;
        break;
      case 2:
        value += atk + str;
        break;
      case 3:
        value += def;
        break;
      case 4:
        value += mat + int + spi;
        break;
      case 5:
        value += mdf + res;
        break;
      case 6:
        value += agi + spd;
        break;
      case 7:
        value += luk;
        break;
    }
    return value + all;
};

//=============================================================================
// Window_EquipCommand
//=============================================================================

Window_EquipCommand.prototype.windowWidth = function() {
    return 240;
};

Window_EquipCommand.prototype.maxCols = function() {
    return 1;
};

Window_EquipCommand.prototype.windowHeight = function() {
    return this.fittingHeight(this.numVisibleRows());
};

Window_EquipCommand.prototype.numVisibleRows = function() {
    return 4;
};

Window_EquipCommand.prototype.itemTextAlign = function() {
    return Yanfly.Param.EquipTextAlign;
};

Yanfly.Equip.Window_EquipCommand_makeCommandList =
    Window_EquipCommand.prototype.makeCommandList;
Window_EquipCommand.prototype.makeCommandList = function() {
    Yanfly.Equip.Window_EquipCommand_makeCommandList.call(this);
    this.addCustomCommand();
    this.addFinishCommand();
};

Window_EquipCommand.prototype.addCustomCommand = function() {
};

Window_EquipCommand.prototype.addFinishCommand = function() {
    this.addCommand(Yanfly.Param.EquipFinishCmd, 'cancel');
};

//=============================================================================
// Window_EquipSlot
//=============================================================================

Yanfly.Equip.Window_EquipSlot_setActor = Window_EquipSlot.prototype.setActor;
Window_EquipSlot.prototype.setActor = function(actor) {
    this.setSlotNameWidth(actor);
    Yanfly.Equip.Window_EquipSlot_setActor.call(this, actor);
};

Window_EquipSlot.prototype.isEnabled = function(index) {
    if (this._actor) {
      return Yanfly.Equip.Game_Actor_isEquipChangeOk.call(this._actor, index);
    } else {
      return false;
    }
};

Window_EquipSlot.prototype.drawItem = function(index) {
    if (!this._actor) return;
    var rect = this.itemRectForText(index);
    this.changeTextColor(this.systemColor());
    this.changePaintOpacity(this.isEnabled(index));
    var ww1 = this._nameWidth;
    this.drawText(this.slotName(index), rect.x, rect.y, ww1);
    var ww2 = rect.width - ww1;
    var item = this._actor.equips()[index];
    if (item) {
      this.drawItemName(item, rect.x + ww1, rect.y, ww2);
    } else {
      this.drawEmptySlot(rect.x + ww1, rect.y, ww2);
    }
    this.changePaintOpacity(true);
};

Window_EquipSlot.prototype.setSlotNameWidth = function(actor) {
    if (!actor) return;
    this._nameWidth = 0;
    for (var i = 0; i < actor.equipSlots().length; ++i) {
      var text = $dataSystem.equipTypes[actor.equipSlots()] + ' ';
      this._nameWidth = Math.max(this._nameWidth, this.textWidth(text));
    }
};

Window_EquipSlot.prototype.drawEmptySlot = function(wx, wy, ww) {
    this.changePaintOpacity(false);
    var ibw = Window_Base._iconWidth + 4;
    this.resetTextColor();
    this.drawIcon(Yanfly.Icon.EmptyEquip, wx + 2, wy + 2);
    var text = Yanfly.Param.EquipEmptyText;
    this.drawText(text, wx + ibw, wy, ww - ibw);
};

//=============================================================================
// Window_EquipItem
//=============================================================================

Window_EquipItem.prototype.maxCols = function() {
    return 1;
};

Yanfly.Equip.Window_EquipItem_setSlotId = Window_EquipItem.prototype.setSlotId;
Window_EquipItem.prototype.setSlotId = function(slotId) {
    // do nothing
};

Yanfly.Equip.Window_EquipItem_includes = Window_EquipItem.prototype.includes;
Window_EquipItem.prototype.includes = function(item) {
    if (item === null && this._actor && this._data.length > 0) {
      var typeId = this._actor.equipSlots()[this._slotId];
      if (Yanfly.Param.EquipNonRemove.contains(typeId)) return false;
    }
    return Yanfly.Equip.Window_EquipItem_includes.call(this, item);
};

Yanfly.Equip.Window_EquipItem_isEnabled =
    Window_EquipItem.prototype.isEnabled;
Window_EquipItem.prototype.isEnabled = function(item) {
    if (item === null && this._actor) {
      var typeId = this._actor.equipSlots()[this._slotId];
      if (Yanfly.Param.EquipNonRemove.contains(typeId)) return false;
    }
    return Yanfly.Equip.Window_EquipItem_isEnabled.call(this, item);
};

Yanfly.Equip.Window_EquipItem_drawItem = Window_EquipItem.prototype.drawItem;
Window_EquipItem.prototype.drawItem = function(index) {
    var item = this._data[index];
    if (item === null) {
      this.drawRemoveEquip(index);
    } else {
      Yanfly.Equip.Window_EquipItem_drawItem.call(this, index);
    }
};

Window_EquipItem.prototype.drawRemoveEquip = function(index) {
    if (!this.isEnabled(null)) return;
    var rect = this.itemRect(index);
    rect.width -= this.textPadding();
    this.changePaintOpacity(true);
    var ibw = Window_Base._iconWidth + 4;
    this.resetTextColor();
    this.drawIcon(Yanfly.Icon.RemoveEquip, rect.x + 2, rect.y + 2);
    var text = Yanfly.Param.EquipRemoveText;
    this.drawText(text, rect.x + ibw, rect.y, rect.width - ibw);
};

//=============================================================================
// Window_StatCompare
//=============================================================================

function Window_StatCompare() {
    this.initialize.apply(this, arguments);
}

Window_StatCompare.prototype = Object.create(Window_Base.prototype);
Window_StatCompare.prototype.constructor = Window_StatCompare;

Window_StatCompare.prototype.initialize = function(wx, wy, ww, wh) {
    Window_Base.prototype.initialize.call(this, wx, wy, ww, wh);
    this._actor = null;
    this._tempActor = null;
    this.refresh();
};

Window_StatCompare.prototype.createWidths = function() {
                this._paramNameWidth = 0;
                this._paramValueWidth = 0;
                this._arrowWidth = this.textWidth('\u2192' + ' ');
                var buffer = this.textWidth(' ');
                for (var i = 0; i < 8; ++i) {
                        var value1 = this.textWidth(TextManager.param(i));
                        var value2 = this.textWidth(Yanfly.Util.toGroup(this._actor.paramMax(i)));
                        this._paramNameWidth = Math.max(value1, this._paramNameWidth);
                        this._paramValueWidth = Math.max(value2, this._paramValueWidth);
                }
                this._bonusValueWidth = this._paramValueWidth;
                this._bonusValueWidth += this.textWidth('(+)') + buffer;
                this._paramNameWidth += buffer;
                this._paramValueWidth;
                if (this._paramNameWidth + this._paramValueWidth * 2 + this._arrowWidth +
                        this._bonusValueWidth > this.contents.width) this._bonusValueWidth = 0;
};

Window_StatCompare.prototype.setActor = function(actor) {
    if (this._actor === actor) return;
    this._actor = actor;
                this.createWidths();
    this.refresh();
};

Window_StatCompare.prototype.refresh = function() {
    this.contents.clear();
    if (!this._actor) return;
    for (var i = 0; i < 8; ++i) {
        this.drawItem(0, this.lineHeight() * i, i);
    }
};

Window_StatCompare.prototype.setTempActor = function(tempActor) {
    if (this._tempActor === tempActor) return;
    this._tempActor = tempActor;
    this.refresh();
};

Window_StatCompare.prototype.drawItem = function(x, y, paramId) {
                this.drawDarkRect(x, y, this.contents.width, this.lineHeight());
                this.drawParamName(y, paramId);
    this.drawCurrentParam(y, paramId);
                this.drawRightArrow(y);
    if (!this._tempActor) return;
                this.drawNewParam(y, paramId);
                this.drawParamDifference(y, paramId);
};

Window_StatCompare.prototype.drawDarkRect = function(dx, dy, dw, dh) {
    var color = this.gaugeBackColor();
    this.changePaintOpacity(false);
    this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
    this.changePaintOpacity(true);
};

Window_StatCompare.prototype.drawParamName = function(y, paramId) {
    var x = this.textPadding();
                this.changeTextColor(this.systemColor());
    this.drawText(TextManager.param(paramId), x, y, this._paramNameWidth);
};

Window_StatCompare.prototype.drawCurrentParam = function(y, paramId) {
    var x = this.contents.width - this.textPadding();
                x -= this._paramValueWidth * 2 + this._arrowWidth + this._bonusValueWidth;
                this.resetTextColor();
                var actorparam = Yanfly.Util.toGroup(this._actor.param(paramId));
    this.drawText(actorparam, x, y, this._paramValueWidth, 'right');
};

Window_StatCompare.prototype.drawRightArrow = function(y) {
                var x = this.contents.width - this.textPadding();
                x -= this._paramValueWidth + this._arrowWidth + this._bonusValueWidth;
                var dw = this.textWidth('\u2192' + ' ');
                this.changeTextColor(this.systemColor());
    this.drawText('\u2192', x, y, dw, 'center');
};

Window_StatCompare.prototype.drawNewParam = function(y, paramId) {
                var x = this.contents.width - this.textPadding();
                x -= this._paramValueWidth + this._bonusValueWidth;
                var newValue = this._tempActor.param(paramId);
    var diffvalue = newValue - this._actor.param(paramId);
                var actorparam = Yanfly.Util.toGroup(newValue);
                this.changeTextColor(this.paramchangeTextColor(diffvalue));
    this.drawText(actorparam, x, y, this._paramValueWidth, 'right');
};

Window_StatCompare.prototype.drawParamDifference = function(y, paramId) {
                var x = this.contents.width - this.textPadding();
                x -= this._bonusValueWidth;
                var newValue = this._tempActor.param(paramId);
    var diffvalue = newValue - this._actor.param(paramId);
                if (diffvalue === 0) return;
                var actorparam = Yanfly.Util.toGroup(newValue);
    this.changeTextColor(this.paramchangeTextColor(diffvalue));
                var text = Yanfly.Util.toGroup(diffvalue);
                if (diffvalue > 0) {
                        text = ' (+' + text + ')';
                } else {
                        text = ' (' + text + ')';
                }
    this.drawText(text, x, y, this._bonusValueWidth, 'left');
};

//=============================================================================
// Scene_Equip
//=============================================================================

Scene_Equip.prototype.create = function() {
    Scene_MenuBase.prototype.create.call(this);
    this.createHelpWindow();
    this.createCommandWindow();
    this.createStatusWindow();
    this.createSlotWindow();
    this.createItemWindow();
    this.createCompareWindow();
    this.refreshActor();
};

Scene_Equip.prototype.createCommandWindow = function() {
    var wy = this._helpWindow.height;
    this._commandWindow = new Window_EquipCommand(0, wy, 240);
    this._commandWindow.setHelpWindow(this._helpWindow);
    this._commandWindow.setHandler('equip', this.commandEquip.bind(this));
    this._commandWindow.setHandler('optimize', this.commandOptimize.bind(this));
    this._commandWindow.setHandler('clear', this.commandClear.bind(this));
    this._commandWindow.setHandler('cancel', this.popScene.bind(this));
    this._commandWindow.setHandler('pagedown', this.nextActor.bind(this));
    this._commandWindow.setHandler('pageup', this.previousActor.bind(this));
    this.addWindow(this._commandWindow);
};

Scene_Equip.prototype.createStatusWindow = function() {
    var wx = this._commandWindow.width;
    var wy = this._helpWindow.height;
    var ww = Graphics.boxWidth - wx;
    var wh = this._commandWindow.height;
    this._statusWindow = new Window_SkillStatus(wx, wy, ww, wh);
    this.addWindow(this._statusWindow);
};

Scene_Equip.prototype.createSlotWindow = function() {
    var wy = this._commandWindow.y + this._commandWindow.height;
    var ww = Graphics.boxWidth / 2;
    var wh = Graphics.boxHeight - wy;
    this._slotWindow = new Window_EquipSlot(0, wy, ww, wh);
    this._slotWindow.setHelpWindow(this._helpWindow);
    this._slotWindow.setHandler('ok',       this.onSlotOk.bind(this));
    this._slotWindow.setHandler('cancel',   this.onSlotCancel.bind(this));
    this.addWindow(this._slotWindow);
};

Scene_Equip.prototype.createItemWindow = function() {
    var wy = this._slotWindow.y;
    var ww = Graphics.boxWidth / 2;
    var wh = Graphics.boxHeight - wy;
    this._itemWindow = new Window_EquipItem(0, wy, ww, wh);
    this._itemWindow.setHelpWindow(this._helpWindow);
    this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
    this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
    this._slotWindow.setItemWindow(this._itemWindow);
    this.addWindow(this._itemWindow);
    this._itemWindow.hide();
};

Scene_Equip.prototype.createCompareWindow = function() {
    var wx = this._itemWindow.width;
                var wy = this._itemWindow.y;
                var ww = Graphics.boxWidth - wx;
                var wh = Graphics.boxHeight - wy;
                this._compareWindow = new Window_StatCompare(wx, wy, ww, wh);
    this._slotWindow.setStatusWindow(this._compareWindow);
                this._itemWindow.setStatusWindow(this._compareWindow);
    this.addWindow(this._compareWindow);
};

Yanfly.Equip.Scene_Equip_refreshActor = Scene_Equip.prototype.refreshActor;
Scene_Equip.prototype.refreshActor = function() {
    Yanfly.Equip.Scene_Equip_refreshActor.call(this);
    this._compareWindow.setActor(this.actor());
};

Yanfly.Equip.Scene_Equip_commandOptimize =
    Scene_Equip.prototype.commandOptimize;
Scene_Equip.prototype.commandOptimize = function() {
    $gameTemp._optimizeEquipments = true;
    Yanfly.Equip.Scene_Equip_commandOptimize.call(this);
    $gameTemp._optimizeEquipments = false;
    this._compareWindow.refresh();
    this._statusWindow.refresh();
};

Yanfly.Equip.Scene_Equip_commandClear = Scene_Equip.prototype.commandClear;
Scene_Equip.prototype.commandClear = function() {
    $gameTemp._clearEquipments = true;
    Yanfly.Equip.Scene_Equip_commandClear.call(this);
    $gameTemp._clearEquipments = false;
    this._compareWindow.refresh();
    this._statusWindow.refresh();
};

Yanfly.Equip.Scene_Equip_onSlotOk = Scene_Equip.prototype.onSlotOk;
Scene_Equip.prototype.onSlotOk = function() {
    var slotId = this._slotWindow.index();
    Yanfly.Equip.Window_EquipItem_setSlotId.call(this._itemWindow, slotId);
    Yanfly.Equip.Scene_Equip_onSlotOk.call(this);
    this._itemWindow.show();
};

Yanfly.Equip.Scene_Equip_onItemOk = Scene_Equip.prototype.onItemOk;
Scene_Equip.prototype.onItemOk = function() {
    var hpRate = this.actor().hp / this.actor().mhp;
    var mpRate = this.actor().mp / this.actor().mmp;
    Yanfly.Equip.Scene_Equip_onItemOk.call(this);
    this.actor().setHp(parseInt(this.actor().mhp * hpRate));
                this.actor().setMp(parseInt(this.actor().mmp * mpRate));
    this._itemWindow.hide();
    this._statusWindow.refresh();
};

Yanfly.Equip.Scene_Equip_onItemCancel = Scene_Equip.prototype.onItemCancel;
Scene_Equip.prototype.onItemCancel = function() {
    Yanfly.Equip.Scene_Equip_onItemCancel.call(this);
    this._itemWindow.hide();
};

//=============================================================================
// Utilities
//=============================================================================

Yanfly.Util = Yanfly.Util || {};

if (!Yanfly.Util.toGroup) {
                Yanfly.Util.toGroup = function(inVal) {
                                return inVal;
                }
};

//=============================================================================
// End of File
//=============================================================================[/pre][/fold]

[fold=战斗音效]3.战斗音效
[pre lang="JavaScript" file="BattleVoice"]//=============================================================================
// BattleVoice.js
//=============================================================================

/*:
* @plugindesc 当人物做出指定动作时播放SE。
* @author Sasuke KANNAZUKI
*
* @param pitch
* @desc 设置所有SE的音频。
* @default 100
*
* @param volume
* @desc 设置所有SE的音量。
* @default 90
*
* @help 本插件不提供插件命令。
*
* 备注格式:
* 根据下列格式,在每个人物的备注内填写SE名称。
* <attackVoice:filename>
* -做出普通攻击时播放的音效。
* <recoverVoice:filename>
* -使用HP恢复魔法时播放的音效。
* <friendMagicVoice:filename>
* -对队友使用除HP恢复以外的魔法时播放的音效。
*   -如果没有设定该项,并且设定了特技音效时,播放魔法音效。
* <magicVoice:filename>
* -使用魔法时播放的音效(不包括对队友使用)。
* <skillVoice:filename>
* -使用除魔法以外的特殊技能时播放的音效。
* <damageVoice:filename>
* -受到伤害时播放的音效。
* <defeatedVoice:filename>
* -无法战斗时播放的音效。
* <victoryVoice:filename>
* -战斗胜利时播放的音效。
*   -如果有多人参加战斗并且设置了不同的音效,将随机选择其中一人的胜利音效。
*
*/
/*:ja
* @plugindesc アクターの戦闘時の行動にボイスSEを設定します。
* @author 神無月サスケ
*
* @param pitch
* @desc ボイスSEのピッチです。この設定が全てのボイスSEの共通となります。
* @default 100
*
* @param volume
* @desc ボイスSEのボリュームです。この設定が全てのボイスSEの共通となります。
* @default 90
*
* @help このプラグインには、プラグインコマンドはありません。
*
* メモ設定方法:
* それぞれのアクターのメモに以下の書式で書いてください。
* filename はボイスSEのファイル名にしてください。
*
* <attackVoice:filename>  通常攻撃の時に再生されるボイスです。
* <recoverVoice:filename>   HP回復魔法を使用した時に再生されるボイスです。
* <friendMagicVoice:filename>   HP回復以外の味方向け魔法を使用した時に
*  再生されるボイスです。省略された場合で<magicVoice:filename>が
*  設定されている場合は、そちらが再生されます。
* <magicVoice:filename> 味方向け以外の魔法を使用した時に再生されるボイスです。
* <skillVoice:filename>   必殺技を使用した時に再生されるボイスです。
* <damageVoice:filename>    ダメージを受けた時に再生されるボイスです。
* <defeatedVoice:filename>   戦闘不能になった時に再生されるボイスです。
* <victoryVoice:filename>   戦闘勝利時に再生されるボイスです。
*  アクターが複数いる場合は、生きているアクターの中からランダムで再生されます。
*
*/
(function() {

  //
  // process parameters
  //
  var parameters = PluginManager.parameters('BattleVoice');
  var pitch = Number(parameters['pitch']) || 100;
  var volume = Number(parameters['volume']) || 90;

  AudioManager.createAudioByFileame = function(name){
    var audio = {};
    audio.name = name;
    audio.pitch = pitch;
    audio.volume = volume;
    return audio;
  };

  //
  // play actor voice
  //
  SoundManager.playActorVoice = function(actor, type){
    var name = '';
    switch(type){
      case 'attack':
        name = actor.meta.attackVoice;
        break;
      case 'recover':
        name = actor.meta.recoverVoice;
        break;
      case 'friendmagic':
        name = actor.meta.friendMagicVoice || actor.meta.magicVoice;
        break;
      case 'magic':
        name = actor.meta.magicVoice;
        break;
      case 'skill':
        name = actor.meta.skillVoice;
        break;
      case 'damage':
        name = actor.meta.damageVoice;
        break;
      case 'dead':
        name = actor.meta.defeatedVoice;
        break;
      case 'victory':
        name = actor.meta.victoryVoice;
        break;
    }
    if(name){
      var audio = AudioManager.createAudioByFileame(name);
      AudioManager.playSe(audio);
    }
  };

  //
  // functions for call actor voice.
  //
  var _Game_Actor_performAction = Game_Actor.prototype.performAction;
  Game_Actor.prototype.performAction = function(action) {
    _Game_Actor_performAction.call(this, action);
    if (action.isAttack()) {
      SoundManager.playActorVoice(this.actor(), 'attack');
    } else if (action.isMagicSkill() && action.isHpRecover()) {
      SoundManager.playActorVoice(this.actor(), 'recover');
    } else if (action.isMagicSkill() && action.isForFriend()) {
      SoundManager.playActorVoice(this.actor(), 'friendmagic');
    } else if (action.isMagicSkill()) {
      SoundManager.playActorVoice(this.actor(), 'magic');
    } else if (action.isSkill() && !action.isGuard()) {
      SoundManager.playActorVoice(this.actor(), 'skill');
    }
  };

  var _Game_Actor_performDamage = Game_Actor.prototype.performDamage;
  Game_Actor.prototype.performDamage = function() {
    _Game_Actor_performDamage.call(this);
    SoundManager.playActorVoice(this.actor(), 'damage');
  };

  var _Game_Actor_performCollapse = Game_Actor.prototype.performCollapse;
  Game_Actor.prototype.performCollapse = function() {
    _Game_Actor_performCollapse.call(this);
    if ($gameParty.inBattle()) {
      SoundManager.playActorVoice(this.actor(), 'dead');
    }
  };

  var _BattleManager_processVictory = BattleManager.processVictory;
  BattleManager.processVictory = function() {
    var index = Math.randomInt($gameParty.aliveMembers().length);
    var actor = $gameParty.aliveMembers()[index].actor();
    SoundManager.playActorVoice(actor, 'victory');
    _BattleManager_processVictory.call(this);
  };

})();
[/pre]
[/fold]

[fold=改变图块大小]4.改变图块大小
[pre lang="JavaScript" file="ChangeTileSize"]//=============================================================================
// Change Tile Size
// by Shaz
// Last Update: 2015.10.21
//=============================================================================

/*:
* @plugindesc 允许地图使用48x48以外格式的图块。
* @author Shaz
*
* @param Tile Size
* @desc 图块大小(像素)
* @default 48
*
* @param Tileset Image Folder
* @desc 游戏中图块存放的文件夹。
* @default img/tilesets/
*
* @param Parallax Image Folder
* @desc 游戏中远景图片存放的文件夹。
* @default img/parallaxes/
*
* @help 本插件不提供插件命令。
*
* 在你的工程中使用48x48以外格式的图块编辑地图时,存有两个图块文件夹。
* 插件中命名的文件夹放置最终大小而且高质量的自定义图块,而原本的文件夹
* img/tilesets/会保存每个图块文件的副本,并放大或缩小至标准规格48x48。
* 自定义大小的图块在地图编辑器中的质量可能受损,但在实际游戏运行中将表
* 现为原本的质量。原文件夹可以在分配之前清除。
*
* 这个规则同样适用于使用了48x48以外规格的远景图。
*
*/

(function() {

  var parameters = PluginManager.parameters('ChangeTileSize');
  var tileSize = parseInt(parameters['Tile Size'] || 48);
  var tilesetsFolder = String(parameters['Tileset Image Folder'] || 'img/tilesets/');
  var parallaxesFolder = String(parameters['Parallax Image Folder'] || 'img/parallaxes/');

  ImageManager.loadTileset = function(filename, hue) {
    return this.loadBitmap(tilesetsFolder, filename, hue, false);
  };

  ImageManager.loadParallax = function(filename, hue) {
      return this.loadBitmap(parallaxesFolder, filename, hue, true);
  };

  Game_Map.prototype.tileWidth = function() {
    return tileSize;
  };

  Game_Map.prototype.tileHeight = function() {
    return tileSize;
  };

  Game_Vehicle.prototype.maxAltitude = function() {
    return tileSize;
  };

})();
[/pre][/fold]

[fold=道具使用范围同时包括生存和死亡]5.道具使用范围同时包括生存和死亡
[pre lang="JavaScript" file="DeadOrAliveItem"]//=============================================================================
// DeadOrAliveItem.js
//=============================================================================

/*:
* @plugindesc 使技能/道具在人物存活和不可战斗状态下均可生效。
* @author Sasuke KANNAZUKI
*
* @help 本插件不提供插件命令。
*
* 技能/道具备注:
*   <scope:oneDeadOrAlive>
*   <scope:allDeadOrAlive>
* 用法示例:
*  - 一个用于复活队友同时HP恢复完全的技能,
*    如果作用于存活的队友身上则将其HP补满。
*/

/*:ja
* @plugindesc 戦闘不能かどうかに関係なく、仲間に使える技/アイテムを作成
* @author 神無月サスケ
*
* @help このプラグインにはプラグインコマンドはありません。
*
* スキル/アイテムのメモに以下のように書いてください
* <scope:oneDeadOrAlive>  生死問わず仲間1体への効果になります
* <scope:allDeadOrAlive> 生死問わず仲間全体への効果になります
*
* 使用例:
* 死者をHP全快で蘇生させる技だが、生きている味方に使用してもHP全快する
*/

(function() {

  // added item.scope
  // 20 : single friend (dead or alive)
  // 21 : all friends (dead or alive)

  //
  // process data in item.note
  // (for efficiency, note is processed at first.)
  //
  var _Scene_Boot_start = Scene_Boot.prototype.start;
  Scene_Boot.prototype.start = function() {
    _Scene_Boot_start.call(this);
    DataManager.processItemScope();
  };

  DataManager.processItemScope = function() {
    for (var i = 1; i < $dataSkills.length; i++) {
      DataManager.checkEachItemScope($dataSkills);
    }
    for (var i = 1; i < $dataItems.length; i++) {
      DataManager.checkEachItemScope($dataItems);
    }
  };

  DataManager.checkEachItemScope = function(item) {
    var result = item.meta.scope;
    if (result){
      if(result == 'oneDeadOrAlive') {
        item.scope = 20;
      } else if (result == 'allDeadOrAlive') {
        item.scope = 21;
      }
    }
  };

  //
  // make status "dead or alive"
  //
  Game_Action.prototype.isDeadOrAlive = function() {
    return this.checkItemScope([20, 21]);
  };

  var _Game_Action_isForFriend = Game_Action.prototype.isForFriend;
  Game_Action.prototype.isForFriend = function() {
    if (_Game_Action_isForFriend.call(this)) {
      return true;
    }
    return this.checkItemScope([20, 21]);
  };

  var _Game_Action_isForDeadFriend = Game_Action.prototype.isForDeadFriend;
  Game_Action.prototype.isForDeadFriend = function() {
    if (_Game_Action_isForDeadFriend.call(this)) {
      return true;
    }
    return this.checkItemScope([20, 21]);
  };

  var _Game_Action_isForOne = Game_Action.prototype.isForOne;
  Game_Action.prototype.isForOne = function() {
    if (_Game_Action_isForOne.call(this)) {
      return true;
    }
    return this.checkItemScope([20]);
  };

  var _Game_Action_isForAll = Game_Action.prototype.isForAll;
  Game_Action.prototype.isForAll = function() {
    if (_Game_Action_isForAll.call(this)) {
      return true;
    }
    return this.checkItemScope([21]);
  };

  var _Game_Action_needsSelection = Game_Action.prototype.needsSelection;
  Game_Action.prototype.needsSelection = function() {
    if (_Game_Action_needsSelection.call(this)) {
      return true;
    }
    return this.checkItemScope([20]);
  };

  //
  // smooth/random target
  //
  Game_Unit.prototype.smoothTargetDeadOrAlive = function(index) {
    if (index < 0) {
        index = 0;
    }
    var member = this.members()[index];
    return member ? member : this.members()[0];
  };

  Game_Unit.prototype.randomTargetDeadOrAlive = function() {
    var randomDeadTarget = this.randomDeadTarget();
    if( randomDeadTarget ) {
      return randomDeadTarget;
    }
    return this.randomTarget();
  };

  var _Game_Action_decideRandomTarget =
   Game_Action.prototype.decideRandomTarget;
  Game_Action.prototype.decideRandomTarget = function() {
    var target;
    if(this.isDeadOrAlive()){
      target = this.friendsUnit().randomTargetDeadOrAlive();
      if (target) {
        this._targetIndex = target.index;
      } else {
        this.clear();
      }
      return;
    }
    _Game_Action_decideRandomTarget.call(this);
  };

  var _Game_Action_targetsForFriends = Game_Action.prototype.targetsForFriends;
  Game_Action.prototype.targetsForFriends = function() {
    var targets = [];
    var unit = this.friendsUnit();
    if(this.isDeadOrAlive()) {
      if (this.isForOne()) {
        targets.push(unit.smoothTargetDeadOrAlive(this._targetIndex));
      } else {
        targets = unit.members();
      }
      return targets;
    }
    return _Game_Action_targetsForFriends.call(this);
  };

  var _Game_Action_itemTargetCandidates =
   Game_Action.prototype.itemTargetCandidates;
  Game_Action.prototype.itemTargetCandidates = function() {
    if (!this.isValid()) {
      return [];
    } else if (this.isDeadOrAlive()) {
      return this.friendsUnit().members();
    }
    return _Game_Action_itemTargetCandidates.call(this);
  };

  var _Game_Action_testApply = Game_Action.prototype.testApply;
  Game_Action.prototype.testApply = function(target) {
    if(_Game_Action_testApply.call(this, target)) {
      return true;
    }
    // for convenience, always true
    if(this.isDeadOrAlive()) {
      return true;
    }
    return false;
};

})();
[/pre][/fold]

[fold=战斗中更改武器]6.战斗中更改武器
[pre lang="JavaScript" file="ChangeWeaponOnBattle"]//=============================================================================
// ChangeWeaponOnBattle.js
//=============================================================================

/*:
* @plugindesc 在战斗指令中更换武器。
* @author Sasuke KANNAZUKI
*
* @param commandName
* @desc 战斗中更换装备的指令名称。
* @default 装备
*
* @help 本插件不提供插件命令。
*
* - 可被更换的装备包括武器和盾牌。
* - 更换装备不消耗回合数。
*
*/

/*:ja
* @plugindesc 戦闘コマンドに装備変更を追加
* @author 神無月サスケ
*
* @param commandName
* @desc 装備変更のコマンド名です。
* @default 装備変更
*
* @help このプラグインには、プラグインコマンドはありません。
*
* - 変更可能なのは武器と盾だけです。
* - 装備変更はターンを消費しません。
*
*/

(function() {

  var parameters = PluginManager.parameters('ChangeWeaponOnBattle');
  var commandName = parameters['commandName'] || 'Equip';

  //---------------------------------------------------------------------------
  // Tiny equip status
  // display only atk and def.
  //
  function Window_TinyEquipStatus() {
    this.initialize.apply(this, arguments);
  }

  Window_TinyEquipStatus.prototype =
   Object.create(Window_EquipStatus.prototype);
  Window_TinyEquipStatus.prototype.constructor = Window_TinyEquipStatus;

  Window_TinyEquipStatus.prototype.initialize = function(x, y) {
    Window_EquipStatus.prototype.initialize.call(this, x, y);
  };

  Window_TinyEquipStatus.prototype.numVisibleRows = function() {
    return 2;
  };

  Window_TinyEquipStatus.prototype.refresh = function() {
    this.contents.clear();
    if (this._actor) {
      for (var i = 0; i < 2; i++) {
        this.drawItem(0, this.lineHeight() * i, 2 + i);
      }
    }
  };

  //---------------------------------------------------------------------------
  // Tiny equip slot
  // display only a weapon, and a shield or another weapon.
  //
  function Window_TinyEquipSlot() {
    this.initialize.apply(this, arguments);
  }

  Window_TinyEquipSlot.prototype = Object.create(Window_EquipSlot.prototype);
  Window_TinyEquipSlot.prototype.constructor = Window_TinyEquipSlot;

  Window_TinyEquipSlot.prototype.initialize  = function(x, y, width, height) {
    Window_EquipSlot.prototype.initialize.call(this, x, y, width, height);
  };

  Window_TinyEquipSlot.prototype.maxItems = function() {
    return this._actor ? 2 : 0;
  };

  Window_TinyEquipSlot.prototype.show = function() {
    Window_EquipSlot.prototype.show.call(this);
    this.showHelpWindow();
  };

  Window_TinyEquipSlot.prototype.hide = function() {
    Window_EquipSlot.prototype.hide.call(this);
    this.hideHelpWindow();
  };

  //---------------------------------------------------------------------------

  //
  // add equipment windows for check active.
  //
  var _Scene_Battle_isAnyInputWindowActive =
   Scene_Battle.prototype.isAnyInputWindowActive;
  Scene_Battle.prototype.isAnyInputWindowActive = function() {
    if(_Scene_Battle_isAnyInputWindowActive.call(this)) {
      return true;
    }
    return (this._equipSlotWindow.active || this._equipItemWindow.active);
  };

  //
  // creat new windows for equip weapon(s) on battle
  //
  var _Scene_Battle_createAllWindows = Scene_Battle.prototype.createAllWindows;
  Scene_Battle.prototype.createAllWindows = function() {
    _Scene_Battle_createAllWindows.call(this);
    this.createEquipStatusWindow();
    this.createEquipSlotWindow();
    this.createEquipItemWindow();
  };

  Scene_Battle.prototype.createEquipStatusWindow = function() {
    this._equipStatusWindow =
     new Window_TinyEquipStatus(0, this._helpWindow.height);
    this._equipStatusWindow.hide();
    this.addWindow(this._equipStatusWindow);
  };

  Scene_Battle.prototype.createEquipSlotWindow = function() {
    var wx = this._equipStatusWindow.width;
    var wy = this._helpWindow.height;
    var ww = Graphics.boxWidth - this._equipStatusWindow.width;
    var wh = this._equipStatusWindow.height;
    this._equipSlotWindow = new Window_TinyEquipSlot(wx, wy, ww, wh);
    this._equipSlotWindow.setHelpWindow(this._helpWindow);
    this._equipSlotWindow.setStatusWindow(this._equipStatusWindow);
    this._equipSlotWindow.setHandler('ok', this.onEquipSlotOk.bind(this));
    this._equipSlotWindow.setHandler('cancel',
     this.onEquipSlotCancel.bind(this));
    this._equipSlotWindow.hide();
    this.addWindow(this._equipSlotWindow);
  };

  Scene_Battle.prototype.createEquipItemWindow = function() {
    var wx = 0;
    var wy = this._equipStatusWindow.y + this._equipStatusWindow.height;
    var ww = Graphics.boxWidth;
    var wh = Graphics.boxHeight - wy - this._statusWindow.height;
    this._equipItemWindow = new Window_EquipItem(wx, wy, ww, wh);
    this._equipItemWindow.setHelpWindow(this._helpWindow);
    this._equipItemWindow.setStatusWindow(this._equipStatusWindow);
    this._equipItemWindow.setHandler('ok',     this.onEquipItemOk.bind(this));
    this._equipItemWindow.setHandler('cancel',
     this.onEquipItemCancel.bind(this));
    this._equipSlotWindow.setItemWindow(this._equipItemWindow);
    this._equipItemWindow.hide();
    this.addWindow(this._equipItemWindow);
  };

  //
  // add command to actor command window
  //
  var _Scene_Battle_createActorCommandWindow =
   Scene_Battle.prototype.createActorCommandWindow;
  Scene_Battle.prototype.createActorCommandWindow = function() {
    _Scene_Battle_createActorCommandWindow.call(this);
    this._actorCommandWindow.setHandler('equip', this.commandEquip.bind(this));
  };

  var _Window_ActorCommand_makeCommandList =
   Window_ActorCommand.prototype.makeCommandList;
  Window_ActorCommand.prototype.makeCommandList = function() {
    _Window_ActorCommand_makeCommandList.call(this);
    if (this._actor) {
      this.addEquipCommand();
    }
  };

  Window_ActorCommand.prototype.addEquipCommand = function() {
    this.addCommand(commandName, 'equip');
  };

  //
  // process handlers
  //
  Scene_Battle.prototype.refreshActor = function() {
    var actor = BattleManager.actor();
    this._equipStatusWindow.setActor(actor);
    this._equipSlotWindow.setActor(actor);
    this._equipItemWindow.setActor(actor);
  };

  Scene_Battle.prototype.commandEquip = function() {
    this.refreshActor();
    this._equipStatusWindow.show();
    this._equipItemWindow.refresh();
    this._equipItemWindow.show();
    this._equipSlotWindow.refresh();
    this._equipSlotWindow.show();
    this._equipSlotWindow.activate();
    this._equipSlotWindow.select(0);
  };

  Scene_Battle.prototype.onEquipSlotOk = function() {
    this._equipItemWindow.activate();
    this._equipItemWindow.select(0);
  };

  Scene_Battle.prototype.onEquipSlotCancel = function() {
    this._equipStatusWindow.hide();
    this._equipItemWindow.hide();
    this._equipSlotWindow.hide();
    this._actorCommandWindow.activate();
    this._actorCommandWindow.select(0);
  };

  Scene_Battle.prototype.onEquipItemOk = function() {
    SoundManager.playEquip();
    BattleManager.actor().changeEquip(this._equipSlotWindow.index(),
     this._equipItemWindow.item());
    this._equipSlotWindow.activate();
    this._equipSlotWindow.refresh();
    this._equipItemWindow.deselect();
    this._equipItemWindow.refresh();
    this._equipStatusWindow.refresh();
  };

  Scene_Battle.prototype.onEquipItemCancel = function() {
    this._equipSlotWindow.activate();
    this._equipItemWindow.deselect();
  };

})();
[/pre][/fold]

[fold=战斗背景滚动]7.战斗背景滚动

[pre lang="JavaScript" file="BattlebackScroll"]//=============================================================================
// BattlebackScroll.js
//=============================================================================

/*:
* @plugindesc 战斗背景(battlebacks1)自动滚动。
* @author Yoji Ojima
*
* @param Scroll X Variable ID
* @desc 选择变量ID,以改变该变量来控制横向滚动速度。
* @default 0
*
* @param Scroll Y Variable ID
* @desc 选择变量ID,以改变该变量来控制纵向滚动速度。
* @default 0
*
* @help 本插件不提供插件命令。
*/

/*:ja
* @plugindesc 戦闘背景(battlebacks1)を自動的にスクロールします。
* @author Yoji Ojima
*
* @param Scroll X Variable ID
* @desc 横スクロール速度を指定するための変数のIDです。
* @default 0
*
* @param Scroll Y Variable ID
* @desc 縦スクロール速度を指定するための変数のIDです。
* @default 0
*
* @help このプラグインには、プラグインコマンドはありません。
*/

(function() {

    var parameters = PluginManager.parameters('BattlebackScroll');
    var scrollXVariableId = Number(parameters['Scroll X Variable ID'] || 0);
    var scrollYVariableId = Number(parameters['Scroll Y Variable ID'] || 0);

    var _Spriteset_Battle_updateBattleback =
            Spriteset_Battle.prototype.updateBattleback;
    Spriteset_Battle.prototype.updateBattleback = function() {
        _Spriteset_Battle_updateBattleback.call(this);
        var scrollX = $gameVariables.value(scrollXVariableId);
        var scrollY = $gameVariables.value(scrollYVariableId);
        if (scrollX) {
            this._back1Sprite.origin.x += scrollX / 8;
        }
        if (scrollY) {
            this._back1Sprite.origin.y += scrollY / 8;
        }
    };

})();
[/pre][/fold]

[fold=战斗模式]8.战斗模式
[pre lang="JavaScript" file="Battle Mode"]//=============================================================================
// Battle Mode
// by Shaz
// Last Updated: 2015.10.21
//=============================================================================

/*:
* @plugindesc 允许在同一游戏中使用侧视图和前视图两种战斗模式。
* @author Shaz
*
* @help 本插件不提供插件命令。
*
* 队伍名称前缀为SV的敌人,以侧视图的方式战斗。
* 队伍名称前缀为FV的敌人,以前视图的方式战斗。
* 队伍名称前缀为RV的敌人,以随机的方式战斗。
* 没有前缀名称的敌人队伍,依照系统默认的方式战斗。
*
*/

(function() {
  var _Game_System_isSideView = Game_System.prototype.isSideView;
  Game_System.prototype.isSideView = function() {
    if ($gameParty.inBattle) {
      var sv = $gameTroop.isSideView();
      if (sv === null) {
        return _Game_System_isSideView.call(this);
      } else {
        return sv;
      }
    } else {
      return _Game_System_isSideView.call(this);
    }
  };

  var _Game_Troop_setup = Game_Troop.prototype.setup;
  Game_Troop.prototype.setup = function(troopId) {
    _Game_Troop_setup.call(this, troopId);

    if (this.troop().name.match(/^SV/)) {
      this._isSideView = true;
    } else if (this.troop().name.match(/^FV/)) {
      this._isSideView = false;
    } else if (this.troop().name.match(/^RV/)) {
      this._isSideView = Math.random() < 0.5;
    } else {
      this._isSideView = null;
    }
  };

  Game_Troop.prototype.isSideView = function() {
    return this._isSideView;
  };
})();
[/pre][/fold]

[fold=战斗结果窗口]9.战斗结果窗口
[pre lang="JavaScript" file="BattleResultsPopup"]//=============================================================================
// BattleResultsPopup.js
//=============================================================================

/*:
* @plugindesc 以窗口的形式显示战斗结果。
* @author Yoji Ojima
*
* @help 本插件不提供插件命令。
*/

/*:ja
* @plugindesc 戦闘結果の表示をポップアップ形式に変更します。
* @author Yoji Ojima
*
* @help このプラグインには、プラグインコマンドはありません。
*/

(function() {

    var resultDisplaying = 0;

    var _BattleManager_initMembers = BattleManager.initMembers;
    BattleManager.initMembers = function() {
        _BattleManager_initMembers.call(this);
        resultDisplaying = 0;
    };

    var _BattleManager_update = BattleManager.update;
    BattleManager.update = function() {
        _BattleManager_update.call(this);
        if (resultDisplaying > 0) {
            if (++resultDisplaying >= 60) {
                if (Input.isTriggered('ok') || TouchInput.isTriggered()) {
                    resultDisplaying = 0;
                }
            }
        }
    };

    var _BattleManager_isBusy = BattleManager.isBusy;
    BattleManager.isBusy = function() {
        return _BattleManager_isBusy.call(this) || resultDisplaying > 0;
    };

    BattleManager.displayVictoryMessage = function() {
    };

    BattleManager.displayRewards = function() {
        resultDisplaying = 1;
    };

    Game_Actor.prototype.shouldDisplayLevelUp = function() {
        return false;
    };

    var _Scene_Battle_update = Scene_Battle.prototype.update;
    Scene_Battle.prototype.update = function() {
        _Scene_Battle_update.call(this);
        if (resultDisplaying > 30 && !this._resultWindow) {
            this._resultWindow = new Window_BattleResults();
            this.addWindow(this._resultWindow);
        }
    };

    var _Scene_Battle_stop = Scene_Battle.prototype.stop;
    Scene_Battle.prototype.stop = function() {
        _Scene_Battle_stop.call(this);
        if (this._resultWindow) {
            this._resultWindow.close();
        }
    };

    function Window_BattleResults() {
        this.initialize.apply(this, arguments);
    }

    Window_BattleResults.prototype = Object.create(Window_Base.prototype);
    Window_BattleResults.prototype.constructor = Window_BattleResults;

    Window_BattleResults.prototype.initialize = function() {
        var rewards = BattleManager._rewards;
        var width = 400;
        var height = this.fittingHeight(Math.min(9, rewards.items.length + 1));
        var statusHeight = this.fittingHeight(4);
        var x = (Graphics.boxWidth - width) / 2;
        var y = (Graphics.boxHeight - statusHeight - height) / 2;
        Window_Base.prototype.initialize.call(this, x, y, width, height);
        this.refresh();
        this.openness = 0;
        this.open();
    };

    Window_BattleResults.prototype.refresh = function() {
        var x = this.textPadding();
        var y = 0;
        var width = this.contents.width;
        var lineHeight = this.lineHeight();
        var rewards = BattleManager._rewards;
        var items = rewards.items;
        this.contents.clear();

        this.resetTextColor();
        this.drawText(rewards.exp, x, y);
        x += this.textWidth(rewards.exp) + 6;
        this.changeTextColor(this.systemColor());
        this.drawText(TextManager.expA, x, y);
        x += this.textWidth(TextManager.expA + '  ');

        this.resetTextColor();
        this.drawText(rewards.gold, x, y);
        x += this.textWidth(rewards.gold) + 6;
        this.changeTextColor(this.systemColor());
        this.drawText(TextManager.currencyUnit, x, y);

        x = 0;
        y += lineHeight;

        items.forEach(function(item) {
            this.drawItemName(item, x, y, width);
            y += lineHeight;
        }, this);
    };

})();
[/pre][/fold]

温馨提示 暴力汉化 在除日语外所有环境下均使用汉语 如需保留英文版本 请自行备份。

插件汉化.rar

17.2 KB, 下载次数: 287

评分

参与人数 2星屑 +6 梦石 +1 收起 理由
余烬之中 + 1 搬运
grayuncle + 6

查看全部评分

梦石
0
星屑
1554
在线时间
523 小时
注册时间
2015-8-23
回帖
83
发表于 2015-10-30 12:14:16 | 显示全部楼层
支持支持~太感谢了
回复

使用道具 举报

梦石
0
星屑
451
在线时间
228 小时
注册时间
2015-2-23
回帖
233
发表于 2015-10-30 14:22:13 | 显示全部楼层
我来几个不重复的,就不另外发帖了,LZ可以等以后全了,收集到一起。

下面的文件解压后,把里面的JS文件复制到工程目录 js\plugins 文件夹里。

翻译这个确实有点累,特别是长篇幅的说明。

敌人图鉴.rar (2.79 KB, 下载次数: 229)
改变角色装备类型.rar (1.71 KB, 下载次数: 166)
公共事件选择.rar (1.79 KB, 下载次数: 182)
固定战斗人员.rar (884 Bytes, 下载次数: 166)
逃离地牢.rar (1.6 KB, 下载次数: 158)
武器所使用的技能设置.rar (1.51 KB, 下载次数: 3090)
制作XP特效,找我。
回复

使用道具 举报

梦石
0
星屑
80
在线时间
243 小时
注册时间
2007-2-10
回帖
46

开拓者

发表于 2015-10-30 14:46:34 | 显示全部楼层
应该保留原文,添加汉化,这样防止机翻出错可以自己对照一下

在注释开头插入“/*:”加上下面的语言代码可以将注释内容标注为相应的语言。例如,将代码标注为中文的注释就是:“/*:zh”。被标注为对应语言的代码只会在对应语言版本的RM编辑器中生效。未标注语言的部分(通常为英语)则作为默认语言显示。

点评

因为我的版本可以能破解过的缘故?中文语境好像不起作用……还是显示的英文  发表于 2015-10-30 15:06
。。。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
31 小时
注册时间
2015-10-26
回帖
23
发表于 2015-10-30 14:47:30 | 显示全部楼层
本帖最后由 zhangjiki 于 2015-10-30 14:50 编辑

浩大的工程,但愿有人能持之以恒的注解哦~我们这些非人类语言小白就靠你们了。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
26 小时
注册时间
2015-10-13
回帖
16
发表于 2015-10-30 18:00:23 | 显示全部楼层
66666233谢谢楼主
回复

使用道具 举报

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2015-10-30 20:04:05 | 显示全部楼层
支持楼主.
回复

使用道具 举报

梦石
0
星屑
1669
在线时间
230 小时
注册时间
2018-12-9
回帖
131
发表于 2023-4-18 19:53:25 | 显示全部楼层
感谢大佬分享
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部