Vai al contenuto

Rilevato Ad-Blocker. Per favore disabilita il tuo adblocker quando navighi su makerando.com - Non c'è nessun annuncio invasivo.

  • Chatbox

    You don't have permission to chat.
    Load More
Kyusef

RPGMAKER MV Aiuto per il settaggio di un plug in

Recommended Posts

Salve a tutti, avrei bisogno di un aiuto per settare il plug in "Unison Item" di DoubleX.

 

/*============================================================================
* ## Plugin Info
*----------------------------------------------------------------------------
* # Plugin Name
* DoubleX RMMV Unison Item Config
*----------------------------------------------------------------------------
* # Introduction
* In the default RMMV battle system, no skill/item needs more than 1
* battlers to use
* With this plugin, you can set some skills/items to be unison ones
* needing more than 1 battlers to use them
* Unison battlers are those needed to use the unison skill/item
* Unison invoker is the battler actually selecting and invoking the
* unison skill/item
* Unison invokees are all unison battlers besides the unison invoker
* There can only be 1 unison invoker for each selected unison skill/item
*----------------------------------------------------------------------------
* # Terms Of Use
* You shall keep this plugin's Plugin Info part's contents intact
* You shalln't claim that this plugin's written by anyone other than
* DoubleX or his aliases
* None of the above applies to DoubleX or his aliases
*----------------------------------------------------------------------------
* # Prerequisites
* Abilities:
* 1. Some Javascript coding proficiency to fully utilize this plugin
*----------------------------------------------------------------------------
* # Links
* This plugin:
* 1. http://pastebin.com/igFhrKja
*----------------------------------------------------------------------------
* # Instructions
* 1. To use this plugin with the default battle system, place
* DoubleX RMMV Unison Item Default below this plugin
*----------------------------------------------------------------------------
* # Author
* DoubleX
*----------------------------------------------------------------------------
* # Changelog
* DoubleX RMMV Unison Item Default:
* v1.00c(GMT 0100 1-1-2016):
* 1. Fixed undefined SceneManager.scene by using $gameParty.inBattle()
* v1.00b(GMT 0300 26-12-2015):
* 1. Fixed unison skills/items not usable outside battles bug
* 2. Simplified the unison skill usability checks
* v1.00a(GMT 1400 25-12-2015):
* 1. 1st version of this plugin finished
* This plugin:
* v1.00c(GMT 1300 31-12-2015):
* 1. Fixed writing getter contents directly instead of using String bug
* v1.00b(GMT 0900 30-12-2015):
* 1. Fixed failed to extend battler property name descriptors bug
* 2. Fixed using new Function and class instead of eval and prototype
* 3. Fixed unintentionally declaring global variable in strict mode bug
* 4. Fixed calling push for an Object instead of its Array values bug
* 5. Fixed using 1 single variable to store all old getter functions bug
* v1.00a(GMT 1400 25-12-2015):
* 1. 1st version of this plugin finished
*============================================================================*/
/*:
* @plugindesc Lets you set some skills/items needing mutiple battlers to use
* @author DoubleX
*
* @param showAllUnisonBattlers
* @desc Sets if the battlelog will show all unison battlers instead of only
* the unison invoker
* @default true
*
* @param unisonFunctionRule
* @desc Sets the string of the rule used for setting the user's functions in
* the damage formula of the unison skill/item by using those of all
* unison battlers
* It'll only be used for those functions not having their unison rules
* It must be implemented by function RULES, which must be edited by
* opening the plugin js file directly
* @default avg
*
* @help
* The plugin file name must be the same as
* DoubleX_RMMV.Unison_Item_Config_File, which must be edited by editing the
* plugin js file directly
* The default value of DoubleX_RMMV.Unison_Item_Config_File is
* DoubleX RMMV Unison Item Config v100c
*============================================================================
* ## Notetag Info
*----------------------------------------------------------------------------
* # Skill/Item Notetags:
* 1.
* - Sets the list of id of actors needed for the skill/item as ids
* , is used to separate the actor id in ids
* E.g.:
* means actor with id 1 is needed to use it
* means actors with id 4 and 2 are
* needed to use it
* - All actors included in ids needs to be inputable, able to use the
* skills/item and pay its cost
* - All unison actors will pay the unison skill costs after using it
* - Only actors included in ids can select the skill/item
* - If ids only contains 1 actor id, this notetag will become only
* letting the actor with that actor id to use the skill/item
* 2.
* - Sets the rule of setting user's function in the skill/item's
* damage formula as rule which is implemented by function
* RULES, which must be edited by opening the plugin js file
* directly
* - function must be a battler function name included in
* FUNCTIONS, which must be edited by opening the plugin js file
* directly
* 3.
* - Sets user's function in the skill/item's damage formula to use
* its unison item rule to combine those of actors with id included
* in ids
* E.g.:
* means the user's atk in its damage
* formula uses that of actor with id 1 under the skill/item's
* unison rule applied to atk
* means the user's mat in its damage
* formula uses those of actors with id 4 and 2 under the
* skill/item's unison rule applied to mat
* - function must be a battler function name included in
* FUNCTIONS, which must be edited by opening the plugin js file
* directly
*============================================================================
* ## Plugin Call Info
*----------------------------------------------------------------------------
* # Configuration manipulations
* 1. DoubleX_RMMV.Unison_Item.prop
* - Returns the property prop under DoubleX_RMMV.Unison_Item
* 2. DoubleX_RMMV.Unison_Item.prop = val
* - Sets the property prop under DoubleX_RMMV.Unison_Item as val
* - No DoubleX_RMMV.Unison_Item.prop change will be saved
* 3. $gameSystem.unisonItem.param
* - Returns the value of param listed in the plugin manager
* 4. $gameSystem.unisonItem.param = val
* - Sets the value of param listed in the plugin manager as val
* - All $gameSystem.unisonItem.param changes will be saved
* # Skill/Item manipulations
* 1. meta.unisonItemActors
* - Returns the Array of ids of actors needed to use this skill/item
* 2. meta.unisonItemActors = [id, id, ...]
* - Sets the Array of ids of actors needed to use this skill/item
* - All meta.unisonItemActors changes can be saved if
* DoubleX RMMV Dynamic Data is used
* 3. meta.unisonItemRules[functionName]
* - Returns the unison item rule as String for function with name
* functionName as a String
* 4. meta.unisonItemRules[functionName] = rule
* - Sets the unison item rule for function with name functionName as
* String as String rule, which must be implemented by
* RULES, which must be edited by opening the plugin js file
* directly
* - function with name functionName must be included in
* FUNCTIONS, which must be edited by opening the plugin js file
* directly
* - All meta.unisonItemRules changes can be saved if
* DoubleX RMMV Dynamic Data is used
* 5. meta.unisonItemFunctionActors[functionName]
* - Returns the Array of ids of actors included for combining their
* function functionName as String using its unison item rule
* 6. meta.unisonItemFunctionActors[functionName] = [id, id, ...]
* - Sets the Array of ids of actors included for combining their
* function functionName as String using its unison item rule
* - function with name functionName must be included in
* FUNCTIONS, which must be edited by opening the plugin js file
* directly
* - All meta.unisonItemFunctionActors changes can be saved if
* DoubleX RMMV Dynamic Data is used
*============================================================================
*/

"use strict";
var DoubleX_RMMV = DoubleX_RMMV || {};
DoubleX_RMMV["Unison Item Config"] = "v1.00c";

// The plugin file name must be the same as DoubleX_RMMV.Unison_Item_Config_File
DoubleX_RMMV.Unison_Item_Config_File = "DoubleX RMMV Unison Item Config v100c";

/*============================================================================
* ## Plugin Configurations
* You only need to edit this part as it's about what this plugin does
*----------------------------------------------------------------------------*/

DoubleX_RMMV.Unison_Item = {

/* Implements the unison item function rules
* The unison item function rule can be referenced by rule
* The Array of unison item function value of all unison battlers can be
* referneced by vals
* RULES will be bound to the unison invoker upon use
* It must return a Number
*/
RULES: function(rule, vals) {
if (rule === "min") {
return vals.sort(function(a, B) { return a - b; })[0];
} else if (rule === "avg") {
return vals.reduce(function(a, B) { return a + b; }) / vals.length;
} else if (rule === "max") {
return vals.sort(function(a, B) { return b - a; })[0];
}
console.log("The unison item rule " + rule + " isn't implemented");
return 0;
},

/* Sets the battler functions using the unison item rules
* Its property names must be the class of the battler property descriptors
* Its values must be those property descriptor names as Strings
* All the included battler property descriptors must have the get function
* defined via Object.defineProperty/Object.defineProperties
* All the included battler property descriptors will be extended
*/
FUNCTIONS: {

/* General form:
* class: [
* "battler property descriptors",
* "battler property descriptors",
* "battler property descriptors",
* ...,
* "battler property descriptors"
* ]
*/

Game_BattlerBase: [
"hp",
"mp",
"tp",
"mhp",
"mmp",
"atk",
"def",
"mat",
"mdf",
"agi",
"luk"
// Adds new battler property descriptors here

],

Game_Actor: [
"level"
// Adds battler property descriptors here

]

// Adds new classes here


}

}; // DoubleX_RMMV.Unison_Item

/*============================================================================
* ## Plugin Implementations
* You need not edit this part as it's about how this plugin works
*----------------------------------------------------------------------------
* # Plugin Support Info:
* 1. Prerequisites
* - Solid understanding to the implementation parts independent from
* any action input nor execution flows in battles
* - Decent Javascript coding proficiency to fully comprehend this
* plugin
* 2. Function documentation
* - The 1st part describes why this function's rewritten/extended for
* rewritten/extended functions or what the function does for new
* functions
* - The 2nd part describes what the arguments of the function are
* - The 3rd part informs which version rewritten, extended or created
* this function
* - The 4th part informs whether the function's rewritten or new
* - The 5th part informs whether the function's a real or potential
* hotspot
* - The 6th part describes how this function works for new functions
* only, and describes the parts added, removed or rewritten for
* rewritten or extended functions only
* Example:
* /*----------------------------------------------------------------------
* * Why rewrite/extended/What this function does
* *----------------------------------------------------------------------*/
/* // arguments: What these arguments are
* functionName = function(arguments) { // Version X+; Hotspot
* // Added/Removed/Rewritten to do something/How this function works
* functionContents
* //
* } // functionName
*----------------------------------------------------------------------------*/

(function(UI) {

UI.DataManager = {};
var DM = UI.DataManager;

DM.isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
// Rewritten
return DM.isDatabaseLoaded.apply(this, arguments) && DM.loadAllNotes();
//
}; // DataManager.isDatabaseLoaded

DM.loadAllNotes = function() {
[$dataSkills, $dataItems].forEach(function(type) {
type.forEach(function(data) {
if (data) { DM.loadItemNotes(data); }
});
});
return true;
}; // DM.loadAllNotes

// data: The data to have its notetags read
DM.loadItemNotes = function(data) {
data.meta.unisonItemActors = [];
data.meta.unisonItemRules = {};
data.meta.unisonItemFunctionActors = {};
var uIAs = data.meta.unisonItemActors;
var uIRs = data.meta.unisonItemRules;
var uIFAs = data.meta.unisonItemFunctionActors;
var actors = /< *unison +item +actors *: *(\d+(?: *, *\d+)*) *>/i;
var rule = /< *unison +item +(\w+) +rule*: *(\w+) *>/i;
var fAs = /< *unison +item +(\w+) +actors *: *(\d+(?: *, *\d+)*) *>/i;
data.note.split(/[\r\n]+/).forEach(function(line) {
if (line.match(rule)) {
uIRs[RegExp.$1] = RegExp.$2;
return;
} else if (line.match(actors)) {
RegExp.$1.trim().split(/,/).forEach(function(id) {
uIAs.push(+id);
});
} else if (!line.match(fAs)) { return; }
uIFAs[RegExp.$1] = uIFAs[RegExp.$1] || [];
RegExp.$2.trim().split(/,/).forEach(function(id) {
uIFAs[RegExp.$1].push(+id);
});
});
}; // DM.loadItemNotes

UI.Game_System = {};
var GS = UI.Game_System;

/*------------------------------------------------------------------------
* New public instance variable
*------------------------------------------------------------------------*/
// The storage of all configuration values
Object.defineProperty(Game_System.prototype, "unisonItem", {
get: function() { return this._unisonItem; },
configurable: true
});

GS.initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
GS.initialize.apply(this, arguments);
GS.initUnisonItemParams.call(this); // Added
}; // Game_System.prototype.initialize

GS.initUnisonItemParams = function() {
var params;
this._unisonItem = {};
params = PluginManager.parameters(DoubleX_RMMV.Unison_Item_Config_File);
Object.keys(params).forEach(function(param) {
this._unisonItem[param] = params[param] === "true";
}, this);
this._unisonItem.unisonFunctionRule = params.unisonFunctionRule;
}; // GS.initUnisonItemParams

UI.Game_Action = {};
var GA = UI.Game_Action;

GA.makeDamageValue = Game_Action.prototype.makeDamageValue;
Game_Action.prototype.makeDamageValue = function(target, critical) {
// Added to set all user functions to use their unison item rules
var item = this.item(), subject = this.subject();
if (subject.isActor() && item.meta.unisonItemActors.length > 1) {
subject.unisonItem = item;
}
//
GA.makeDamageValue.apply(this, arguments);
subject.unisonItem = null; // Added to set all user functions to normal
}; // Game_Action.prototype.makeDamageValue

UI.Game_Battler = {};
var GB = UI.Game_Battler;

/*------------------------------------------------------------------------
* New public instance variables
*------------------------------------------------------------------------*/
Object.defineProperties(Game_Battler.prototype, {
// Read by Game_BattlerBase to get the other battlers' action slot list
"actions": {
get: function() { return this._actions; },
configurable: true
},
// The cached unison skill/item when executing its damage formula
"unisonItem": {
set: function(item) { this._unisonItem = item; },
configurable: true
}
});

GB.useItem = Game_Battler.prototype.useItem;
Game_Battler.prototype.useItem = function(item) {
// Rewritten to ask all unison invokees to pay the skill/item cost only
if (!DataManager.isSkill(item)) {
return GB.useItem.apply(this, arguments);
} else if (item.meta.unisonItemActors.length <= 1) {
return GB.useItem.apply(this, arguments);
}
item.meta.unisonItemActors.forEach(function(actorId) {
$gameActors.actor(actorId).paySkillCost(item);
});
//
}; // Game_Battler.prototype.useItem

UI.Window_ItemList = {};
var WIL = UI.Window_ItemList;

WIL.isEnabled = Window_ItemList.prototype.isEnabled;
Window_ItemList.prototype.isEnabled = function(item) {
// Rewritten to disable unison items when unison conditions aren't met
if (!DataManager.isItem(item)) {
return WIL.isEnabled.apply(this, arguments);
} else if (item.meta.unisonItemActors.length <= 1) {
return WIL.isEnabled.apply(this, arguments);
} else if (SceneManager.scene.constructor !== Scene_Battle) {
return WIL.isEnabled.apply(this, arguments);
}
return BattleManager.actor() && BattleManager.actor().canUse(item);
//
}; // Window_ItemList.prototype.isEnabled

UI.Window_BattleLog = {};
var WBL = UI.Window_BattleLog;

WBL.displayAction = Window_BattleLog.prototype.displayAction;
Window_BattleLog.prototype.displayAction = function(subject, item) {
// Rewritten to display all unison actor names if users set so
if (!$gameSystem.unisonItem.showAllUnisonBattlers) {
return WBL.displayAction.apply(this, arguments);
} else if (item.meta.unisonItemActors.length <= 1) {
return WBL.displayAction.apply(this, arguments);
}
WBL.displayUnisonAct.call(this, item);
//
}; // Window_BattleLog.prototype.displayAction

WBL.displayUnisonAct = function(item) {
var names = WBL.unisonActorNames(item.meta.unisonItemActors);
var numMethods = this._methods.length;
if (DataManager.isSkill(item)) {
if (item.message1) { this.push('addText', names); }
if (item.message2) {
this.push('addText', item.message2.format(item.name));
}
} else {
var text = TextManager.useItem.format(names, item.name);
this.push('addText', text);
}
if (this._methods.length === numMethods) { this.push('wait'); }
}; // WBL.displayUnisonAct

WBL.unisonActorNames = function(actorIds) {
var names = "";
for (var index = 0, length = actorIds.length; index < length; index++) {
if (index > 0 && index < length - 1) {
names += ", ";
} else if (index === length - 1) {
names += " and ";
}
names += $gameActors.actor(actorIds[index]).name();
}
return names;
}; // WBL.unisonActorNames

var Proto;
for (var K in UI.FUNCTIONS) {
if (!UI.FUNCTIONS.hasOwnProperty(K)) { continue; }
UI[K] = UI[K] || {}; // Ensures container GB won't be rewritten
Proto = eval(K + ".prototype"); // Actual class prototype
UI.FUNCTIONS[K].forEach(function(pD) {

/*------------------------------------------------------------
* Extends all battler functions using unison item rules
*------------------------------------------------------------*/
UI[K][pD] = Object.getOwnPropertyDescriptor(Proto, pD).get;
Object.defineProperty(Proto, pD, { get: new Function([
"var UI = DoubleX_RMMV.Unison_Item;",
"var item = this._unisonItem;",
"if (!item) {",
" return UI." + K + "." + pD + ".apply(this, arguments);",
"}",
"var actorIds = item.meta.unisonItemFunctionActors[pD];",
"if (!actorIds) {",
" return UI." + K + "." + pD + ".apply(this, arguments);",
"}",
"var vals = actorIds.map(function(actorId) {",
" var actor = $gameActors.actor(actorId);",
" return UI." + K + "." + pD + ".apply(actor, arguments);",
"});",
"var rule = item.meta.unisonItemRules[pD];",
"rule = rule || $gameSystem.unisonItem.unisonFunctionRule;",
"return UI.RULES.call(this, rule, vals);",
].join("\n")), configurable: true
});

});
}

})(DoubleX_RMMV.Unison_Item);

/*============================================================================*/


DoubleX RMMV Unison Item Default
/*============================================================================
* ## Plugin Info
*----------------------------------------------------------------------------
* # Plugin Name
* DoubleX RMMV Unison Item Default
*----------------------------------------------------------------------------
* # Terms Of Use
* You shall keep this plugin's Plugin Info part's contents intact
* You shalln't claim that this plugin's written by anyone other than
* DoubleX or his aliases
* None of the above applies to DoubleX or his aliases
*----------------------------------------------------------------------------
* # Prerequisites
* Plugins:
* 1. DoubleX RMMV Unison Item Config
*----------------------------------------------------------------------------
* # Links
* This plugin:
* 1. http://pastebin.com/kV33uWeU
*----------------------------------------------------------------------------
* # Instructions
* 1. Place this plugin below DoubleX RMMV Unison Item Config
*----------------------------------------------------------------------------
* # Author
* DoubleX
*----------------------------------------------------------------------------
* # Changelog
* v1.00c(GMT 0100 1-1-2016):
* 1. Fixed undefined SceneManager.scene by using $gameParty.inBattle()
* v1.00b(GMT 0300 26-12-2015):
* 1. Fixed unison skills/items not usable outside battles bug
* 2. Simplified the unison skill usability checks
* v1.00a(GMT 1400 25-12-2015):
* 1. 1st version of this plugin finished
*============================================================================*/

"use strict";
var DoubleX_RMMV = DoubleX_RMMV || {};
DoubleX_RMMV["Unison Item Default"] = "v1.00a";

/*============================================================================
* ## Plugin Implementations
* You need not edit this part as it's about how this plugin works
*----------------------------------------------------------------------------
* # Plugin Support Info:
* 1. Prerequisites
* - Solid understanding to the default RMMV actor action input flows
* - Decent Javascript coding proficiency to fully comprehend this
* plugin
* 2. Function documentation
* - The 1st part describes why this function's rewritten/extended for
* rewritten/extended functions or what the function does for new
* functions
* - The 2nd part describes what the arguments of the function are
* - The 3rd part informs which version rewritten, extended or created
* this function
* - The 4th part informs whether the function's rewritten or new
* - The 5th part informs whether the function's a real or potential
* hotspot
* - The 6th part describes how this function works for new functions
* only, and describes the parts added, removed or rewritten for
* rewritten or extended functions only
* Example:
* /*----------------------------------------------------------------------
* * Why rewrite/extended/What this function does
* *----------------------------------------------------------------------*/
/* // arguments: What these arguments are
* functionName = function(arguments) { // Version X+; Hotspot
* // Added/Removed/Rewritten to do something/How this function works
* functionContents
* //
* } // functionName
*----------------------------------------------------------------------------*/

if (DoubleX_RMMV["Unison Item Config"]) {

(function(UI) {

UI.BattleManager = UI.BattleManager || {};
var BM = UI.BattleManager;

/*------------------------------------------------------------------------
* New public instance variable
*------------------------------------------------------------------------*/
// BM.unisonActors: The mapping between unison actions and unison invokees

BM.initMembers = BattleManager.initMembers;
BattleManager.initMembers = function() {
BM.unisonActors = {}; // Added
BM.initMembers.apply(this, arguments);
}; // BattleManager.initMembers

BM.selectNextCommand = BattleManager.selectNextCommand;
BattleManager.selectNextCommand = function() {
BM.addUnisonActors.call(this); // Added to set the action-invokee pair
BM.selectNextCommand.apply(this, arguments);
}; // BattleManager.selectNextCommand

BM.selectPreviousCommand = BattleManager.selectPreviousCommand;
BattleManager.selectPreviousCommand = function() {
// Added to ensure this cancelled action can be reserved for unison ones
var act = this.actor().inputtingAction();
if (act) { act.clear(); }
//
BM.selectPreviousCommand.apply(this, arguments);
// Added to clear the action-invokee pair
if (this.actor()) { BM.eraseUnisonActors(this.actor()); }
//
}; // BattleManager.selectPreviousCommand

BM.startTurn = BattleManager.startTurn;
BattleManager.startTurn = function() {
// Added to clears all action-invokee mappings and reserved action slots
BM.clearUnisonActors();
//
BM.startTurn.apply(this, arguments);
}; // BattleManager.startTurn

BM.addUnisonActors = function() {
var actor = this.actor(), act, item;
if (actor) { act = actor.inputtingAction(); }
if (act) { item = act.item(); }
if (!item || item.meta.unisonItemActors.length <= 1) { return; }
var actorIds = item.meta.unisonItemActors.filter(function(actorId) {
return actorId !== actor.actorId();
});
// Stores the action-invokee pair and reserves 1 action for each of them
BM.unisonActors[[actor.index(), actor.actionInputIndex]] = actorIds;
actorIds.forEach(function(actorId) {
$gameActors.actor(actorId).unisonItemNumInputs += 1;
});
//
}; // BM.addUnisonActors

// actor: The currently selected actor
BM.eraseUnisonActors = function(actor) {
var actorIds = BM.unisonActors[[actor.index(), actor.actionInputIndex]];
if (!actorIds) { return; }
// Voids the action-invokee pair and frees 1 action for each of them
BM.unisonActors[[actor.index(), actor.actionInputIndex]] = null;
actorIds.forEach(function(actorId) {
$gameActors.actor(actorId).unisonItemNumInputs -= 1;
});
//
}; // BM.eraseUnisonActors

BM.clearUnisonActors = function() {
BM.unisonActors = {};
// Ensures the unison action usability check will pass upon using it
$gameParty.movableMembers().forEach(function(mem) {
mem.unisonItemNumInputs = -1;
});
//
}; // BM.clearUnisonActors

UI.Game_BattlerBase = UI.Game_BattlerBase || {};
var GBB = UI.Game_BattlerBase;

GBB.canInput = Game_BattlerBase.prototype.canInput;
Game_BattlerBase.prototype.canInput = function() {
// Rewritten to check if at least 1 action slot isn't reserved
if (!GBB.canInput.apply(this, arguments)) { return false; }
if (this.isActor() && $gameParty.inBattle()) {
return this._unisonItemNumInputs < this._actions.length;
}
return true;
//
}; // Game_BattlerBase.prototype.canInput

GBB.canUse = Game_BattlerBase.prototype.canUse;
Game_BattlerBase.prototype.canUse = function(item) {
// Rewritten to check if all unison actors can use the unison skill/item
if (!this.isActor() || item.meta.unisonItemActors.length <= 0) {
return GBB.canUse.apply(this, arguments);
} else if (item.meta.unisonItemActors.indexOf(this.actorId()) <= 0) {
return false;
}
if (!GBB.canUse.apply(this, arguments)) { return false; }
if (DataManager.isSkill(item)) { return GBB.canUseUnisonSkill(item); }
return DataManager.isItem(item) && GBB.canUseUnisonItem(item);
//
}; // Game_BattlerBase.prototype.canUse

GBB.canUseUnisonSkill = function(skill) {
var inBattle = $gameParty.inBattle();
var actor, actorIds = skill.meta.unisonItemActors;
// Checks if all needed actors can use the skill and have empty actions
for (var index = 0, length = actorIds.length; index < length; index++) {
if (actorIds[index] === this.actorId()) { continue; }
actor = $gameParty.members().filter(function(mem) {
return mem.actorId() === actorIds[index];
})[0];
if (!actor || inBattle && !actor.canInput()) { return false; }
if (!actor.meetsSkillConditions(skill)) { return false; }
if (actor.skills().every(function(s) { return s !== skill; })) {
return false;
}
}
//
return true;
}; // GBB.canUseUnisonSkill

GBB.canUseUnisonItem = function(item) {
if (!this.meetsItemConditions(item)) { return false; }
var inBattle = $gameParty.inBattle();
var actor, actorIds = item.meta.unisonItemActors;
for (var index = 0, length = actorIds.length; index < length; index++) {
if (actorIds[index] === this.actorId()) { continue; }
actor = $gameParty.members().filter(function(mem) {
return mem.actorId() === actorIds[index];
})[0];
if (!actor || inBattle && !actor.canInput()) { return false; }
}
return true;
}; // GBB.canUseUnisonItem

UI.Game_Actor = UI.Game_Actor || {};
var GA = UI.Game_Actor;

/*------------------------------------------------------------------------
* New public instance variables
*------------------------------------------------------------------------*/
Object.defineProperties(Game_Actor.prototype, {
// Read by BattleManager to store the unison action-invokees pairs
"actionInputIndex": {
get: function() { return this._actionInputIndex; },
configurable: true
},
// The number of empty actions reserved for using unison skills/items
"unisonItemNumInputs": {
get: function() { return this._unisonItemNumInputs; },
set: function(num) { this._unisonItemNumInputs = num; },
configurable: true
}
});

GA.initMembers = Game_Actor.prototype.initMembers;
Game_Actor.prototype.initMembers = function() {
GA.initMembers.apply(this, arguments);
this._unisonItemNumInputs = 0; // Added
}; // Game_Actor.prototype.initMembers

GA.clearActions = Game_Actor.prototype.clearActions;
Game_Actor.prototype.clearActions = function() {
GA.clearActions.apply(this, arguments);
this._unisonItemNumInputs = 0; // Added
}; // Game_Actor.prototype.clearActions

GA.selectNextCommand = Game_Actor.prototype.selectNextCommand;
Game_Actor.prototype.selectNextCommand = function() {
// Added to return false if the next slot's reserved for unison act also
var maxIndex = this._actions.length - 1;
if (this._actionInputIndex + this._unisonItemNumInputs >= maxIndex) {
return false;
}
//
return GA.selectNextCommand.apply(this, arguments);
}; // Game_Actor.prototype.selectNextCommand

})(DoubleX_RMMV.Unison_Item);

} else {
alert("To use Unison Item Default, place it below Unison Item Config.");
}

/*============================================================================*/

 

 

Ho creato un' abilità e ho usato il notetag "<unison item actors: 1, 2>", che costa 10 pt, ma non so perché, anche se uno dei due non ha abbastanza pt, l'abilità viene comunque lanciata, come se il plug in non fosse attivo. Come posso risolvere?(ovviamente è su ON)

 

P.S: Ho letto la guida, ma non mi è chiara

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Crea un account o accedi per lasciare un commento

You need to be a member in order to leave a comment

Crea un account

Iscriviti per un nuovo account nella nostra comunità. È facile!

Registra un nuovo account

Accedi

Sei già registrato? Accedi qui.

Accedi Ora

  • Contenuti simili

    • Da kaine
      Questa patch modifica il modo in cui le tavolozze delle immagini vengono caricate e calcolate e scambia la modalità di visualizzazione all'interno della finestra di gioco e a schermo intero da 16 a 32 bit. Tutti i file grafici devono ancora avere colori indicizzati a 8bit! Ma con questa patch verranno visualizzati come previsto senza ulteriori perdite di qualità.


      Se si utilizza RPG2000 1.07, è sufficiente attivare la funzione schermo 32bit dello strumento DestinyPatcherV2 e successivamente applicare la patch 32bit-Fix di DestinyV2.
       
      Tool e versioni supportate:
      Rpgmaker 2000: v1.61-v1.62
      Rpgmaker 2003: v1.08
       
      Autore: Bugmenot,KotatsuAkira
       
      Link Download:
      (2003 v1.08)
      https://www.mediafire.com/file/x5lm6ukulc0v6q9/32bit%28fix%29.rar/file
      (2000 v1.61-v1.62)
      https://www.mediafire.com/file/r3u2uark1gub7e3/RPGMakerPatch_Screen32.7z/file
       
       
      Se avete l'ultima versione di dynrpg mettete la patch direttamente nella cartella dynpatches. Altrimenti dovete applicarla tramite lunar ips che trovate qui:
      http://www.mediafire.com/?5jf9r44itbm7674
      
    • Da kaine
      Questa patch cambia la larghezza di tutto il testo renderizzato sullo schermo di gioco da 6 a 8 (i caratteri larghi e EXFONT passano da 12 a 16, il mezzo spazio da 3 a 4) pixel, mentre l'altezza rimane 12. Per utilizzarlo correttamente, potrebbe essere necessario sostituire i font utilizzati dal motore e inserire nell'EXE una nuova immagine EXFONT con una larghezza di 208 anziché 156 pixel.

      Per il momento, non utilizzare questa funzione in combinazione con EXtraFONT. In particolare, applicatela solo se sapete perfettamente cosa state facendo, poiché dovrete regolare manualmente la definizione della larghezza ridimensionata automaticamente di EXFONT al momento del caricamento da 288 a 384 pixel.
       
      Tool e versioni supportate:
      Rpgmaker 2000: v1.07-v1.10-v1.50-v1.51-v1.52-v1.60-v1.61-v1.62
      Rpgmaker 2003: v1.00-v1.03-v1.05-v1.08-v1.09-v1.12
       
      Autore: KotatsuAkira
       
      Link Download:
      https://www.mediafire.com/file/tl9kkcf78b7twqw/RPGMakerPatch_TextWidthEight.7z/file
       
      Se avete l'ultima versione di dynrpg mettete la patch direttamente nella cartella dynpatches. Altrimenti dovete applicarla tramite lunar ips che trovate qui:
      http://www.mediafire.com/?5jf9r44itbm7674
    • Da kaine
      Visualizza il menu invertito come in FF6.
      Personaggi a sinistra ed opzioni a destra.
       
      Tool e versioni supportate:
      Rpgmaker 2000: v1.07-v1.10-v1.50-v1.51-v1.52-v1.60-v1.61-v1.62
      Rpgmaker 2003: v1.00-v1.03-v1.05-v1.08-v1.09-v1.12
       
      Autore: Cherry,KotatsuAkira(porting)
       
      Link Download:
      (2003 v1.08)
      http://www.mediafire.com/file/o6o847gr08adqcb/RPG_RT_menureversed.rar
      (2000 v1.62)
      https://www.mediafire.com/file/osqjc0i4mi72ll4/RPGMakerPatch_MenuReversed.7z/file
      (2000 v1.07-v1.10-v1.50-v1.51/v1.52-v1.60-v1.61-v1.62 - 2003 v1.00-v1.03-v1.05-v1.08-v1.09->v1.12 (Maniac Patch up to mp210414 only) )
      https://www.mediafire.com/file/bfk056czh2xvczj/RPGMakerPatch_MenuReversed.7z/file
       
       
      Se avete l'ultima versione di dynrpg mettete la patch direttamente nella cartella dynpatches. Altrimenti dovete applicarla tramite lunar ips che trovate qui:
      http://www.mediafire.com/?5jf9r44itbm7674
×