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 rimuove il comando end, altrimenti aggiunto automaticamente, dal motore di gioco nella scelta principale del menu
      Se si definisce che la scelta nel database è vuota, può
      bloccare il gioco o causare altri problemi.
       
      Tool e versioni supportate:
      Rpgmaker 2003: v1.00-v1.03-v1.05-v1.08-v1.09-v1.12
      Autore: Cherry, KotatsuAkira(porting)
       
      Link  Download:
      (2003 v1.09-v1.12)
      https://www.mediafire.com/file/vwbjb8naswekm58/RPG_RT_112_NoEndCommandInMenu.ips/file
      (2003 v1.00-v1.03-v1.05-v1.08)
      https://www.mediafire.com/file/v4ql077l5icn9dy/RPGMakerPatch_NoEndCommand.7z/file
       
       
      Per applicarla dovete usare questo programmino qui:
      http://www.mediafire.com/download/5jf9r44itbm7674/lips102.zip
      Nel caso in cui invece avete patchato il vostro gioco con la versione 0.20 di dynrpg mettete la patch direttamente nella cartella dynpatches.
       
    • Da kaine
      Tramite questa patch è possibile modificare la posizione del timer sia durante il gioco che in battaglia, alcuni esempi di utilizzo sono il cambiare angolo o far si che in determinate circostanze lo si possa shakerare, posizionare sopra un nemico o far si che segua costantemente l'eroe, un veicolo ecc ecc sta tutto alla vostra immaginazione.
       
      La patch utilizza le seguenti variabili:
      Timer 1
      3401 - 3402 contengono i valori delle coordinate X e Y del timer in game
      3403 - 3404 contengono i valori delle coordinate X e Y del timer in battaglia
      Solo 2003 :
      Timer 2
      3405 - 3406 contengono i valori delle coordinate X e Y del timer in game
      3407 - 3408 contengono i valori delle coordinate X e Y del timer in battaglia
       
      Tool e versioni supportate:
      Rpgmaker 2000: v1.07-v1.10-v1.50-v1.51-v1.62
      Rpgmaker 2003: v1.08-v1.09-v1.12-Maniacs Patch mp210414_EN_IM-mp210414_EN_PF-mp210414_JP_IM-mp210414_JP_PF
       
      Autore: KotatsuAkira
      Link Download:
      https://www.mediafire.com/file/wv677ddsjv9dpv4/RPGMakerPatch_VarTimerPos.7z/file
       
      Nel caso in cui utilizziate la patch Screen32 all'interno dell'archivio è presente una versione compatibile con essa che andrà applicata solamente dopo aver applicato la prima.
       
      Per applicarla dovete usare questo programmino qui:
      https://www.mediafire.com/file/5jf9r44itbm7674/lips102.zip/file
    • Da Yugi90
      yugi90

      presenta

      BLAZE OF IRE

      1. Breve Descrizione
       Questo gioco si rifà ai vecchi JRPG dell'epoca SNES e ha un'ambientazione science fantasy ispirata a Star Wars, quindi ha un look molto più sci-fi rispetto alla vecchia versione. 
      Un soldato di Arbia insieme al migliore amico cercheranno un laboratorio per indagare su cosa c'è dietro alla sparizione di un loro commilitone.
      Il gioco mescola elementi classici dei JRPG ad elementi stealth.
       
      Circa 2 ore di gioco
      5 personaggi giocabili
       
       

       
       
       

       

       
       
       

       

       
      2. Link al topic del progetto


      3. Demo
      https://www.mediafire.com/file/51077yn13lfrfvj/Blaze+of+Ire+DEMO.zip/file
       
      4. Crediti Vari
      Ne ho davvero tanti da creditare, ho perlopiù utlizzato grafiche rippate da vari giochi usando The Spriters Resource 
      Credito tutto il forum di Rpg2s, in particolare MichaelPrimo e ZoroTheGallade per avermi dato suggerimenti su come rendere interessante la storia e il gameplay e sempre MichaelPrimo per aver testato il gioco.
×