Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Maliki's Dual Weilding/Two-Handed Weapons Combined MV/MZ Version
- // MalDualWieldVZ.js
- // version 1.5b MVMZ
- //=============================================================================
- /*:
- * @target MZ
- *
- * @plugindesc ver1.5b VZ - Allows you to set weapons as twohanded, disallowing you from equipping weapons to the Off-hand.
- * @author Maliki79
- *
- * @param MustUseMain
- * @desc Type 1 to force equips to be placed in Main hand before they can be placed in Off hand.
- * Default: 0
- * @default 0
- *
- * @param OffhandAdjust
- * @desc Percentage of stats offhand weapons add to actors. (Make the number lower than 100 to lower stats and higher to raise)
- * Default: 100
- * @default 100
- *
- * @param OffhandSlotName
- * @desc Name used for offhand weapon slot.
- * Default: Off-Hand
- * @default Off-Hand
- *
- * @param ShowTraitsInConsole
- * @desc Type 1 to show trait code,dataId and value data on console upon item equip.
- * Default: 0
- * @default 0
- *
- * @param PowerAdjustement0
- * @desc Amount of "weight" given to HP when determining strength of weapons as a percent.
- * Default: 100
- * @default 100
- *
- * @param PowerAdjustement1
- * @desc Amount of "weight" given to MP when determining strength of weapons as a percent.
- * Default: 100
- * @default 100
- *
- * @param PowerAdjustement2
- * @desc Amount of "weight" given to ATK when determining strength of weapons as a percent.
- * Default: 100
- * @default 100
- *
- * @param PowerAdjustement3
- * @desc Amount of "weight" given to DEF when determining strength of weapons as a percent.
- * Default: 100
- * @default 100
- *
- * @param PowerAdjustement4
- * @desc Amount of "weight" given to M.ATK when determining strength of weapons as a percent.
- * Default: 100
- * @default 100
- *
- * @param PowerAdjustement5
- * @desc Amount of "weight" given to M.DEF when determining strength of weapons as a percent.
- * Default: 100
- * @default 100
- *
- * @param PowerAdjustement6
- * @desc Amount of "weight" given to AGI when determining strength of weapons as a percent.
- * Default: 100
- * @default 100
- *
- * @param PowerAdjustement7
- * @desc Amount of "weight" given to LUK when determining strength of weapons as a percent.
- * Default: 100
- * @default 100
- *
- * @param PotentialPointsInShop
- * @desc Shows Equipment "Potential" as a point total in shops. Make this value 1 to enable, otherwise, the default calculations will be used.
- * Default: 1
- * @default 1
- *
- * @param 2H_DisableOtherSlot
- * @desc If 1, equipping a 2Handed Weapon will completely disable the other equip slot.
- * default: 0
- * @default 0
- *
- * @param Matched_Equip_Omit_Traits
- * @desc If 1, double equip traits will be the only plugin provided traits exhibited. Main and Sub traits will be omitted.
- * default: 0
- * @default 0
- *
- * @help You need two steps to use this plugin:
- * 1: Set your actor(s) up to have Dual-Wield in the Database. TRAITS => EQUIP => SLOT TYPE => DUAL WIELD
- * 2: Add the Notetag <twohand> to any two handed weapons in your Database.
- * 3: (Optional) For Off-hand only weapons, like shields, make them weapons in your database and add the tag <shld> or <offHWeapon> to their notes.
- * These weapons can only be equipped to the off-hand. Note that weapons tagged with <shld> will show up in your armor equipment category in the menu.
- * 3a: Conversly, if you tag a weapon with <mainWeaponOnly> , it will only be equippable on the main hand.
- * 4: (Optional) For one handed Actors you wish to equip shields that are considered weapons in the DB, tag <handnshld>
- * to the Actor's Class notes. (Those Actors still need to have the Dual Wield trait.)
- * 5: (Optional) An Actor's Class, Equips or State notes can be tagged with <monkeygrip> to allow two handed weapons to be dual wielded or allow a 2H weapon and shield.
- * 6: (Optional) You can tag any weapons with <OffhandAdjust: x> with x being a number. This will allow the specific weapon to use the given value instead of the default.
- * 6a: You can also tag states and actors with the same tag. Only one tag will be active. Priority will be given in this order:
- * Actors => States (lower numbered states first and only one) => Equip => Plugin Param
- * 7: (Optional) You can tag a weapon with <subweapon> so that it's basic attack animation will not be shown in battles when in the off hand.
- * 8: (Optional) You can tag a weapon with <mainweaponTrait: x, y, z>>> or <subweaponTrait: x, y, z>>> with x being the trait code, y being the dataId, and z being the value.
- * Weapons with the Mainweapon tag will exhibit those traits ONLY while in the main weapon slot while supweapon tagged weapons will exhibit
- * thier traits while in the off hand only. (NOTE the 3 >>> )
- * 9: (Optional) You can tag a weapon with <doubleGripTrait: x, y, z>>> with x being the trait code, y being the dataId, and z being the value.
- * When one tagged weapon is equipped and while the actor has the <doubleGrip> tag on either class notes or an applied state's notes,
- * the double grip traits will be applied to the actor.
- * 10:(Optional) You can tag Weapons or Armor with <PotentialP:Number> with Number being a whole number to assign a starting value to the Potential Point
- * calculations. Usful if things other than raw stats are used and will factor into the potential score of equipment in your project.
- * 11: (Optional) You can tag Weapons with <mdwEquipMismatch> to make it so the same weapon type cannot be equipped to both hands.
- *
- * Notes on main/sub/double-grip weapon traits:
- * Codes are the number representation of traits as they appear in the database.
- * Trait codes are listed below:
- * 11-TRAIT_ELEMENT_RATE 41-TRAIT_STYPE_ADD 61-TRAIT_ACTION_PLUS
- * 12-TRAIT_DEBUFF_RATE 42-TRAIT_STYPE_SEAL 62-TRAIT_SPECIAL_FLAG
- * 13-TRAIT_STATE_RATE 43-TRAIT_SKILL_ADD 63-TRAIT_COLLAPSE_TYPE
- * 14-TRAIT_STATE_RESIST 44-TRAIT_SKILL_SEAL 64-TRAIT_PARTY_ABILITY
- * 21-TRAIT_PARAM 51-TRAIT_EQUIP_WTYPE
- * 22-TRAIT_XPARAM 52-TRAIT_EQUIP_ATYPE
- * 23-TRAIT_SPARAM 53-TRAIT_EQUIP_LOCK
- * 31-TRAIT_ATTACK_ELEMENT 54-TRAIT_EQUIP_SEAL
- * 32-TRAIT_ATTACK_STATE 55-TRAIT_SLOT_TYPE
- * 33-TRAIT_ATTACK_SPEED
- * 34-TRAIT_ATTACK_TIMES
- *
- * DataId is the code's parameter. For example, if you wanted to add a boost to Atk power, you would use code: 21 and the dataId would be 2.
- * The numbers here can vary based on the quantity of things in your database and what code is being used.
- *
- * The value is the amount of the effect the code will express as a float. So, revisiting the above example, if you wanted attack to be raised by 20%,
- * you would use the value 1.2, which is 120%.
- * The final tag for this example would be: <subweaponTrait: 21, 2, 1.2>>>
- *
- * A method to assist with finding the code, dataId and value figures lies in the ShowTraitsInConsole param. Setting it to 1
- * will allow the console to print out an array of normal traits on an equipped item on the moment it is equipped.
- * (Press F12 to open the console by default.)
- * The array will list the traits in the order that they were added in the database. So if you need to know the values, just make a dummy/temp
- * equip with the traits you want and note what their values are via the console.
- * (Note that notetag related bonuses/traits/etc not provided by this plugin cannot be used here; Those traits will be active as stipulated in thier respective plugins.)
- *
- * A "potential" value has been introduced.
- * This value is a combination of the default stats of a weapon with differing user defined "weights" for each one.
- * This value is used mainly for the choosing of weapons when optimizing.
- *
- * A script call has been added to aid those wishing to know which equip slot is housing what equip type.
- * Using the script call $gameActors.isWeaponEquipped(type) will return a number based on the defined type
- * (type is the weapon type ID in the database.)
- * 0 if in the first equip slot,
- * 1 if it's in the second,
- * 2 if it's in both,
- * and -1 if in neither.
- * You can omit the type arguement and the function will return those numbers if there is ANY weapon is equipped in those slots.
- *
- * Equip Groups have been added!
- * Tag weapon equips and shield type armor equips with this tag in thier notes:
- *
- * <mdwEquipGroup: x> with x being an integer higher than 0.
- * If an equip has this tag, it will only be able to be dual wielded with other equips with the same group number.
- * <groupEquipTrait: x, y, z>>> Use this tag paired with setting an equip group. If two weapon equips with matching equip group sets
- * number are equipped together, the traits created will be exhibited.
- * Remember that a matching mdwEquipGroup tag MUST exist on the items for the trait to be seen.
- * <syncTrait: x, y, z>>> If two weapon equips are the same in the database, the traits created will be exhibited.
- * Using the plugin Param Matched_Equip_Omit_Traits, the only traits shown will be the double equip or sync traits.
- * Main or Sub weapon traits will not be used when those traits are active. (Other traits provided by different plugins and the database WILL
- * still be active.)
- *
- * Added Dual Groups. You can specify any number of groups to give specific sets of weapon equips traits.
- * First, add the equip to groups by adding this notetag:
- *
- * <duGroup: x>
- *
- * With x being any interger above 0.
- * You can add as many copies of this tag as you need to give a single equip multiple group numbers.
- * Then use the following notetag to assign traits to each group:
- *
- * <dualGroupTrait: a, x, y, z>>>
- *
- * Noting the extra a interger which will match one of your group numbers.
- * You can make a = 0 to make that trait activate whenever a group is formed.
- *
- * Now, if you equip two weapons with the same group number, those group triats will be added to the PC
- * (Again, the 0 group traits will also be added)
- * If you equip two of the same item, those traits will only be counted once.
- *
- * Note about param ShieldsArmor
- * The ShieldsArmor param allows devs to make it so offhand only weapons show up as armor in default item Menu.
- * For those that wish for some offhand weapons to remain in the Weapon category while still using the param,
- * use the notetag <offHWeapon> to create an exception and have that weapon show up in the weapon category.
- *
- * Conditional evals have been added to all trait notes!
- * You can add any javascript code that evals to true or false to allow for traits to be changed mid-game.
- * Just use the syntax noted above but adding the code between the Z and the >>>.
- * For example:
- *
- * <mainweaponTrait: 21, 2, 50, $gameParty.gold() > 500>>>
- *
- * This trait will only take effect while the party has more than 500 gold!
- * s[x] and v[x] can be used for switches and variables respectively.
- * Example <doubleGripTrait: x, y, z, actor.level > v[1]>>>
- * Example 2 <dualGroupTrait: a, x, y, z, $gameParty.numItems($dataItems[1] == 1)>>>
- *
- * Added Standard traits.
- *
- * <standardTrait: x, y, z, code>>>
- *
- * Will add the noted trait to weapons or armors.
- * (This one is basically just to add conditionals to standard traits.)
- *
- * The follow tags can be used on non-weapon equips:
- * syncTraits (If the currently equipped weapons are the same in the database, these traits will be used)
- * groupEquTraits (If the 2 currently equipped weapons AND the non-weapon equip share the same mdwEquipGroup number,
- * these traits will be used.)
- * doubleGripTraits (Same conditions as weapon traits.)
- * standardTraits (No outside conditions required)
- */
- var Mal = Mal || {};
- Mal.Parameters = PluginManager.parameters('MalDualWieldVZ');
- Mal.Param = Mal.Param || {};
- Mal.power = [];
- Mal.power.push(Number(Mal.Parameters['PowerAdjustement0']));
- Mal.power.push(Number(Mal.Parameters['PowerAdjustement1']));
- Mal.power.push(Number(Mal.Parameters['PowerAdjustement2']));
- Mal.power.push(Number(Mal.Parameters['PowerAdjustement3']));
- Mal.power.push(Number(Mal.Parameters['PowerAdjustement4']));
- Mal.power.push(Number(Mal.Parameters['PowerAdjustement5']));
- Mal.power.push(Number(Mal.Parameters['PowerAdjustement6']));
- Mal.power.push(Number(Mal.Parameters['PowerAdjustement7']));
- Mal.Par2HLock = Number((Mal.Parameters['2H_DisableOtherSlot']))
- var MalDualDatabaseLoad = DataManager.isDatabaseLoaded;
- DataManager.isDatabaseLoaded = function() {
- if (!MalDualDatabaseLoad.call(this)) return false;
- if (!DataManager._malDual_DatabaseLoaded) {
- this.processDualNotetags($dataWeapons);
- this.processDualNotetags($dataArmors);
- DataManager._malDual_DatabaseLoaded = true;
- }
- return true;
- };
- DataManager.processDualNotetags = function(group) {
- for (var n = 1; n < group.length; n++) {
- var obj = group[n];
- obj.mdwEquipGroup = -1;
- obj.syncNum = obj.id;
- obj.dualGroup = [];
- obj.dualGroupTraits = [];
- this.createDualTraits(obj);
- }
- };
- DataManager.createDualTraits = function(obj) {
- var traits = [];
- var noteread = obj.note;
- while(noteread.indexOf("mainweaponTrait") > -1)
- {
- var notereg = noteread.split("<mainweaponTrait: ");
- var match = notereg[1].split(">>>");
- match = match[0].split(", ");
- if (!!match[3]) {
- var code = (match[3].split(">>>"))[0];
- } else {
- var code = "true";
- }
- traits.push({"code": parseInt(match[0]), "dataId": parseInt(match[1]), "value": Number(match[2]), "dwEval": code});
- noteread = noteread.replace("<mainweaponTrait: ", " ");
- }
- obj.mainWTraits = traits;
- traits = [];
- while(noteread.indexOf("standardTrait") > -1)
- {
- var notereg = noteread.split("<standardTrait: ");
- var match = notereg[1].split(">>>");
- match = match[0].split(", ");
- if (!!match[3]) {
- var code = (match[3].split(">>>"))[0];
- } else {
- var code = "true";
- }
- traits.push({"code": parseInt(match[0]), "dataId": parseInt(match[1]), "value": Number(match[2]), "dwEval": code});
- noteread = noteread.replace("<standardTrait: ", " ");
- }
- obj.standardTraits = traits;
- traits = [];
- while(noteread.indexOf("subweaponTrait") > -1)
- {
- var notereg = noteread.split("<subweaponTrait: ");
- var match = notereg[1].split(">>>");
- match = match[0].split(", ");
- if (!!match[3]) {
- var code = (match[3].split(">>>"))[0];
- } else {
- var code = "true";
- }
- traits.push({"code": parseInt(match[0]), "dataId": parseInt(match[1]), "value": Number(match[2]), "dwEval": code});
- noteread = noteread.replace("<subweaponTrait: ", " ");
- }
- obj.subWTraits = traits;
- traits = [];
- while(noteread.indexOf("doubleGripTrait") > -1)
- {
- var notereg = noteread.split("<doubleGripTrait: ");
- var match = notereg[1].split(">>>");
- match = match[0].split(", ");
- if (!!match[3]) {
- var code = (match[3].split(">>>"))[0];
- } else {
- var code = "true";
- }
- traits.push({"code": parseInt(match[0]), "dataId": parseInt(match[1]), "value": Number(match[2]), "dwEval": code});
- noteread = noteread.replace("<doubleGripTrait: ", " ");
- }
- obj.doubleGripTraits = traits;
- traits = [];
- while(noteread.indexOf("groupEquipTrait") > -1)
- {
- var notereg = noteread.split("<groupEquipTrait: ");
- var match = notereg[1].split(">>>");
- match = match[0].split(", ");
- if (!!match[3]) {
- var code = (match[3].split(">>>"))[0];
- } else {
- var code = "true";
- }
- traits.push({"code": parseInt(match[0]), "dataId": parseInt(match[1]), "value": Number(match[2]), "dwEval": code});
- noteread = noteread.replace("<groupEquipTrait: ", " ");
- }
- obj.groupEquTraits = traits;
- traits = [];
- while(noteread.indexOf("syncTrait") > -1)
- {
- var notereg = noteread.split("<syncTrait: ");
- var match = notereg[1].split(">>>");
- match = match[0].split(", ");
- if (!!match[3]) {
- var code = (match[3].split(">>>"))[0];
- } else {
- var code = "true";
- }
- traits.push({"code": parseInt(match[0]), "dataId": parseInt(match[1]), "value": Number(match[2]), "dwEval": code});
- noteread = noteread.replace("<syncTrait: ", " ");
- }
- obj.syncTraits = traits;
- traits = [];
- while(noteread.indexOf("dualGroupTrait") > -1)
- {
- var notereg = noteread.split("<dualGroupTrait: ");
- var match = notereg[1].split(">>>");
- match = match[0].split(", ");
- var DSGroup = parseInt(match[0]);
- if (!!match[4]) {
- var code = (match[4].split(">>>"))[0];
- } else {
- var code = "true";
- }
- obj.dualGroupTraits[DSGroup] = obj.dualGroupTraits[DSGroup] || [];
- obj.dualGroupTraits[DSGroup].push({"code": parseInt(match[1]), "dataId": parseInt(match[2]), "value": Number(match[3]), "dwEval": code});
- noteread = noteread.replace("<dualGroupTrait: ", " ");
- }
- traits = [];
- while(noteread.indexOf("duGroup") > -1)
- {
- var match = noteread.split("<duGroup: ");
- var match2 = match[1].split(">");
- obj.dualGroup = obj.dualGroup || []
- obj.dualGroup.push(parseInt(match2[0]));
- noteread = noteread.replace("<duGroup: ", " ");
- }
- obj.PotentialP = 0;
- while(noteread.indexOf("<PotentialP:") > -1)
- {
- var notereg = noteread.split("<PotentialP: ");
- var match = notereg[1].split("> ");
- obj.PotentialP = parseInt(match[0]);
- noteread = noteread.replace("<PotentialP:", " ");
- };
- if(noteread.indexOf("mdwEquipGroup") > -1) {
- obj.mdwEquipGroup = Number(obj.meta.mdwEquipGroup);
- console.log(obj.mdwEquipGroup);
- }
- };
- var MalEquipChangeOK = Game_Actor.prototype.isEquipChangeOk
- Game_Actor.prototype.isEquipChangeOk = function(slotId) {
- if (this.twohanding > -1 && Mal.Par2HLock == 1) {
- if (this.twohanding == 0 && slotId == 1) return false;
- if (this.twohanding == 1 && slotId == 0) return false;
- }
- return MalEquipChangeOK.call(this, slotId);
- };
- var MalOnSlotOK = Scene_Equip.prototype.onItemOk
- Scene_Equip.prototype.onItemOk = function() {
- if (this._slotWindow.index() === 0 && !(this._itemWindow.item()) && (this._actor.equips()[1] && Mal.Parameters['MustUseMain'] == 1)) {
- SoundManager.playBuzzer();
- }else {
- SoundManager.playEquip();
- this.actor().changeEquip(this._slotWindow.index(), this._itemWindow.item());
- if (this._itemWindow.item() && Mal.Parameters['ShowTraitsInConsole'] == 1) console.log(this._itemWindow.item().traits);
- }
- this._slotWindow.activate();
- this._slotWindow.refresh();
- this._itemWindow.deselect();
- this._itemWindow.refresh();
- if(Utils.RPGMAKER_NAME === "MV"){
- if (typeof Yanfly !== "undefined" && Yanfly.Equip) this._itemWindow.hide(); //Added this for compatibility with YF's Equip Core
- this._statusWindow.refresh();
- }else{
- this._statusWindow.refresh();
- this._slotWindow.show();
- this._itemWindow.hide();
- this._slotWindow.select(this._slotWindow.index());
- }
- };
- Game_Actor.prototype.changeEquip = function(slotId, item) {
- if (this.tradeItemWithParty(item, this.equips()[slotId]) &&
- (!item || this.equipSlots()[slotId] === item.etypeId)) {
- this._equips[slotId].setObject(item);
- if (slotId == 0) {
- var slot = 1;
- } else {
- var slot = 0;
- }
- if (slotId < 2) {
- if (item && item.meta.twohand && !this.hasMonkeyGrip()) {
- this.tradeItemWithParty(null, this.equips()[slot])
- this._equips[slot].setObject(null);
- }
- if (item && this.equips()[slot] && this.equips()[slot].meta.twohand && !this.hasMonkeyGrip()){
- this.tradeItemWithParty(null, this.equips()[slot])
- this._equips[slot].setObject(null);
- }
- /* if (Mal.Parameters['MustUseMain'] == 1 && !this.equips()[0] && this.equips()[1]){
- if(!this.equips()[1].meta.shld) {
- this._equips[0].setObject(this.equips()[1]);
- this._equips[1].setObject(null);
- }
- }
- */
- }
- this.check2Hand();
- this.refresh();
- }
- };
- Game_Actor.prototype.check2Hand = function() {
- this.twohanding = -1;
- var equip = this.equips()[0];
- if (equip && equip.meta.twohand && !this.hasMonkeyGrip()) this.twohanding = 0;
- var equip2 = this.equips()[1];
- if (equip2 && equip2.meta.twohand && !this.hasMonkeyGrip()) this.twohanding = 1;
- };
- Game_Actor.prototype.checkMHand = function() {
- if (this.hasMonkeyGrip()) return;
- var equip = this.equips()[0];
- var equip2 = this.equips()[1];
- console.log(equip2);
- console.log(this._equips[1].isWeapon());
- if (equip && equip.meta.twohand && (this._equips[1].isWeapon() || this._equips[1].isArmor())) this._equips[1].setObject(null);
- if (equip2 && equip2.meta.twohand && (this._equips[0].isWeapon() || this._equips[0].isArmor())) this._equips[0].setObject(null);
- };
- Game_Actor.prototype.forceChangeEquip = function(slotId, item) {
- if (item) {
- this._equips[slotId].setObject(item);
- if (slotId == 0) {
- var slot = 1;
- } else {
- var slot = 0;
- }
- if (slotId < 2) {
- if (item && item.meta.twohand && !this.hasMonkeyGrip()) {
- this._equips[slot].setObject(null);
- }
- if (item && this.equips()[slot] && this.equips()[slot].meta.twohand && !this.hasMonkeyGrip()){
- this._equips[slot].setObject(null);
- }
- if (Mal.Parameters['MustUseMain'] == 1 && !this.equips()[0] && this.equips()[1]){
- //this._equips[0].setObject(this.equips()[1]);
- //this._equips[1].setObject(null);
- this.tradeItemWithParty(null, this.equips()[1]);
- }
- }
- } else {
- this._equips[slotId].setObject(null);
- }
- this.releaseUnequippableItems(true);
- this.check2Hand();
- this.refresh();
- };
- var MalreleaseUnEI = Game_Actor.prototype.releaseUnequippableItems;
- Game_Actor.prototype.releaseUnequippableItems = function(forcing) {
- MalreleaseUnEI.call(this, forcing);
- this.check2Hand();
- this.checkMHand();
- };
- var MalEquip = Window_EquipItem.prototype.includes
- Window_EquipItem.prototype.includes = function(item) {
- if (item === null) {
- if (this._slotId === 0 && (this._actor.equips()[1] && Mal.Parameters['MustUseMain'] == 1)){
- return;
- } else {
- return true;
- }}
- if (this._slotId === 0 && (item.meta.shld || item.meta.offHWeapon) && this._actor.hasMonkeyGrip()) {
- return this._actor.canEquip(item);
- }
- if (this._slotId === 0 && (item.meta.shld || item.meta.offHWeapon)) {
- return false;
- }
- if (this._slotId === 1 && !(item.meta.shld || item.meta.offHWeapon) && this._actor.currentClass().meta.handnshld) {
- return false;
- }
- if (this._slotId === 1 && !(this._actor.equips()[0]) && Mal.Parameters['MustUseMain'] == 1 ) {
- return false;
- }
- if (this._slotId === 1 && item.meta.mainWeaponOnly) {
- return false;
- }
- if (this._slotId < 0 || item.etypeId !== this._actor.equipSlots()[this._slotId]) {
- return false;
- }
- if (this._slotId === 0 && this._actor.equips()[1] && item.mdwEquipGroup != this._actor.equips()[1].mdwEquipGroup) return false;
- if (this._slotId === 1 && this._actor.equips()[0] && item.mdwEquipGroup != this._actor.equips()[0].mdwEquipGroup) return false;
- if (this._slotId === 0 && this._actor.equips()[1] && (item.meta.mdwEquipMismatch || this._actor.equips()[1].meta.mdwEquipMismatch) && (item.wtypeId == this._actor.equips()[1].wtypeId)) return false;
- if (this._slotId === 1 && this._actor.equips()[0] && (item.meta.mdwEquipMismatch || this._actor.equips()[0].meta.mdwEquipMismatch) && (item.wtypeId == this._actor.equips()[0].wtypeId)) return false;
- return this._actor.canEquip(item);
- };
- Game_Actor.prototype.optimizeEquipments = function() {
- var maxSlots = this.equipSlots().length;
- this.clearEquipments();
- this.setWeapons();
- for (var i = 2; i < maxSlots; i++) {
- if (this.isEquipChangeOk(i)) {
- this.changeEquip(i, this.bestEquipItem(i));
- }
- }
- };
- Game_Actor.prototype.setWeapons = function() {
- var mode = 1;
- if (this.currentClass().meta.handnshld) mode = 2;
- if (this.hasMonkeyGrip()) mode = 3;
- //First weapon selection
- if (mode == 1 || mode == 2) {
- var items = $gameParty.equipItems().filter(function(item) {
- return item.etypeId === 1 && this.canEquip(item) && !this.equipIsOffhand(item);
- }, this);
- }
- if (mode == 3) {
- var items = $gameParty.equipItems().filter(function(item) {
- return item.etypeId === 1 && this.canEquip(item);
- }, this);
- }
- var mainW1 = this.bestEquipW(items);
- //End first weapon
- //Second Weapon Selection (First sub)
- if (mode == 1) {
- var newItems = $gameParty.equipItems().filter(function(item) {
- return item.etypeId === 1 && this.canEquip(item) && !(item == mainW1 && $gameParty.oneOfAKind(mainW1)) && !(item.wtypeId == mainW1.wtypeId && $gameParty.misMatched(mainW1, item)) && !item.meta.twohand && !item.meta.mainWeaponOnly;
- }, this);
- }
- if (mode == 2) {
- var newItems = $gameParty.equipItems().filter(function(item) {
- return item.etypeId === 1 && this.canEquip(item) && !(item == mainW1 && $gameParty.oneOfAKind(mainW1)) && !item.meta.twohand && this.equipIsOffhand(item) && !item.meta.mainWeaponOnly && !(item.wtypeId == mainW1.wtypeId && $gameParty.misMatched(mainW1, item));
- }, this);
- }
- if (mode == 3) {
- var newItems = $gameParty.equipItems().filter(function(item) {
- return item.etypeId === 1 && this.canEquip(item) && !(item == mainW1 && $gameParty.oneOfAKind(mainW1));
- }, this);
- }
- var subW1 = this.bestEquipW(newItems);
- //End Second
- //Third weapon selection (Second Main)
- var subW2 = null;
- if (mode == 1 || mode == 2) {
- items = $gameParty.equipItems().filter(function(item) {
- return item.etypeId === 1 && this.canEquip(item) && !this.equipIsOffhand(item) && !item.meta.twohand && !(item == mainW1 && $gameParty.oneOfAKind(mainW1)) && !(item == subW1 && $gameParty.oneOfAKind(subW1));
- }, this);
- var subW2 = this.bestEquipW(items);
- }
- //End Third
- if (subW2 !== null) {
- if(this.potential(mainW1) > this.potential(subW1) + this.potential(subW2)) {
- if (this.isEquipChangeOk(0)) this.changeEquip(0, mainW1);
- if (!mainW1.meta.twohand) this.changeEquip(1, subW2);
- } else {
- if (this.isEquipChangeOk(0)) this.changeEquip(0, subW2);
- if (this.isEquipChangeOk(1) && subW1 && (subW2.mdwEquipGroup == subW1.mdwEquipGroup)) this.changeEquip(1, subW1);
- }
- } else {
- if (this.isEquipChangeOk(0)) this.changeEquip(0, mainW1);
- if (this.isEquipChangeOk(1) && subW1 && (mainW1.mdwEquipGroup == subW1.mdwEquipGroup)) this.changeEquip(1, subW1);
- }
- }
- Game_Party.prototype.oneOfAKind = function (item) {
- if(this.numItems(item) == 1) return true;
- return false;
- };
- Game_Party.prototype.misMatched = function (item1, item2) {
- if(!item1 || !item2) return false;
- if(item1.meta.mdwEquipMismatch || item2.meta.mdwEquipMismatch) return true;
- return false;
- };
- Game_Actor.prototype.bestEquipW = function(itemSet) {
- var items = itemSet;
- var bestItem = null;
- var bestPerformance = -1000;
- for (var i = 0; i < items.length; i++) {
- var performance = this.potential(items[i]);
- if (performance > bestPerformance) {
- bestPerformance = performance;
- bestItem = items[i];
- }
- }
- return bestItem;
- };
- var MalBestEquip = Game_Actor.prototype.bestEquipItem
- Game_Actor.prototype.bestEquipItem = function(slotId) {
- const etypeId = this.equipSlots()[slotId];
- const items = $gameParty
- .equipItems()
- .filter(item => item.etypeId === etypeId && this.canEquip(item));
- let bestItem = null;
- let bestPerformance = -1000;
- for (let i = 0; i < items.length; i++) {
- //const performance = this.calcEquipItemPerformance(items[i]);
- const performance = this.potential(items[i]);
- if (performance > bestPerformance) {
- bestPerformance = performance;
- bestItem = items[i];
- }
- }
- return bestItem;
- };
- Game_Actor.prototype.potential = function(item) {
- if (!item) return -1001;
- var potent = item.PotentialP;
- var potent2 = Number(item.params.reduce((a, b) => a + b));
- return potent + potent2;
- };
- if(Utils.RPGMAKER_NAME === "MV"){
- //Addition for shop scene (MV Only)
- var malShop_drawParamChange = Window_ShopStatus.prototype.drawActorParamChange;
- Window_ShopStatus.prototype.drawActorParamChange = function(x, y, actor, item1) {
- if (Mal.Parameters['PotentialPointsInShop'] == 1) {
- var width = this.contents.width - this.textPadding() - x;
- var change = this.potential(this._item) - (item1 ? this.potential(item1) : 0);
- this.changeTextColor(this.paramchangeTextColor(change));
- this.drawText((change > 0 ? '+' : '') + change, x, y, width, 'right');
- } else {
- malShop_drawParamChange.call(this, x, y, actor, item1);
- }
- };
- Window_ShopStatus.prototype.potential = function(item) {
- if (item === null) return 0;
- var potent = item.meta.PotentialP || 0;
- for (var i = 0; i < 8; i++) {
- potent += item.params[i] * (Mal.power[i] / 100);
- }
- potent = Math.round(potent);
- return potent;
- };
- //End Shop Scene
- var MalSlotName = Window_EquipSlot.prototype.slotName
- Window_EquipSlot.prototype.slotName = function(index) {
- var slots = this._actor.equipSlots();
- if (index === 1 && this._actor.isDualWield()) return this._actor ? Mal.Parameters['OffhandSlotName'] : '';
- return this._actor ? $dataSystem.equipTypes[slots[index]] : '';
- };
- var MalDrawItem = Window_ItemList.prototype.drawItem //MV
- Window_ItemList.prototype.drawItem = function(index) {
- var item = this._data[index];
- var setting = 0;
- if (typeof Window_AugmentItemList != "undefined") {
- if (this instanceof Window_AugmentItemList) setting++;
- }
- if (item) {
- var numberWidth = this.numberWidth();
- var rect = this.itemRect(index);
- rect.width -= this.textPadding();
- this.changePaintOpacity(this.isEnabled(item));
- this.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
- this.drawItemNumber(item, rect.x, rect.y, rect.width);
- this.changePaintOpacity(1);
- } else {
- var numberWidth = this.numberWidth();
- var rect = this.itemRect(index);
- rect.width -= this.textPadding();
- if (setting == 0) this.drawText('-UNEQUIP-', rect.x, rect.y, rect.width - numberWidth);
- }
- };
- Window_ShopStatus.prototype.initialize = function(x, y, width, height) {
- Window_Base.prototype.initialize.call(this, x, y, width, height);
- this._item = null;
- this._maxCharPages = null;
- this._characterPage = this.setupCharPages();
- this._pageIndex = 0;
- this.refresh();
- };
- Window_ShopStatus.prototype.setupCharPages = function() {
- if (this._maxCharPages === null) {
- var count = this.statusMembers().length;
- if (count < 2) return -2;
- this._maxCharPages = count - 1;
- this._cursorFixed = false;
- return -1;
- }
- };
- Window_ShopStatus.prototype.refresh = function() {
- this.contents.clear();
- this._cursorFixed = true;
- if (!this._maxCharPages) this._characterPage = this.setupCharPages();
- if (this._item) {
- var x = this.textPadding();
- this.drawPossession(x, 0);
- if (this.isEquipItem()) {
- this.drawEquipInfo(x, this.lineHeight() * 2);
- }
- }
- };
- Window_ShopStatus.prototype.updatePage = function() {
- if (this.isPageChangeEnabled() && this.isPageChangeRequested()) {
- this.changePage();
- }
- if (this.isCharPageChangeEnabled() && this.isCharPageChangeRequested()) {
- if (Input.isTriggered('left')) {
- this.changeCharPage("L");
- } else {
- this.changeCharPage("R");
- }
- this.refresh();
- }
- };
- Window_ShopStatus.prototype.isCharPageChangeEnabled = function() {
- return (this._characterPage != -2 && this.visible && this.isEquipItem());
- };
- Window_ShopStatus.prototype.isCharPageChangeRequested = function() {
- if (Input.isTriggered('left') || Input.isTriggered('right')) {
- return true;
- }
- if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
- return true;
- }
- return false;
- };
- Window_ShopStatus.prototype.changeCharPage = function (dir) {
- var code = 1;
- SoundManager.playCursor();
- if (dir === "L") code = 0;
- if(code == 0) {
- this._characterPage--;
- if(this._characterPage == -2) this._characterPage = this._maxCharPages;
- }
- if(code == 1) {
- this._characterPage++;
- if(this._characterPage > this._maxCharPages) this._characterPage = -1;
- }
- this.refresh();
- };
- Window_ShopStatus.prototype.drawEquipInfo = function(x, y) {
- var members = this.statusMembers();
- if(this._characterPage == -2) {
- this.drawActorEquipInfoSingle(x, y + this.lineHeight() * (0 * 2.4), members[0]);
- } else if (this._characterPage == -1){
- for (var i = 0; i < members.length; i++) {
- this.drawActorEquipInfo(x, y + this.lineHeight() * (i * 2.4), members[i]);
- }
- } else this.drawActorEquipInfoSingle(x, y + this.lineHeight() * (0 * 2.4), members[this._characterPage]);
- };
- Window_ShopStatus.prototype.drawActorEquipInfoSingle = function(x, y, actor) {
- var enabled = actor.canEquip(this._item);
- var paramHeight = 0;
- this.changePaintOpacity(enabled);
- this.resetTextColor();
- this.drawText(actor.name(), x, y, 168);
- var item1 = this.currentEquippedItem(actor, this._item.etypeId);
- if (enabled) {
- paramHeight = this.drawActorParamChangeSingle(x, y, actor, item1);
- }
- this.drawItemName(item1, x, y + (paramHeight || this.lineHeight()));
- this.changePaintOpacity(true);
- };
- Window_ShopStatus.prototype.drawActorParamChangeSingle = function(x, y, actor, item1) {
- var width = this.contents.width - this.textPadding() - x;
- var change = 0;
- var lines = 0;
- var actorParam = 0;
- var paramName = ['MHP', 'MMP', 'ATK', 'DEF', 'MAT', 'MDF', 'AGI', 'LUK'];
- for (var id = 0; id < paramName.length; id++) {
- change = this._item.params[id] - (item1 ? item1.params[id] : 0);
- if (item1) {
- if (this.doublewielding(actor) && DataManager.isWeapon(item1)) {
- if(item1 === actor.equips()[0]) var item2 = actor.equips()[1];
- if(item1 === actor.equips()[1]) var item2 = actor.equips()[0];
- }
- if(this._item.meta.twohand && item2) change -= item2.params[id];
- if (item1.etypeId !== this._item.etypeId && item1.id !== this._item.id) {
- actorParam = this._item.params[id] > 0 ? actor.param(id) - this._item.params[id] : actor.param(id) + this._item.params[id];
- } else {
- actorParam = actor.param(id);
- }
- } else {
- actorParam = actor.param(id);
- }
- this.changeTextColor(this.paramchangeTextColor(change));
- if (change == 0) {
- this.drawText((change > 0 ? '+' : '') + ' ' + ' ' + paramName[id] + ' ' + (actorParam + change), x, y + lines, width, 'right');
- } else {
- this.drawText((change > 0 ? '+' : '') + change + ' ' + paramName[id] + ' ' + (actorParam + change), x, y + lines, width, 'right');
- };
- lines += this.lineHeight();
- }
- return lines;
- };
- Window_ShopStatus.prototype.currentEquippedItem = function(actor, etypeId) {
- var list = [];
- var equips = actor.equips();
- var slots = actor.equipSlots();
- for (var i = 0; i < slots.length; i++) {
- if (slots[i] === etypeId) {
- if (i < 2 && actor.hasMonkeyGrip()) {
- list.push(equips[i]);
- } else {
- if (i == 0 && !this.ignoreWeap1(actor)) list.push(equips[i]);
- if (i == 1 && !this.ignoreWeap2(actor)) list.push(equips[i]);
- }
- if (i >= 2) list.push(equips[i]);
- }
- }
- var paramId = this.paramId();
- var worstParam = Number.MAX_VALUE;
- var worstItem = null;
- for (var j = 0; j < list.length; j++) {
- if (!list[j]) {
- return null;
- }
- if (list[j] && list[j].params[paramId] < worstParam) {
- worstParam = list[j].params[paramId];
- worstItem = list[j];
- }
- }
- return worstItem;
- };
- Window_ShopStatus.prototype.ignoreWeap1 = function (actor) {
- if (this._item.meta.twohand && !actor.equips()[0]) return true;
- if ((this._item.meta.shld || this._item.meta.offHWeapon)&& !this.dualwielding(actor)) return true;
- if ((this._item.meta.shld || this._item.meta.offHWeapon) && actor.equips()[1] && (actor.equips()[1].meta.shld || actor.equips()[1].meta.offHWeapon)) return true;
- if (this.dualwielding(actor) && !actor.equips()[0]) return true;
- return false;
- };
- Window_ShopStatus.prototype.ignoreWeap2 = function (actor) {
- if (!actor.equips()[0]) return false;
- if (this.dualwielding(actor)) return true;
- if (this._item.meta.mainWeaponOnly) return true
- if (this._item.meta.twohand && actor.equips()[0] && !actor.equips()[0].meta.twohand) return true;
- return false;
- };
- Window_ShopStatus.prototype.dualwielding = function (actor) {
- if(actor.equips()[0] && actor.equips()[0].meta.twohand) return true;
- if(actor.equips()[1] && actor.equips()[1].meta.twohand) return true;
- return false;
- };
- Window_ShopStatus.prototype.doublewielding = function (actor) {
- if(actor.equips()[0] && actor.equips()[1]) return true;
- return false;
- };
- var MalDualBuyWindow = Scene_Shop.prototype.createBuyWindow
- Scene_Shop.prototype.createBuyWindow = function() {
- MalDualBuyWindow.call(this);
- this._buyWindow.setHandler('left', this.cycleLeft.bind(this));
- this._buyWindow.setHandler('Menu', this.cycleRight.bind(this));
- };
- Scene_Shop.prototype.cycleLeft = function () {
- this._statusWindow.changeCharPage("L");
- };
- Scene_Shop.prototype.cycleRight = function () {
- this._statusWindow.changeCharPage("R");
- };
- } else {
- var MalSlotName = Window_StatusBase.prototype.actorSlotName
- Window_StatusBase.prototype.actorSlotName = function(actor, index) {
- var slots = this._actor.equipSlots();
- if (index === 1 && this._actor.isDualWield()) return this._actor ? Mal.Parameters['OffhandSlotName'] : '';
- return $dataSystem.equipTypes[slots[index]];
- };
- };
- if(Utils.RPGMAKER_NAME === "MZ") {
- Window_EquipItem.prototype.drawItemName = function(item, x, y, width) {
- if (item) {
- const iconY = y + (this.lineHeight() - ImageManager.iconHeight) / 2;
- const textMargin = ImageManager.iconWidth + 4;
- const itemWidth = Math.max(0, width - textMargin);
- this.resetTextColor();
- this.drawIcon(item.iconIndex, x, iconY);
- this.drawText(item.name, x + textMargin, y, itemWidth);
- } else {
- const iconY = y + (this.lineHeight() - ImageManager.iconHeight) / 2;
- const textMargin = ImageManager.iconWidth + 4;
- const itemWidth = Math.max(0, width - textMargin);
- this.resetTextColor();
- //this.drawIcon(item.iconIndex, x, iconY);
- this.drawText("-Butter-", x + textMargin, y, itemWidth);
- }
- };
- };
- var MalItemList = Window_ItemList.prototype.includes
- Window_ItemList.prototype.includes = function(item) {
- switch (this._category) {
- case 'item':
- return DataManager.isItem(item) && item.itypeId === 1;
- case 'weapon':
- return DataManager.isWeapon(item) && (!item.meta.shld);
- case 'armor':
- return DataManager.isArmor(item) || (item && item.meta.shld);
- case 'keyItem':
- return DataManager.isItem(item) && item.itypeId === 2;
- default:
- return false;
- }
- };
- var MalparamPlus = Game_Actor.prototype.paramPlus
- Game_Actor.prototype.paramPlus = function(paramId) {
- var value = MalparamPlus.call(this, paramId);
- var subValue = 0;
- var equips = this.equips();
- for (var i = 0; i < equips.length; i++) {
- var item = equips[i];
- if (item) {
- if (i == 1) {
- value -= item.params[paramId];
- subValue = this.offhandAdjust(item.params[paramId], item);
- }
- }
- }
- return value + subValue;
- };
- Game_Actor.prototype.offhandAdjust = function(value, item) {
- var value = value;
- var item = item;
- var adjust = Number(Mal.Parameters['OffhandAdjust']);
- if (item.meta.OffhandAdjust) adjust = Number(item.meta.OffhandAdjust);
- for (var i = 0; i < this.states().length; i++) {
- var state = this.states()[i].id;
- if ($dataStates[state].meta.OffhandAdjust) {
- adjust = Number($dataStates[state].meta.OffhandAdjust);
- break;
- };
- };
- //console.log(this);
- if ($dataActors[this._actorId].meta.OffhandAdjust) adjust = Number($dataActors[this._actorId].meta.OffhandAdjust);
- return Math.floor(value * adjust / 100.0);
- };
- Game_Actor.prototype.performAttack = function() {
- var weapons = this.weapons();
- var wtypeChId = -1;
- if (weapons[0] && weapons[1] && weapons[0].meta.subweapon) {
- wtypeChId = weapons[1].wtypeId;
- } else {
- wtypeChId = weapons[0] ? weapons[0].wtypeId : 0;
- }
- var wtypeId = wtypeChId;
- var attackMotion = $dataSystem.attackMotions[wtypeId];
- if (attackMotion) {
- if (attackMotion.type === 0) {
- this.requestMotion("thrust");
- } else if (attackMotion.type === 1) {
- this.requestMotion("swing");
- } else if (attackMotion.type === 2) {
- this.requestMotion("missile");
- }
- this.startWeaponAnimation(attackMotion.weaponImageId);
- }
- };
- Game_Actor.prototype.attackAnimationId1 = function() {
- if (this.hasNoWeapons()) {
- return this.bareHandsAnimationId();
- } else {
- var weapons = this.weapons();
- var aniSet = weapons[0] ? weapons[0].animationId : 0;
- if (weapons[0] && weapons[1] && weapons[0].meta.subweapon && !weapons[1].meta.subweapon) aniSet = weapons[1] ? weapons[1].animationId : 0;
- return aniSet;
- }
- };
- Game_Actor.prototype.attackAnimationId2 = function() {
- var weapons = this.weapons();
- var aniSet = weapons[1] ? weapons[1].animationId : 0;
- if (weapons[0] && weapons[1] && weapons[1].meta.subweapon) aniSet = 0;
- if (weapons[0] && weapons[1] && weapons[0].meta.subweapon) aniSet = 0;
- return aniSet;
- };
- var MalGame_Actor_allTraits = Game_Actor.prototype.allTraits;
- Game_Actor.prototype.allTraits = function() {
- var traits = MalGame_Actor_allTraits.call(this);
- var equips = this.equips();
- var dualFlag = false;
- if (this.useDuoTrait()) {
- var dGrp1 = equips[0].dualGroup;
- var dGrp2 = equips[1].dualGroup;
- for (var i = 0; i < dGrp1.length; i++) {
- var point = dGrp1[i];
- if (dGrp2.contains(point)) {
- if(equips[0].dualGroupTraits[point]) {
- traits = traits.concat(this.traitEval(equips[0].dualGroupTraits[point]));
- dualFlag = true;
- }
- if(equips[1].dualGroupTraits[point]) {
- if (equips[0].syncNum == equips[1].syncNum) continue;
- traits = traits.concat(this.traitEval(equips[1].dualGroupTraits[point]));
- dualFlag = true;
- }
- }
- if(equips[0].dualGroupTraits[0]) {
- traits = traits.concat(this.traitEval(equips[0].dualGroupTraits[0]));
- dualFlag = true;
- }
- if(equips[1].dualGroupTraits[0]) {
- if (equips[0].syncNum == equips[1].syncNum) continue;
- traits = traits.concat(this.traitEval(equips[1].dualGroupTraits[0]));
- dualFlag = true;
- }
- }
- }
- for (var i = 0; i < equips.length; i++) {
- var item = equips[i];
- if(item) {
- if (i == 0 && item.mainWTraits) traits = traits.concat(this.traitEval(item.mainWTraits));
- if (i == 1 && item.subWTraits) traits = traits.concat(this.traitEval(item.subWTraits));
- if (item.doubleGripTraits && this.isDoubleGripping()) traits = traits.concat(this.traitEval(item.doubleGripTraits));
- if (item.standardTraits) traits = traits.concat(this.traitEval(item.standardTraits));
- if (i == 0 && item.syncTraits && this.useSyncTrait()) traits = traits.concat(this.traitEval(item.syncTraits));
- if (i == 0 && this.hasMatchedEquip() && item.groupEquTraits) traits = traits.concat(this.traitEval(item.groupEquTraits));
- if (Mal.Parameters['Matched_Equip_Omit_Traits'] == 1 && i == 1 && this.isSameWeapon()) continue;
- if (i == 1 && item.syncTraits && this.useSyncTrait()) traits = traits.concat(this.traitEval(item.syncTraits));
- if (i == 1 && this.hasMatchedEquip() && item.groupEquTraits) traits = traits.concat(this.traitEval(item.groupEquTraits));
- if (i > 1) {
- if(this.hasMatchedEquip() && item.groupEquTraits && item.mdwEquipGroup == equips[0].mdwEquipGroup) traits = traits.concat(this.traitEval(item.groupEquTraits));
- if(this.useSyncTrait() && item.syncTraits) traits = traits.concat(this.traitEval(item.syncTraits));
- }
- }
- }
- return traits;
- };
- Game_Actor.prototype.traitEval = function(traitSet) {
- var origSet = traitSet;
- var newSet = [];
- var actor = this;
- var s = $gameSwitches._data;
- var v = $gameVariables._data;
- for (var i = 0; i < origSet.length; i++) {
- var trait = origSet[i];
- var check = Function("var actor = $gameTemp.actor; var equip = $gameTemp.equip; var s = $gameSwitches._data; var v = $gameVariables._data; return " + trait.dwEval);
- if(check) newSet.push(trait);
- }
- return newSet;
- };
- Game_Actor.prototype.hasMatchedEquip = function() {
- var equips = this.equips();
- if (!equips[0] || !equips[1]) return false;
- if (equips[0] && equips[0].mdwEquipGroup == -1) return false;
- if (equips[1] && equips[1].mdwEquipGroup == -1) return false;
- return (equips[0].mdwEquipGroup == equips[1].mdwEquipGroup);
- return false;
- };
- Game_Actor.prototype.useSyncTrait = function() {
- var equips = this.equips();
- return (((equips[0] && equips[1])) && (equips[0].syncNum == equips[1].syncNum));
- return false;
- };
- Game_Actor.prototype.useDuoTrait = function() {
- var equips = this.equips();
- return ((equips[0] && equips[0].dualGroup != []) && (equips[1] && equips[1].dualGroup != []));
- return false;
- };
- Game_Actor.prototype.isSameWeapon = function() {
- var equips = this.equips();
- if (equips[0] && equips[1]) return (equips[0].syncNum == equips[1].syncNum);
- return false;
- };
- Game_Actor.prototype.isDoubleGripping = function() {
- var equips = this.equips();
- return (this.hasDoubleGrip() && ((equips[0] && !equips[1]) || (equips[1] && !equips[0])));
- };
- Game_Actor.prototype.hasDoubleGrip = function() {
- if (this.currentClass().note.indexOf("<doubleGrip>") > -1) return true;
- var equips = this.equips();
- for (var i = 0; i < equips.length; i++) {
- if (equips[i] && equips[i].note.indexOf("<doubleGrip>") > -1) return true;
- }
- var states = this.states();
- for (var i = 0; i < states.length; i++) {
- if (states[i].note.indexOf("<doubleGrip>") > -1) return true;
- }
- if (this._passiveSkills && this._passiveSkills != []){
- var passives = this._passiveSkills;
- for (var i = 0; i < passives.length; i++) {
- if ($dataSkills[passives[i]].meta.doubleGrip) return true;
- }
- }
- return false;
- }
- Game_Actor.prototype.hasMonkeyGrip = function() {
- if (this.currentClass().note.indexOf("<monkeygrip>") > -1) return true;
- var equips = this.equips();
- for (var i = 0; i < equips.length; i++) {
- if (equips[i] && equips[i].note.indexOf("<monkeygrip>") > -1) return true;
- }
- var states = this.states();
- for (var i = 0; i < states.length; i++) {
- if (states[i].note.indexOf("<monkeygrip>") > -1) return true;
- }
- if (this._passiveSkills && this._passiveSkills != []){
- var passives = this._passiveSkills;
- for (var i = 0; i < passives.length; i++) {
- if ($dataSkills[passives[i]].meta.monkeygrip) return true;
- }
- }
- return false;
- }
- Game_Actor.prototype.isWeaponEquipped = function(type) {
- if (type) {
- var type = Number(type);
- } else {
- var type = 0;
- }
- if (type == 0){
- if (this.equips()[0]) {
- if (this.equips()[1]) return 2;
- return 0;
- }
- if (this.equips()[1]) return 1;
- return -1;
- } else {
- if (this.equips()[0] && this.equips()[0].wtypeId == type) {
- if (this.equips()[1] && this.equips()[1].wtypeId == type) return 2;
- return 0;
- }
- if (this.equips()[1] && this.equips()[1].wtypeId == type) return 1;
- return -1;
- }
- };
- Game_Enemy.prototype.isWeaponEquipped = function(type) {
- return -1;
- };
- Game_Actor.prototype.equipIsOffhand = function(item) {
- if (item.meta.shld || item.meta.offHWeapon) return true;
- return false;
- };
Add Comment
Please, Sign In to add comment