//============================================================================= // Dragon quest monster Plugins - Core Engine // DQM_Plugin.js //============================================================================= var Imported = Imported || {}; Imported.DQM_Plugin = false; var DQM = DQM || {}; DQM.Core = DQM.Core || {}; //============================================================================= /*: * @plugindesc v1.0 Recreate the same RPG system than the games Dragon Quest * Monsters. * * @param ---System--- * @default * * @param Max Size Team * @desc Adjusts the maximal number of members of a team. * Default: 4 * @default 4 * * @param Max Supplementary Team * @desc Define the supplementary teams usable in main menu * Default: 0 (= no supplementary team)(-1 = all battlers usable in main menu) * @default 0 * * @param Name Main Team * @desc Define the name of the battle team showed in menus * Default: Equipe * @default Equipe * * @param Name Supplementary Team * @desc Define the name of others teams showed in menus * Default: Réserve * @default Réserve * * @param Name Stockage System * @desc Define the name of system of stockage of your monsters * Default: Stockage * @default Stockage * * @param Max Battlers * @desc Define the maximum of battlers addable in your team * Default: 0 (= no limit)(team main et sup excluded in count) * @default 0 * * @param Synthesis Access Main Menu * @desc Defines if the command Synthesis is added to the main menu opened by * any way. Default: Y (=enabled, else=disabled) * @default Y * * @param BookList Access Main Menu * @desc Defines if the command BookList is added to the main menu opened by * any way. Default: Y (=enabled, else=disabled) * @default Y * * @param Rename Access Main Menu * @desc Defines if the command Rename is added to the main menu opened by * any way. Default: Y (=enabled, else=disabled) * @default Y * * @param Synthesis Access Main Menu Event * @desc Defines if the command Synthesis is added to the main menu only * opened by event command. Default: Y (=enabled, else=disabled) * @default Y * * @param BookList Access Main Menu Event * @desc Defines if the command BookList is added to the main menu only * opened by event command. Default: Y (=enabled, else=disabled) * @default Y * * @param Rename Access Main Menu Event * @desc Defines if the command Rename is added to the main menu only * opened by event command. Default: Y (=enabled, else=disabled) * @default Y * * @param Rename Main Menu Name * @desc Defines the command name in the main menu to access to the Rename Menu. * Default: Renommer * @default Renommer * * @param Message Get New Actor * @desc Defines the text displayed when you received a new monster. * Default: Vous avez reçu un %1 ! (%1 = monster name) * @default Vous avez reçu un %1 ! * * @param Display Name Player * @desc Defines the text displayed to describe the name of the player. * Default: Nom * @default Nom * * @param Display Book Data As Percent * @desc Defines if the data of books is showed as percent or as value/max. * Default: Y (=as percent, else = as value/max) * @default Y * * @param Display Result Monster Encountered * @desc Defines the text displayed to describe the number of * monster encountered (Default: Monstres rencontrés) * @default Monstres rencontrés * * @param Display Result Monster Recruited * @desc Defines the text displayed to describe the number of * monster recruited (Default: Monstres capturés) * @default Monstres capturés * * @param Display Result Skillset Discovered * @desc Defines the text displayed to describe the number of * skillsets discovered (Default: Compétences découvertes) * @default Compétences découvertes * * @param Display Result Skillset Mastered * @desc Defines the text displayed to describe the number of * skillsets mastered (Default: Compétences maîtrisés) * @default Compétences maîtrisés * * @param Display Result Attribute Discovered * @desc Defines the text displayed to describe the number of * attributes discovered (Default: Attributs découverts) * @default Attributs découverts * * @param Gender Actor List * @desc Define the symbol used for each available genders * each values are separated by the character , * this parameter has to have 3 values * the characters +- or -+ have a special display. * Default: -,+-,+ * @default -,+-,+ * * @param Gender Actor Label * @desc Define the label used in screen to describe gender of actor * Default: Genre * @default Genre * * @param Hit Default * @desc Define the default value of extra parameter Hit of all battlers * Default: 0 * @default 0 * * @param Critical Default * @desc Define the default value of extra parameter Critical of all battlers * Default: 0 * @default 0 * * @param Evasion Default * @desc Define the default value of extra parameter Evasion of all battlers * Default: 0 * @default 0 * * @param Weapon Default * @desc Define the default weapon type id equippable by all battlers * Default: 0 (= no weapon) * @default 0 * * @param Rate Exp Battle Team * @desc Define the rate of exp acquired by monsters in battle team * Default: 100 * @default 100 * * @param Rate Exp Sup Team * @desc Define the rate of exp acquired by monsters in supplementary teams * Default: 50 * @default 50 * * @param Rate Exp Stockage * @desc Define the rate of exp acquired by monsters in stockage system * Default: 20 * @default 20 * * @param Rate Skillsets Enemy * @desc Define the rate min/max level at which a monster masters its skillsets * Default: 80 * @default 80 * * @param Rate Resistances Enemy * @desc Define the rate min/max level at which a monster has all its * resistances up (Default: 80) * @default 80 * * @param Rate Attributes Enemy * @desc Define the rate min/max level at which a monster gain all its * attributes (Default: 80) * @default 80 * * @param Rate Level Enemy * @desc Define the rate min/max level at which parameters enemies evolves * Default: 80 * @default 80 * * @param Critical Effect Application * @desc Define how the critical affects the value of damage inflicted * Default: Y (= rise up the params of the attacker; else, rise up the damage) * @default Y * * @param Rate Critical Effect * @desc Define the rate of bonus damage with critical effect * Default: 300 * @default 300 * * @param Length Name Actor * @desc Define the length max allowed for the name input of obtained monsters * Default: 12 * @default 12 * * @param ---Classes--- * @default * * @param Class Group List * @desc Defines the groups of all classes (the first is the default). * each value are separated by the characters , * All classes of the last group of this list can't be obtained by a * classic synthesis * Default: Gluant,Dragon,Bête,Nature,Matière,Démon,Mort-Vivant,Inconnu * @default Gluant,Dragon,Bête,Nature,Matière,Démon,Mort-Vivant,Inconnu * * @param Class Group Label * @desc Defines the label used in screen to describe class' groups. * Default: Famille * @default Famille * * @param Class Size List * @desc Defines the size of all classes (1st = 1, 2nd = 2, ...). * each value are separated by the characters , * Default: Petit,Moyen,Grand,Géant * @default Petit,Moyen,Grand,Géant * * @param Class Size List Icon * @desc Defines the icon of size of all classes (1st = 1, 2nd = 2, ...). * each value are separated by the characters , * Default: S,M,G,SG * @default S,M,G,SG * * @param Class Size Label * @desc Defines the label used in screen to describe class' sizes. * Default: Taille * @default Taille * * @param Class Rank List * @desc Defines the rank of all classes (from least to greatest). * each value are separated by the characters , * Default: F,E,D,C,B,A,S,X * @default F,E,D,C,B,A,S,X * * @param Class Rank Label * @desc Defines the label used in screen to describe class' ranks. * Default: Rang * @default Rang * * @param ---Job Points--- * @default * * @param Level Job Points Add * @desc Defines the levels where the actor gains Job Points. * each value are separated by the characters , * Value of job points added are given in parameter 'Value Job Points Add' * Default: 2,5,8,10,12,15,18,20,22,25,28,30,32,35,38,40,42,45,48,50,52,55,58,60,62,65,68,70,72,75,78,80,82,85,88,90,92,95,98,100 * @default 2,5,8,10,12,15,18,20,22,25,28,30,32,35,38,40,42,45,48,50,52,55,58,60,62,65,68,70,72,75,78,80,82,85,88,90,92,95,98,100 * * @param Value Job Points Add * @desc Defines the quantity of Job Points the actor gains when level up. * each value are separated by the characters , * Level when theses job points are added are defined in parameter 'Level Job Points Add' * Default: 5,8,5,7,5,5,4,4,5,5,4,3,4,4,3,5,2,3,5,5,3,2,3,5,3,3,4,3,2,2,5,3,4,2,3,2,4,4,3,5 * @default 5,8,5,7,5,5,4,4,5,5,4,3,4,4,3,5,2,3,5,5,3,2,3,5,3,3,4,3,2,2,5,3,4,2,3,2,4,4,3,5 * * @param Job Points Name * @desc Defines the name of Job Points in the game * Default: Point de compétence * @default Point de compétence * * @param Job Points Icon * @desc Defines the icon of Job Points in the game * Default: PC * @default PC * * @param Display Gain Job Points * @desc Defines the text to display when an actor gains x job points * %1 = actor name * %2 = job Points obtained * Default: %1 a gagné %2 points de compétences. * @default %1 a gagné %2 points de compétences. * * @param ---Recruit--- * @default * * @param Recruit order name * @desc Defines the command 'Recruit' name in the game * Default: Recruter * @default Recruter * * @param Recruit Message Use * @desc Defines the message displayed when an actor uses the skill 'Recruit' * Default: exécute une démonstration de force! * @default exécute une démonstration de force! * * @param Recruit Formula * @desc Defines the formula uses to calculate the bonus rate of an 'Recruit' attack * Default: (a.atk * 4 - b.def * 2)*(1/2) * @default (a.atk * 4 - b.def * 2)*(1/2) * * @param Recruit Gauge Positions * @desc Defines the position in battle screen of the gauge filled up by 'Recruit skills * Default: 0,70,120 * @default 0,70,120 * * @param Recruit Message Text * @desc Defines all messages displayed after 'Recruit' skill use, according to the bonus Rate added. * each message are separated by the characters ;, * %1 = Actor name * Values ranges of these messages are defined in parameter 'Recruit Message Value Min' * Default: %1 n\'est pas du tout impressioné;,%1 n\'est pas très impressioné;,%1 est un peu impressioné;,%1 est très impressioné * @default %1 n\'est pas du tout impressioné;,%1 n\'est pas très impressioné;,%1 est un peu impressioné;,%1 est très impressioné * * @param Recruit Message Value Min * @desc Defines all minimal values to reach in order to display messages displayed. * each value are separated by the characters , * Messages displayed according to these values are defined in parameter 'Recruit Message Text' * Default: 0,1,10,30 * @default 0,1,10,30 * * @param Recruit Check Message * @desc Defines message displayed after all actors has used the 'Recruit' skill * %1 = Enemy name * Default: %1 réfléchit... * @default %1 réfléchit... * * @param Recruit Win Message * @desc Defines message displayed if the monster is recruited * %1 = Enemy name * Default: %1 se décide à rejoindre votre équipe. * @default %1 se décide à rejoindre votre équipe. * * @param Recruit Win Insert Team Message * @desc Defines message displayed if the monster is sended in a team * %1 = Enemy name, %2 = Team name * Default: %1 intègre votre %2. * @default %1 intègre votre %2. * * @param Recruit Win Insert System Message * @desc Defines message displayed if the monster is not sended in a team * %1 = Enemy name * Default: %1 est envoyé dans votre système de stockage. * @default %1 est envoyé dans votre système de stockage. * * @param Recruit Lose Message * @desc Defines message displayed if the monster isn't recruited * %1 = Enemy name * Default: Le dressage a échoué * @default Le dressage a échoué * * @param Malus Recruit Lose Chance * @desc Defines the chances of a malus if the recruit try is missed * Default: 30 * @default 30 * * @param Malus Recruit Lose Message * @desc Defines message displayed if malus after recruit missed is activated * %1 = Enemy name * Default: Les ennemis se vexent. * @default Les ennemis se vexent. * * @param No Malus Recruit Lose Message * @desc Defines message displayed if malus after recruit missed * isn't activated. %1 = Enemy name * Default: %1 évalue la situation. * @default %1 évalue la situation. * * @param Malus Recruit Same Monster Activation * @desc Activate the reduction of recruit skill effect of monster * already recruited. Default: Y (= activated, else = deactivated) * @default Y * * @param Rate Malus Recruit Same Monster * @desc Define how the recruit skill effect is reduced after each recruit * success of the monster aimed. Default: 100 * @default 100 * * @param Rate Max Malus Recruit Same Monster * @desc Define the max reduction of recruit skill effect aiming a same * monster many times. Default: 800 * @default 800 * * @param Fight Number To Reset Malus Recruit * @desc Define how many fight you have to win to reset the reduction * of recruit skill effect aiming a same monster. Default: 100 * @default 100 * * @param ---Tension--- * @default * * @param Tension Name * @desc Defines the command 'Tension' name in the game * Default: Tension * @default Tension * * @param Tension Message Use * @desc Defines the message displayed when the skill 'Tension' is used * Default: utilise Tension * @default utilise Tension * * @param Tension List Level * @desc Defines all levels of tension * the negative levels are automatically defined with positive levels * Default: 5,20,50,100 * @default 5,20,50,100 * * @param Tension Message Result * @desc Defines the message displayed to see the new level of tension * %1 : new level of tension * Default: Sa tension passe à %1 * @default Sa tension passe à %1 * * @param Tension Message Too High * @desc Defines the message displayed when the tension is up but has already * reached highest limit * Default: Sa tension était déjà au maximum * @default Sa tension était déjà au maximum * * @param Tension Message Too Low * @desc Defines the message displayed when the tension is down but has already * reached lowest limit * Default: Sa tension ne peut pas descendre plus bas * @default Sa tension ne peut pas descendre plus bas * * @param Tension Formula Damage * @desc Defines the formula used to evaluate atk, def, mat and mdf of an actor * with the tension as new parameter * %1 : default value of param * Default: %1 * (1 + 4*%2/100) * @default %1 * (1 + 4*%2/100) * * @param ---Synthesis--- * @default * * @param Synthesis order name * @desc Defines the command 'Synthesis' name in the game * Default: Synthétiser * @default Synthétiser * * @param Display No Monster Selected Synthesis * @desc Defines the message displayed in the screen for the Synthesis Scene * for elements which are not already selected. * Default: Veuillez sélectionner un monstre à synthétiser! * @default Veuillez sélectionner un monstre à synthétiser! * * @param Special Synthesis Only * @desc Defines how the result list of synthesis are generated * if Y, if a synthesis has a special result, classic results are not * added in the list. * else, all results of a synthesis, classic and special, are added in the list. * Default: N * @default N * * @param Min Level To Be Used In Synthesis * @desc Defines the minimum level for monsters to be used in synthesis actions * Default: 10 * @default 10 * * @param Rank Value Addable * @desc Defines how the rank value added for the result of a synthesis is computed * if Y, the sum of two monsters used in the synthesis is given to the new monster. * else, the max of two monsters used in the synthesis is given to the new monster. * In each case, this value + 1 is assigned to the result * Default: Y * @default Y * * @param Third Classic Result Definable * @desc Defines if the class of the third classic result of synthesis is * defined by parameters or not. Default: N (= automatic, Y = by parameter) * @default N * * @param Third Classic Result Definition * @desc Defines how the class of the third classic result of synthesis is * defined (class of 1st monster + class of 2nd monster = class of 3rd result) * @default 1+2=3,1+3=4,1+4=5,1+5=6,1+6=7,1+7=2,2+3=5,2+4=6,2+5=7,2+6=1,2+7=3,3+4=7,3+5=1,3+6=2,3+7=4,4+5=2,4+6=3,4+7=5,5+6=4,5+7=6,6+7=1 * * @param Cap Change Level Max * @desc Defines all minimum values of Rank Added Value to reach in order to * raise the maximum level of a monster * each value are separated by the character , * the max level reachable after this rank values are defined by the parameter 'Value Change Level Max' * Default: 0,5,10 * @default 0,5,10 * * @param Value Change Level Max * @desc Defines all levels max available, according to the monster's rank value Added * each value are separated by the character , * the minimum value of rank value Added to reach in order to have these level max * are defined by the parameter 'Cap Change Level Max' * Default: 50,75,100 * @default 50,75,100 * * @param Rate Synthesis Param Plus * @desc Define the rate of params inherited from parents in a synthesis * Default: 25 * @default 25 * * @param Rate Synthesis Job Points Assigned * @desc define the rate of job points assigned inherited (synthesis) * Default: 50 * @default 50 * * @param Rate Synthesis Job Points Free * @desc define the rate of free job points inherited (synthesis) * Default: 25 * @default 25 * * @param Synthesis Result Message * @desc define the message displayed when a synthesis is executed. * Default: Vous avez obtenu un %1. (%1 : name of monster created) * @default Vous avez obtenu un %1. * * @param Synthesis Name Input Message * @desc Define the message displayed to request a change name to the player * Default: Veuillez lui donner un nom. (%1 : name of monster created) * @default Veuillez lui donner un nom. * * @param Synthesis Animation Id * @desc Define the animation used for synthesis scene * Default: 120 (Id of an animation) * @default 120 * * @param Synthesis Back Sprite 1 * @desc Define the background sprite used for the synthesis (under sprite) * Default: * @default * * @param Synthesis Back Sprite 2 * @desc Define the background sprite used for the synthesis (above sprite) * Default: * @default * * @param Synthesis Wait Start * @desc Define the waiting time before the synthesis animation * Default: 50 * @default 50 * * @param Synthesis Wait Speed * @desc Define the taken time to execute the synthesis animation * Default: 80 * @default 80 * * @param Synthesis Wait End * @desc Define the waiting time after the synthesis animation * Default: 80 * @default 80 * * @param ---Auto-Attack--- * @default * * @param Auto Attack Text Party * @desc Defines the automatic attack command for the party * Default: Auto Attack * @default Auto Attack * * @param Auto Attack Text Actor * @desc Defines the automatic attack command for the actor * Default: Auto Attack * @default Auto Attack * * @param ---Strategy--- * @default * * @param Strategy Name * @desc Defines the command name to display the strategy selection window * default: Stratégie * #default Stratégie * * @param Strategy List * @desc Defines all strategy names displayed in the screen * each value are separated by the character , * #1 : no strategy defined, the user launches a skill randomly * #2 : define the priority on offensive skills * #3 : define the priority on skills which gives HP and MP to allies * #4 : define the priority on skills which gives buffs and status to allies * #5 : define the priority on skills which gives debuffs and status to enemies * #6 : define the priority on skills which don't consume HP, MP or TP. * Default: Aucune,Berserker,Soigneur,Soutien,Sournois,Pas de gaspillage * @default Aucune,Berserker,Soigneur,Soutien,Sournois,Pas de gaspillage * * @param ---Books--- * @default * * @param Book List Name Command * @desc Define the command name to display the book list menu * Default: Bibliothèque * @default Bibliothèque * * @param Book Skillset Book Name Command * @desc Define the command name to display the skillset book * Default: Compétences * @default Compétences * * @param Resistance State Name * @desc Define the text displayed to show the bonus resistance to a state * by mastering skillset * %1 : State name * %2 : Bonus resistance * Default: Rés. %1+%2 * @default Rés. %1+%2 * * @param Resistance Debuff Name * @desc Define the text displayed to show the bonus resistance to a debuff * by mastering skillset * %1 : Parameter name * %2 : Bonus resistance * Default: Rés. debuff %1+%2 * @default Rés. debuff %1+%2 * * @param Resistance Element Name * @desc Define the text displayed to show the bonus resistance to a element * by mastering skillset * %1 : Element name * %2 : Bonus resistance * Default: Rés. %1+%2 * @default Rés. %1+%2 * * @param Unknown Level * @desc Define the text displayed in the skillset book, when the * job points' level is never reached for the skillset displayed * Default: ??? * @default ??? * * @param Monster Book Name Command * @desc Define the command name to display the monsters book * Default: Monstres * @default Monstres * * @param Attribute Book Name Command * @desc Define the command name to display the attributes book * Default: Attributs * @default Attributs * * @param Display Attribute Without Conditions * @desc Define the text displayed in the attribute book, above the * list of monsters which has always these attributes activated * Default: Maîtrise naturellement l'attribut * @default Maîtrise naturellement l'attribut * * @param Display Attribute Condition Level Synthesis * @desc Define the text displayed in the attribute book, above the * list of monsters which masters these attributes if they're results * of at least x synthesis * %1 : Min. value of rank value added * Default: Après %1 synthèses * @default Après %1 synthèses * * @param Display Attribute Condition Group Class * @desc Define the text displayed in the attribute book, above the * list of monsters which masters these attributes if they're results * of a monster mastering the same attribute, of the group class given * %1 : Group class name (defined by the parameter 'Class Group List' * Default: Après synthèse avec un monstre de la famille %1 * @default Après synthèse avec un monstre de la famille %1 * * @param Display Attribute Condition Size Class * @desc Define the text displayed in the attribute book, above the * list of monsters which masters these attributes if they're results * of a monster mastering the same attribute, of the size class given * %1 : Size class name (defined by the parameter 'Size Group List' * Default: Après synthèse avec un monstre de taille %1 * @default Après synthèse avec un monstre de taille %1 * * @param Display Attribute Condition Rank Class * @desc Define the text displayed in the attribute book, above the * list of monsters which masters these attributes if they're results * of a monster mastering the same attribute, of the rank class given * %1 : Rank class name (defined by the parameter 'Rank Group List' * Default: Après synthèse avec un monstre de rang %1 * @default Après synthèse avec un monstre de rang %1 * * @param Display Attribute Condition Skillset * @desc Define the text displayed in the attribute book, above the * list of skillsets which allows monsters to master these attributes * Default: Via maîtrise de compétence * @default Via maîtrise de compétence * * @param Display Monster Learnings Switch * @desc Define if the monster book contains at least one page about * learnings (Y = enabled, else = disabled) * @default Y * * @param Display Monster Learnings Name * @desc Define the text displayed in the monster book, above the * list of learnings of the class of the monster * @default Apprentissage * * @param Display Monster Location Switch * @desc Define if the monster book contains at least one page about * locations (Y = enabled, else = disabled) * @default Y * * @param Display Monster Location Name * @desc Define the text displayed in the monster book, above the * list of location where recruit of the monster is enabled. * @default Habitat * * @param Display Monster Attributes Switch * @desc Define if the monster book contains at least one page about * attributes (Y = enabled, else = disabled) * @default Y * * @param Display Monster Attributes Name * @desc Define the text displayed in the monster book, above the * list of attributes of the monster. * @default Attributs * * @param Display Monster Attributes Synthesis Condition * @desc Define the text used to define the condition necessary * to master this attribute, by using special synthesis * @default Synthèse * * @param Display Monster Synthesis Switch * @desc Define if the monster book contains at least one page about * synthesis formulas (Y = enabled, else = disabled) * @default Y * * @param Display Monster Synthesis Formula Name * @desc Define the text displayed in the monster book, above the * list of special synthesis to obtain this monster. * @default Synthèses * * @param Display Monster Synthesis etc * @desc Define the text displayed in the monster book, below the * list of special synthesis to obtain this monster, to say * that there is others formulas to obtain this monster * @default et plus... * * @param Unknown Data * @desc Define the text displayed in the books, when the data is * unknown * Default: ?????? * @default ?????? * * @param ---Skillsets--- * @default * * @param Display Added Skillset Result * @desc Define the text displayed after adding job points to a skillset, * allowing actor to learn a skill * %1 : Actor name * %2 : Skill name * Default: %1 a appris la compétence %2 * @default %1 a appris la compétence %2 * * @param Display Added Job Points On Skillset Result * @desc Define the text displayed after adding job points to a skillset, * display the job points used * %1 : Actor name * %2 : Job Points used * %3 : Skillset name * Default: %1 a utilisé %2 points de compétences sur la compétence %3 * @default %1 a utilisé %2 points de compétences sur la compétence %3 * * @param Display Obtain Attribute Result * @desc Define the text displayed after adding job points to a skillset, * allowing actor to master an attribute * %1 : Actor name * %2 : Attribute name * Default: %1 a acquis l'attribut %2 * @default %1 a acquis l'attribut %2 * * @param Display Param Bonus Added Result * @desc Define the text displayed after adding job points to a skillset, * improving parameters of an actor * %1 : Parameter name * %2 : Actor name * %3 : Bonus value * Default: %1 de %2 augmente de %3 points * @default %1 de %2 augmente de %3 points * * @param Display Element Resist Raised Result * @desc Define the text displayed after adding job points to a skillset, * improving element resistance of an actor * %1 : Actor name * %2 : Element name * %3 : Bonus value * Default: La résistance de %1 à l'élément %2 augmente de %3% * @default La résistance de %1 à l'élément %2 augmente de %3% * * @param Display State Resist Raised Result * @desc Define the text displayed after adding job points to a skillset, * improving state resistance of an actor * %1 : Actor name * %2 : State name * %3 : Bonus value * Default: La résistance de %1 au statut %2 augmente de %3% * @default La résistance de %1 au statut %2 augmente de %3% * * @param Display Debuff Resist Raised Result * @desc Define the text displayed after adding job points to a skillset, * improving debuff resistance of an actor * %1 : Actor name * %2 : Parameter name * %3 : Bonus value debuff resistance * Default: La résistance de %1 au debuff %2 augmente de %3% * @default La résistance de %1 au debuff %2 augmente de %3% * * @param Display Mastering Skillset Result * @desc Define the text displayed after adding job points to a skillset, * when a skillset is mastered * %1 : Actor name * %2 : Skillset name * Default: %1 a complètement maitrisé la compétence %2 * @default %1 a complètement maitrisé la compétence %2 * * @param Skillset Confirm * @desc Define the text displayed in the command to confirm skillset selection * Default: Accepter * @default Accepter * * @param Skillset To Remove List * @desc Define the name displayed above the list of skillset not remained by the actor * Default: Compétences à ajouter * @default Compétences à ajouter * * @param Skillset To Add List * @desc Define the name displayed above the list of skillset remained by the actor * Default: Compétences ajoutées * @default Compétences ajoutées * * @param ---Status screen--- * @default * * @param Result Resist Value Steps * @desc Define all range values of texts displayed to define resistances list of an actor. * Each value are separated by the character , * The text displayed is defined by the parameter 'Result Resist Message Steps' * Default: 0,0,100,100 * @default 0,0,100,100 * * @param Result Resist Message Steps * @desc Define the text displayed to define resistances list of an actor * Each value are separated by the character ; * The text displayed is selected as follows : * 1st text : lower than 1st value of 'Result Resist Value Steps' * 2nd text : between 1st and 2nd values of 'Result Resist Value Steps' * 3rd text : between 2nd and 3rd values of 'Result Resist Value Steps' * ... * last text : higher than last value of 'Result Resist Value Steps' * %1 : Element name/State name/"Debuff", followed by parameter name/Damage type name * These values used to select the text to display is defined by the parameter 'Result Resist Value Steps' * Default: Absorbe %1;Insensible à %1;Résistant à %1;;Faible face à %1 * @default Absorbe %1;Insensible à %1;Résistant à %1;;Faible face à %1 * * @param Display Resistance Name * @desc Define the text displayed above resistance list of an actor * Default: Résistances * @default Résistances * * @param Display Synthese Historical Name * @desc Define the text displayed above the historic of all synthesis of an * actor * Default: Historique des synthèses * @default Historique des synthèses * * @param Display Sparam Name * @desc Define the text displayed to define physical skills and magic skills * both names are separated by the character , * the first part is for physical skills * the second part is for magic skills * Default: attaque physique,attaque magique * @default attaque physique,attaque magique * * @help * ============================================================================ * Introduction and Instructions * ============================================================================ * * DQM_Plugins is made for RPG Maker MV. This plugin functions * primarily to recreate functionalities from Dragon Quest Monsters. * * ============================================================================ * Actors and Enemies * ============================================================================ * In Dragon Quest Monsters, enemies encountered in the game and playable * actors are the same thing : you can recruit enemies encountered and add them * in your team. After that, it's possible to reinforce your troop with new * monsters, using those that you have already. That's why this plugin changes * the core system. * * Monsters and Classes create a same thing in the database. The sprite used * by actor's classes in battle is the same than the monster linked to the * class. * * You have to define also a sprite face for classes. The face sprite of a * class is used by all actors of this class, instead of the actor's face * sprite. * * For the map, the character sprite of the first actor is used all along the * game to represent the player in all maps. * * ============================================================================ * Families, Rank and Sizes * ============================================================================ * Every monsters in Dragon quest monsters are sorted in three different * classement : the family, the rank and the size. * * A family of monsters are generally defined by a same characteristic. In * Dragon Quest, generally, there are, as existing families, Slimes, Dragons, * Beast, Natural, Material, Demon, Undead and Unknown. The Unknown family * contains merely specials monsters or bosses from previous games of * Dragon quest * * After this comes the Rank. A rank define the basic power of a monster : * more their rank are high, quicker their basic parameters rise up. But it * doesn't mean the monsters with highest rank are always the best : this is * only the speed of bonus points obtained by level up which is different : * Even a slime properly prepared can defeat an Estark without preparations. * * And finally comes the Size. Some monsters are higher than others and takes * more places in your team, reducing the number of battle members. In order * to make the system well-balanced, these monsters have always higher stats * than the mean of monsters. For example, the monsters as Estark take 3 places * in your team, while other monsters as Sea Dragons takes only 2 places and, * finally, monsters as Slimes take only 1 place. * * ============================================================================ * Tension Skill * ============================================================================ * This is a particular skill in Dragon Quest Monsters : When used, the user * rises up this tension, leveling up its attack and resistance. The tension * is always reset to level 0 at the start of the battle, at the end of a * battle, and at each end of turn, for each battler which has attacked or * defended as last action. * * ============================================================================ * Recruit skill * ============================================================================ * A particular skill is used in Dragon Quest Monsters : the Recruit Skill. * When used, all members of your team launch a "false" classic attack. After * the last attack, the target can join your team, according to the result * of your demonstrations. * * In the case where the recruit try misses, the enemies has a chance to * get excited and level up their tension. In this case, the recruit can't * be selected for the following turns. * * The recruit is automatically cancelled if one of the members of the enemy * team hasn't a level, you can't escape the fight or you can't add a new * monster to your Stockage System * * ============================================================================ * Automatic actions and strategy * ============================================================================ * It occurs at many times that we want to leave our monsters to choose itself * their actions for this turn. * * This plugin includes the strategy system and auto-attack. * When selected, your monsters select all available actions, sort them by * efficiency and select randomly the action to use, with 50% for the best * action, 25% for the second, 12,5% for the third, and so forth. * * There are 6 strategies defined in this plugin : * * 1) A default strategy, selecting all skills with the same importance. * 2) A offensive strategy, giving the priority to skills inflicting damage * to Hp. * 3) A healing strategy, giving the priority to skills regenerating Hp and Mp * from allies, remove state and debuff. * 4) A helping strategy, giving the priority to skills adding buffs and states * to allies. * 5) A reducer strategy, giving the priority to skills removing buffs, adding * debuffs, adding and removing states to enemies. * 6) A classic strategy, forbidding all skills using Mp or Tp. * * ============================================================================ * Synthesis * ============================================================================ * The synthesis is the main caracteristic of Dragon quest Monsters games : * Using two monsters in your team, you can create another monster, stronger * than the used monsters. * * Furthermore, some combined monsters give access to special or exclusive * species which can't be found in another way, as bosses encountered or * high-rank monsters. * * Each synthesis rise up a counter in the obtained monster. After many * synthesis, the obtained monster gain access to new skills, rises up the * max level, and some others things... * * ============================================================================ * Attributes * ============================================================================ * Attributes are a particular characteric of Dragon Quest Monsters games : * These are special natives capacities with various effects taking place * during battle. Here are some examples of all possibilities : * * - Rise up the damage inflicted to enemies with skills of some type/element * - Reduces MP consumption of skills of some type/element * - Reduces resistances to element / state / debuff for all enemies * - Rise up/Reduce stats, as Max HP, of the actor * - Rise up experience, gold and/or object obtained at the end of a battle * - Adds skills to the list usable by the actor * - Execute automatically some actions at begin and end of the battle/turn/ * action * - Rises up to 100% the escape chance during a battle * - Gives to the actor the access to any type of weapons * - Add effects inflicting state to targets with normal attacks * - Physical/Magical attacks aiming one target touch all targets instead * - Rises up or reduces priority in battle turn * - Rises up effects of Recruit skill * - Adds more actions per turn for the actor * - Adds automatically a state at the begin of the battle to the actor, * for one of many turns, or for a time unlimited * - Cancel effects of some attributes of all enemies * * If each monster has some attributes by default, others attributes are * unlocked for these monsters after a certain amount of synthesis, or after * a synthesis with a monster of a certain family / rank / size. * * Definition of attributes are given in the database in the window Skills * * ============================================================================ * Skillsets * ============================================================================ * * Skillsets in Dragon Quest Monsters are skill trees which aren't unique or * known only by specific monster species : The skillsets can be given to other * monsters by object or others means. * * Each monster can master up to 3 different skillsets. Monsters with a Size * higher can master 1 skillset in addition by supplementary place taken * (monster taking 2 places can master 4 skillsets, those taking 3 places, * 5 skillsets, ...) * * These skillsets give to the owner new skills to use in and out of battle, * but also stats bonus, debuff resistance and state resistance and attributes * * When a skillset is mastered, during a synthesis, new skillsets can be * unlocked by combining some skillsets mastered or only with a skillset * mastered * * Definition of skillsets are given in the database in the window Classes * * ============================================================================ * Parameters * ============================================================================ * * ---------------------------------------------------------------------------- * 1) Parameters System * ---------------------------------------------------------------------------- * * Max Size Team * ----------------------------- * Adjusts the maximal number of members of battle team and all supplementary * teams. * Default Value = 4 * * * Max Supplementary Team * ---------------------------- * Define the number of supplementary teams usable in main menu. The * supplementary teams can be taken in the adventure with your battle team. * You can then exchange members of battle and supplementary teams at any time * * Special value : -1 => In that case, your can take members of your stockage * system and exchange them with the battle team at any time. That's why there * aren't any supplementary teams in that case, but only your battle team and * your stockage system. * * Default Value = 0 (= no supplementary team) * * * Name Main Team * ----------------------------- * Define the name of the battle team showed in the screen "Formation" * * Default Value = Equipe * * * Name Supplementary Team * ----------------------------- * Define the name of supplementary teams showed in the screen "Formation" * * Default Value = Réserve * * * Name Stockage System * ----------------------------- * Define the name of your stockage system of your monsters. Unlike the * supplementary teams, the stockage system is not available in the main menu. * To have access to it, you have to open the Main Menu by command event, or * by the command plugin below, which can use or manage your monsters. * * NOTE : If the parameter "Max Supplementary Team" is set to -1, then, * the stockage system is available even in the classic main menu (then, * opened in pressing the button Start) * * Default Value = Stockage * * * Max Battlers * ----------------------------- * Define the maximum of monsters recruitable and addable to your stockage * system. This limit is effective only for stockage system, and then, isn't * affected by the members of battle and supplementary teams. Moreover, this * limit isn't affected by the size of your monsters. * * Example : if this limit is set to 100 (and the parameter * Max Supplementary Team at 1 + Max Size Team at 4), that means you can have * at most 100 monsters in your monsters + 4 monsters in your battle team + * 4 monsters in your unique supplementary team => 108 monsters at most. * * Special Value = 0 : in that case, the stockage system is infinite. You can * add several thousands of monsters in it, without fill it up entirely. * * Default Value = 0 * * * Synthesis Access Main Menu * ------------------------------- * Defines if the command Synthesis is added to the main menu opened by * any way. That means by pressing the button "Start", but also by * event command. * * NOTE : the synthesis menu cannot take any monsters in your stockage system * if the main menu is opened by the button "Start" and if the stockage system * is not available in this way (Max Supplementary Team different of -1) * * Possible values : Y -> this menu is enabled. * Any other value -> This menu is disabled. * * * BookList Access Main Menu * ------------------------------- * Defines if the command BookList is added to the main menu opened by * any way. That means by pressing the button "Start", but also by * event command. * * Possible values : Y -> this menu is enabled. * Any other value -> This menu is disabled. * * * Rename Access Main Menu * ------------------------------- * Defines if the command Rename is added to the main menu opened by * any way. That means by pressing the button "Start", but also by * event command. * * Possible values : Y -> this menu is enabled. * Any other value -> This menu is disabled. * * * Synthesis Access Main Menu Event * ------------------------------- * Defines if the command Synthesis is added to the main menu opened by * event command only. * * NOTE : opened by this way, the synthesis menu can take access to the * stockage system. This is the same way as the synthesis menu is displayed * directly by command plugin below. Note that if the parameter * "Synthesis Access Main Menu" is enabled, then this parameter haven't any * effect. * * Possible values : Y -> this menu is enabled. * Any other value -> This menu is disabled. * * BookList Access Main Menu Event * ------------------------------- * Defines if the command Booklist is added to the main menu opened by * event command only. * * NOTE : If the parameter "Booklist Access Main Menu" is enabled, then * this parameter haven't any effect. * * Possible values : Y -> this menu is enabled. * Any other value -> This menu is disabled. * * * Rename Access Main Menu Event * ------------------------------- * Defines if the command Rename is added to the main menu opened by * event command only. * * NOTE : If the parameter "Rename Access Main Menu" is enabled, then * this parameter haven't any effect. * * Possible values : Y -> this menu is enabled. * Any other value -> This menu is disabled. * * * Rename Main Menu Name * ------------------------------- * Defines the command name in the main menu to access to the Rename Menu. * * Default Value : "Renommer" * * * Message Get New Actor * -------------------------------- * Defines the text displayed when you received a new monster. This message * is displayed when a gift of a monster is * completed. * * Parameter list of message : * %1 => name of the monster obtained. * * Default Value = "Vous avez reçu un %1 !" * * * Display Name Player * -------------------------------- * Defines the text displayed to describe the name of the player. * * Default Value = "Nom" * * * Display Book Data As Percent * -------------------------------- * Defines if the data of books is showed as percent or as value/max. * * Possible values : Y -> displayed as percent. * Any other value -> displayed as value/max. * * * Display Result Monster Encountered * -------------------------------- * Defines the text displayed to describe the number of * monster encountered * * Default Value = "Monstres rencontrés" * * * Display Result Monster Recruited * -------------------------------- * Defines the text displayed to describe the number of * monster recruited * * Default Value = "Monstres capturés" * * * Display Result Skillset Discovered * -------------------------------- * Defines the text displayed to describe the number of * skillsets discovered * * Default Value = "Compétences découvertes" * * * Display Result Skillset Mastered * -------------------------------- * Defines the text displayed to describe the number of * skillsets mastered * * Default Value = "Compétences maîtrisés" * * * Display Result Attribute Discovered * -------------------------------- * Defines the text displayed to describe the number of * attributes discovered * * Default Value = "Attributs découverts" * * * Gender Actor List * -------------------------------- * @desc Define the symbol used for each available genders * each values have to be separated by the character "," * this parameter has to have 3 values exactly and has a assignment * like this : female,hybride,male * * NOTE : the characters +- or -+ have a special display. * * Default Value = "-,+-,+" * * * Gender Actor Label * -------------------------------- * Define the label used in screen to describe gender of a monster. * This label is showed only in "Status" screen. * * Default Value = "Genre" * * * Hit Default * -------------------------------- * Define the default value of extra parameter Hit of all battlers. * You can use this if you want to define a general hit rate for all * monsters, to replace the trait "Hit rate" of classes and monsters. * * Default Value = 0 * * * Critical Default * -------------------------------- * Define the default value of extra parameter Critical Magic rate * and Physical rate of all battlers. * You can use this if you want to define a general critical rate for all * monsters, to replace the traits "Critical Magic rate" and * "Critical Physical rate" of classes and monsters. * * Default Value = 0 * * * Evasion Default * -------------------------------- * Define the default value of extra parameter Evasion Magic rate * and Physical rate of all battlers. * You can use this if you want to define a general critical rate for all * monsters, to replace the traits "Evasion Magic rate" and * "Evasion Physical rate" of classes and monsters. * * Default Value = 0 * * * Weapon Default * -------------------------------- * Define the default weapon type id that any monster can equip. Like in * Dragon Quest Monster, there exist a weapon type that any monster can use, * the wand. * * Special value : 0 => There isn't any weapon type which can be equippable * by all monsters. * * Default Value = 0 * * * Rate Exp Battle Team * -------------------------------- * Define the rate of experience acquired by monsters in your battle * team at the end of each battle. * * Default Value = 100 * * * Rate Exp Sup Team * -------------------------------- * Define the rate of experience acquired by monsters in your supplementary * teams at the end of each battle. * * Default Value = 50 * * * Rate Exp Stockage * -------------------------------- * Define the rate of experience acquired by monsters in your stockage * system at the end of each battle. * * Default Value = 20 * * * Rate Skillsets Enemy * -------------------------------- * Define the rate speed at which a monster masters its skillsets. * this rate is defined according to current level / Max level reachable. * if the parameter is < 100, the monster evolves faster. * if the parameter is > 100, the monster evolves lower. * * Example : the max level reachable is set to 100 * this parameter is set to 60 * Then : * current level = 15 => 25% of job points of its skillsets are assigned * current level = 30 => 50% of job points of its skillsets are assigned * current level = 45 => 75% of job points of its skillsets are assigned * current level = 60 or more => all its skillsets are mastered * * Default Value = 80 * * * Rate Resistances Enemy * -------------------------------- * Define the rate speed at which a monster gains all its resistances up. * this rate is defined according to current level / Max level reachable. * if the parameter is < 100, the monster evolves faster. * if the parameter is > 100, the monster evolves lower. * * Example : the max level reachable is set to 100 * this parameter is set to 60 * the monster have 4 resistances which it can gain by synthesis. * Then : * current level = 15 => 1 of its resistances up is gained * current level = 30 => 2 of its resistances up are gained * current level = 45 => 3 of its resistances up are gained * current level = 60 or more => all its resistances up are mastered * * Default Value = 80 * * * Rate Attributes Enemy * -------------------------------- * Define the rate speed at which a monster gains all its supplementary * attributes. * All basic attributes are always assigned. * this rate is defined according to current level / Max level reachable. * if the parameter is < 100, the monster evolves faster. * if the parameter is > 100, the monster evolves lower. * * Example : the max level reachable is set to 100 * this parameter is set to 60 * the monster have 1 basic attribute, among 5 of all attributes * obtainable naturally * Then : * current level = 0 => only the basic attribute is used. * current level = 15 => 1 more attribute is obtained. * current level = 30 => 2 more attributes are obtained. * current level = 45 => 3 more attributes are obtained. * current level = 60 or more => all its attributes are obtained. * * Default Value = 80 * * * Rate Level Enemy * -------------------------------- * Define the rate speed at which a monster level up and gains bonus stats. * this rate is defined according to current level / Max level reachable. * if the parameter is < 100, the monster evolves faster. * if the parameter is > 100, the monster evolves lower. * * Example : the max level reachable is set to 100 * this parameter is set to 60 * Then : * current level = 15 => its params is set to 25% of its max values * current level = 30 => its params is set to 50% of its max values * current level = 45 => its params is set to 75% of its max values * current level = 60 or more => its params is set to its max values * * Default Value = 80 * * * Critical Effect Application * -------------------------------- * Define how the critical affects the value of damage inflicted * * Possible values : Y -> if a hit is critical, rise up the params of the * attacker. * Any other value -> if a hit is critical, rise up the damage of the * action. * * * Rate Critical Effect * -------------------------------- * Define the rate of bonus added to the params, or the damage, when * a hit is critical. * * Default Value = 300 * * * Length Name Actor * -------------------------------- * Define the length max allowed for the name of new monsters obtained by * recruit, synthesis or by gifts. * * Default Value = 12 * * * ---------------------------------------------------------------------------- * 2) Classes * ---------------------------------------------------------------------------- * * Class Group List * -------------------------------- * Defines the name of groups of all classes existing in the game. * each name are separated by the characters "," * The first group of classes is the default group * The last group of classes is special : all classes of this group cannot * be obtained by classic synthesis. * * Default Value = "Gluant,Dragon,Bête,Nature,Matière,Démon,Mort-Vivant,Inconnu" * * * Class Group Label * -------------------------------- * Defines the label used in "Status" and "Book Monster" screen to * describe class' groups. * * Default Value = "Famille" * * * Class Size List * -------------------------------- * Defines the complete name of size of all classes existing in the game. * each name are separated by the characters "," * The first name matches with monsters taking 1 place * The second name matches with monsters taking 2 places * and so forth... * * Default Value = "Petit,Moyen,Grand,Géant" * * * Class Size List Icon * -------------------------------- * Defines the small name of size of all classes existing in the game. * each value are separated by the characters "," * * Default Value = "S,M,G,SG" * * * Class Size Label * -------------------------------- * Defines the label used in "Status" and "Book Monster" screen to * describe class' sizes. * * Default Value = "Taille" * * * Class Rank List * -------------------------------- * Defines the name of rank of all classes existing in the game. * each value are separated by the characters "," * This rank list is ordered from the least to the greatest. * * Default Value = "F,E,D,C,B,A,S,X" * * * Class Rank Label * -------------------------------- * Defines the label used in "Status" and "Book Monster" screen to * describe class' ranks. * * Default Value = "Rang" * * * ---------------------------------------------------------------------------- * 3) Job Points * ---------------------------------------------------------------------------- * * Level Job Points Add * -------------------------------- * Defines the levels where the actor gains Job Points. * each value are separated by the characters "," * Value of job points added are given in parameter "Value Job Points Add" * * Default Value = "2,5,8,10,12,15,18,20,22,25,28,30,32,35,38,40,42,45,48,50,52,55,58,60,62,65,68,70,72,75,78,80,82,85,88,90,92,95,98,100" * * * Value Job Points Add * -------------------------------- * Defines the quantity of Job Points the actor gains when level up. * each value are separated by the characters "," * Level when theses job points are added are defined in parameter * "Level Job Points Add" * * Default Value = "5,8,5,7,5,5,4,4,5,5,4,3,4,4,3,5,2,3,5,5,3,2,3,5,3,3,4,3,2,2,5,3,4,2,3,2,4,4,3,5" * * * Job Points Name * -------------------------------- * Defines the name of Job Points in the game * * Default Value = "Point de compétence" * * * Job Points Icon * -------------------------------- * Defines the icon of Job Points in the game * * Default Value = PC * * * Display Gain Job Points * -------------------------------- * Defines the text to display when an actor gains x job points, by * level up or using an object. * * Parameter list message : * %1 = actor name * %2 = job Points obtained * * Default Value = "%1 a gagné %2 points de compétences." * * * ---------------------------------------------------------------------------- * 4) Recruit * ---------------------------------------------------------------------------- * * Recruit order name * -------------------------------- * Defines the command 'Recruit' name in the game, displayed in * the first command screen during a battle. * * Default Value = Recruter * * * Recruit Message Use * -------------------------------- * Defines the message displayed when an actor uses the skill 'Recruit'. * This message has the same properties than the message displayed for any * skill in the database. * * Default Value = " exécute une démonstration de force!" * * * Recruit Formula * -------------------------------- * Defines the formula uses to calculate the bonus rate of an 'Recruit' attack. * This formula has the same code than those used in the formula for others * skills. * The result obtained is used not as damage, but as a rise up of the chance * to recruit the target. * * Default Value = "(a.atk * 4 - b.def * 2)*(1/2)" * * * Recruit Gauge Positions * -------------------------------- * Defines the position in battle screen of the gauge filled * up by 'Recruit skills * The parameters are separated by the character "," * From left to right => coordinate horizontal, coordinate vertical, length of * the gauge. * * Default Value = "0,70,120" * * * Recruit Message Text * -------------------------------- * Defines all messages displayed after 'Recruit' skill * use, according to the bonus Rate added. * each message are separated by the characters ";," * * Values ranges of these messages are defined in * parameter "Recruit Message Value Min" * * Parameter message list : * %1 = Actor name * * Default Value = "%1 n\'est pas du tout impressioné;,%1 n\'est pas très impressioné;,%1 est un peu impressioné;,%1 est très impressioné" * * * Recruit Message Value Min * -------------------------------- * Defines all minimal values to reach in order to display messages matching. * each value are separated by the characters "," * Messages displayed according to these values are * defined in parameter "Recruit Message Text" * * Default Value = "0,1,10,30" * * * Recruit Check Message * -------------------------------- * Defines message displayed after all actors has used the "Recruit" skill * * Parameter message list : * %1 = Enemy name * * Default Value = "%1 réfléchit..." * * Recruit Win Message * -------------------------------- * Defines message displayed if the monster is recruited * * Parameter message list : * %1 = Enemy name * * Default Value = "%1 se décide à rejoindre votre équipe." * * * Recruit Win Insert Team Message * -------------------------------- * Defines message displayed if the monster is sended in a team * * Parameter message list : * %1 = Enemy name * %2 = Team name * * Default Value = "%1 intègre votre %2." * * * Recruit Win Insert System Message * -------------------------------- * Defines message displayed if the monster is not sended in a team * * Parameter message list : * %1 = Enemy name * * Default Value = "%1 est envoyé dans votre système de stockage." * * * Recruit Lose Message * -------------------------------- * Defines message displayed if the monster isn't recruited * * Parameter message list : * %1 = Enemy name * * Default Value = "Le dressage a échoué" * * * Malus Recruit Lose Chance * -------------------------------- * Defines the chances of a malus if the recruit try is missed * * Default Value = 30 * * * Malus Recruit Lose Message * -------------------------------- * Defines message displayed if malus after recruit missed is activated * * Parameter message list : * %1 = Enemy name * * Default Value = "Les ennemis se vexent." * * * No Malus Recruit Lose Message * -------------------------------- * Defines message displayed if malus after recruit missed * isn't activated. * * Parameter message list : * %1 = Enemy name * * Default Value = "%1 évalue la situation." * * * Malus Recruit Same Monster Activation * -------------------------------- * Activate the reduction of recruit skill effect of monster * already recruited. * Each time the recruit of a monster is a success, the next time you try * to recruit the same monster, the effect of the "Recruit" skill is * reduced. * * Possible values : Y -> Malus activated * Any other value -> Malus disabled * * * Rate Malus Recruit Same Monster * -------------------------------- * Define how the recruit skill effect is reduced after each recruit * success of the monster aimed. * * Example : If the parameter is set to 50, * after 0 success of recruit of the monster => * 100 / (100 + 0) = 100% effect of recruit skill * after 1 success of recruit of the monster => * 100 / (100 + 50) = 66% effect of recruit skill * after 2 success of recruit of the monster => * 100 / (100 + 100) = 50% effect of recruit skill * and so forth... * * Default Value = 100 * * * Rate Max Malus Recruit Same Monster * -------------------------------- * Define the max reduction of recruit skill effect aiming a same * monster many times. * * Example : If the parameter is set to 100, * and the parameter "Rate Malus Recruit Same Monster" is set to 50 * after 0 success of recruit of the monster => * 100 / (100 + 0) = 100% effect of recruit skill * after 1 success of recruit of the monster => * 100 / (100 + 50) = 66% effect of recruit skill * after 2 success of recruit of the monster => * 100 / (100 + 100) = 50% effect of recruit skill * after 3 success of recruit of the monster => * 100 / (100 + 100) = 50% effect of recruit skill * and so forth... * * Default Value = 800 * * * Fight Number To Reset Malus Recruit * -------------------------------- * Define how many fight you have to win to reset the reduction * of recruit skill effect aiming a same monster. * * Default Value = 100 * * * ---------------------------------------------------------------------------- * 5) Tension * ---------------------------------------------------------------------------- * * Tension Name * -------------------------------- * Defines the command 'Tension' name in the game * * Default Value = "Tension" * * * Tension Message Use * -------------------------------- * Defines the message displayed when the skill 'Tension' is used * This message has the same properties than the message displayed for any * skill in the database. * * Default Value = " utilise Tension" * * * Tension List Level * -------------------------------- * Defines all levels of tension * Each value are separated by the character "," * the negative levels are automatically defined with positive levels * * Example : * if you define the values 5,10,50 * the complete list of tension level is -50,-10,-5,0,5,10,50 * * Default Value = "5,20,50,100" * * * Tension Message Result * -------------------------------- * Defines the message displayed to see the new level of tension * * Parameter message list : * %1 : new level of tension * * Default Value = "Sa tension passe à %1" * * * Tension Message Too High * -------------------------------- * Defines the message displayed when the tension is up but has already * reached highest limit * * Default Value = "Sa tension était déjà au maximum" * * * Tension Message Too Low * -------------------------------- * Defines the message displayed when the tension is down but has already * reached lowest limit * * Default Value = "Sa tension ne peut pas descendre plus bas" * * * Tension Formula Damage * -------------------------------- * Defines the formula used to evaluate atk, def, mat and mdf of an actor * with the tension as new parameter * * Parameter message list : * %1 : default value of param * * Default Value = "%1 * (1 + 4*%2/100)" * * * ---------------------------------------------------------------------------- * 6) Synthesis * ---------------------------------------------------------------------------- * * Synthesis order name * -------------------------------- * Defines the command 'Synthesis' name displayed in the Main Menu Screen. * * Default Value = "Synthétiser" * * * Display No Monster Selected Synthesis * -------------------------------- * Defines the message displayed in the screen for the Synthesis Scene * for elements which are not already selected. * * Default Value = "Veuillez sélectionner un monstre à synthétiser!" * * * Special Synthesis Only * -------------------------------- * Defines how the result list of synthesis are generated. Deactivate * the choice of classic results if a special synthesis is selectable. * * Possible values : Y -> Parameter enabled * Any other value -> Parameter disabled * * * Min Level To Be Used In Synthesis * -------------------------------- * Defines the minimum level for monsters to be used in synthesis actions. * Monsters with a lower level cannot be used for a synthesis. * * Default Value = 10 * * * Rank Value Addable * -------------------------------- * Defines how the rank value added for the result of a synthesis is computed. * In each case, the value obtained is risen up from 1 * * Possible values : Y -> the sum of rank value added of two monsters * used in the synthesis is given to the new monster. * * Example : 2 monsters with rank value added 3 and 2 * => the monster obtained by synthesis has, as rank value added, * (3 + 2) + 1 = 6 * * Any other value -> the max of rank value added of two monsters * used in the synthesis is given to the new monster. * * Example : 2 monsters with rank value added 3 and 2 * => the monster obtained by synthesis has, as rank value added, * Max(3,2) + 1 = 4 * * * Third Classic Result Definable * -------------------------------- * Defines if the group class of the third classic result of synthesis is * defined by parameters or not. * * Possible values : Y -> the group of the third classic result of * synthesis is defined by the parameter "Third Classic Result Definition" * Any other value -> the group of the third classic result of * synthesis is defined automatically * * * Third Classic Result Definition * -------------------------------- * Defines how the class of the third classic result of synthesis is * defined * Each formula is separated by the character "," * Is effective only if the parameter "Third Classic Result Definable" * is enabled. * the format used to compute the third group of class according to the * group of class of two monsters used for the synthesis. * "class of 1st monster + class of 2nd monster = class of 3rd result" * Define a sum define the inverse sum. * * Example : "1+4=3" => "4+1=3" is also defined * * Default Value = "1+2=3,1+3=4,1+4=5,1+5=6,1+6=7,1+7=2,2+3=5,2+4=6,2+5=7,2+6=1,2+7=3,3+4=7,3+5=1,3+6=2,3+7=4,4+5=2,4+6=3,4+7=5,5+6=4,5+7=6,6+7=1" * * * Cap Change Level Max * -------------------------------- * Defines all minimum values of Rank Added Value to reach in order to * raise the maximum level of a monster * each value are separated by the character "," * the max level reachable after this rank values are defined * by the parameter 'Value Change Level Max' * * Default Value = "0,5,10" * * * Value Change Level Max * -------------------------------- * @desc Defines all levels max available, according to the monster's rank value Added * each value are separated by the character "," * the minimum value of rank value Added to reach in order to have these level max * are defined by the parameter "Cap Change Level Max" * * Default Value = "50,75,100" * * * Rate Synthesis Param Plus * -------------------------------- * Define the rate of params inherited from parents in a synthesis * * Default Value = 25 * * * Rate Synthesis Job Points Assigned * -------------------------------- * define the rate of job points assigned inherited (synthesis) * * Default Value = 50 * * * Rate Synthesis Job Points Free * -------------------------------- * define the rate of free job points inherited (synthesis) * * Default Value = 25 * * * Synthesis Result Message * -------------------------------- * define the message displayed when a synthesis is executed. * * Parameter message list : * %1 : name of monster created * * Default Value = "Vous avez obtenu un %1." * * * Synthesis Name Input Message * -------------------------------- * Define the message displayed to request a change name to the player * * Parameter message list : * %1 : name of monster created * * Default Value = "Veuillez lui donner un nom." * * * Synthesis Animation Id * ------------------------------- * Define the animation used for synthesis scene * This animation must be defined in the database to be executed * * Default Value = 120 * * * Synthesis Back Sprite 1 * ------------------------------ * Define the background sprite used for the synthesis (under sprite) * Select one of your sprite name in your folder and paste its name to * use it. * * Default Value = '' * * * Synthesis Back Sprite 2 * ------------------------------ * Define the background sprite used for the synthesis (above sprite) * Select one of your sprite name in your folder and paste its name to * use it. * * Default Value = '' * * * Synthesis Wait Start * ------------------------------ * Define the waiting time before the synthesis animation * * Default Value = 50 * * * Synthesis Wait Speed * ------------------------------ * Define the taken time to execute the synthesis animation * * Default Value = 80 * * * Synthesis Wait End * ------------------------------ * Define the waiting time after the synthesis animation * * Default Value = 80 * * * ---------------------------------------------------------------------------- * 7) Auto-Attack * ---------------------------------------------------------------------------- * * Auto Attack Text Party * -------------------------------- * Defines the automatic attack command for the entire party * * Default Value = "Auto Attack" * * * Auto Attack Text Actor * -------------------------------- * Defines the automatic attack command for the actor * * Default Value = "Auto Attack" * * * ---------------------------------------------------------------------------- * 8) Strategy * ---------------------------------------------------------------------------- * * Strategy Name * -------------------------------- * Defines the command name to display the strategy selection window * * Default Value = "Stratégie" * * * Strategy List * -------------------------------- * Defines all strategy names displayed in the screen * each value are separated by the character "," * * #1 : no strategy defined, the user launches a skill randomly * #2 : define the priority on offensive skills * #3 : define the priority on skills which gives HP and MP to allies * #4 : define the priority on skills which gives buffs and status to allies * #5 : define the priority on skills which gives debuffs and status to enemies * #6 : define the priority on skills which don't consume HP, MP or TP. * * Default Value = "Aucune,Berserker,Soigneur,Soutien,Sournois,Pas de gaspillage" * * * ---------------------------------------------------------------------------- * 9) Books * ---------------------------------------------------------------------------- * * Book List Name Command * -------------------------------- * Define the command name to display the book list menu * * Default Value = "Bibliothèque" * * * Book Skillset Book Name Command * -------------------------------- * Define the command name to display the skillset book * * Default Value = "Compétences" * * * Resistance State Name * -------------------------------- * Define the text displayed to show the bonus resistance to a state * by mastering skillset * * Parameter message list : * %1 : State name * %2 : Bonus resistance * * Default Value = "Rés. %1+%2" * * * Resistance Debuff Name * -------------------------------- * Define the text displayed to show the bonus resistance to a debuff * by mastering skillset * * Parameter message list : * %1 : Parameter name * %2 : Bonus resistance * * Default Value = "Rés. debuff %1+%2" * * * Resistance Element Name * -------------------------------- * Define the text displayed to show the bonus resistance to a element * by mastering skillset * * Parameter message list : * %1 : Element name * %2 : Bonus resistance * * Default Value = "Rés. %1+%2" * * * Unknown Level * -------------------------------- * Define the text displayed in the skillset book, when the * job points' level is never reached for the skillset displayed * * Default Value = "???" * * * Monster Book Name Command * -------------------------------- * Define the command name to display the monsters book * * Default Value = "Monstres" * * * Attribute Book Name Command * -------------------------------- * Define the command name to display the attributes book * * Default Value = "Attributs" * * * Display Attribute Without Conditions * -------------------------------- * Define the text displayed in the attribute book, above the * list of monsters which has always these attributes activated * * Default Value = "Maîtrise naturellement l'attribut" * * * Display Attribute Condition Level Synthesis * -------------------------------- * Define the text displayed in the attribute book, above the * list of monsters which masters these attributes if they're results * of at least x synthesis * * Parameter message list : * %1 : Min. value of rank value added * * Default Value = "Après %1 synthèses" * * * Display Attribute Condition Group Class * -------------------------------- * Define the text displayed in the attribute book, above the * list of monsters which masters these attributes if they're results * of a monster mastering the same attribute, of the group class given * * Parameter message list : * %1 : Group class name (defined by the parameter 'Class Group List' * * Default Value = "Après synthèse avec un monstre de la famille %1" * @default Après synthèse avec un monstre de la famille %1 * * * Display Attribute Condition Size Class * -------------------------------- * Define the text displayed in the attribute book, above the * list of monsters which masters these attributes if they're results * of a monster mastering the same attribute, of the size class given * * Parameter message list : * %1 : Size class name (defined by the parameter 'Size Group List' * * Default Value = "Après synthèse avec un monstre de taille %1" * * * Display Attribute Condition Rank Class * -------------------------------- * Define the text displayed in the attribute book, above the * list of monsters which masters these attributes if they're results * of a monster mastering the same attribute, of the rank class given * * Parameter message list : * %1 : Rank class name (defined by the parameter 'Rank Group List' * * Default Value = "Après synthèse avec un monstre de rang %1" * * * Display Attribute Condition Skillset * -------------------------------- * Define the text displayed in the attribute book, above the * list of skillsets which allows monsters to master these attributes * * Default Value = "Via maîtrise de compétence" * * Display Monster Learnings Switch * -------------------------------- * Define if the monster book contains at least one page about * learnings * * Possible values : * Y = enabled, * else = disabled * * * Display Monster Learnings Name * -------------------------------- * Define the text displayed in the monster book, above the * list of learnings of the class of the monster * * Default Value = "Apprentissage" * * * Display Monster Location Switch * -------------------------------- * Define if the monster book contains at least one page about * locations * * Possible values : * Y = enabled, * else = disabled * * Display Monster Location Name * -------------------------------- * Define the text displayed in the monster book, above the * list of location where recruit of the monster is enabled. * * Default Value = "Habitat" * * * Display Monster Attributes Switch * -------------------------------- * Define if the monster book contains at least one page about * attributes * * Possible values : * Y = enabled, * else = disabled * * Display Monster Attributes Name * ------------------------------- * Define the text displayed in the monster book, above the * list of attributes of the monster. * * Default Value = Attributs * * * Display Monster Attributes Synthesis Condition * ------------------------------- * Define the text used to define the condition necessary * to master this attribute, by using special synthesis * * Default Value = Synthèse * * * Display Monster Synthesis Switch * ------------------------------- * Define if the monster book contains at least one page about * synthesis formulas * * Possible values : * Y = enabled, * else = disabled * * * Display Monster Synthesis Formula Name * -------------------------------- * Define the text displayed in the monster book, above the * list of special synthesis to obtain this monster. * * Default Value = "Synthèses" * * * Display Monster Synthesis etc * -------------------------------- * Define the text displayed in the monster book, below the * list of special synthesis to obtain this monster, to say * that there is others formulas to obtain this monster * * Default Value = "et plus..." * * * Unknown Data * -------------------------------- * Define the text displayed in the books, when the data is * unknown * * Default Value = "??????" * * * ---------------------------------------------------------------------------- * 10) Skillsets * ---------------------------------------------------------------------------- * * Display Added Skillset Result * -------------------------------- * Define the text displayed after adding job points to a skillset, * allowing actor to learn a skill * * Parameter message list : * %1 : Actor name * %2 : Skill name * * Default Value = "%1 a appris la compétence %2" * * * Display Added Job Points On Skillset Result * -------------------------------- * Define the text displayed after adding job points to a skillset, * display the job points used * * Parameter message list : * %1 : Actor name * %2 : Job Points used * %3 : Skillset name * * Default Value = "%1 a utilisé %2 points de compétences sur la compétence %3" * * * Display Obtain Attribute Result * -------------------------------- * Define the text displayed after adding job points to a skillset, * allowing actor to master an attribute * * Parameter message list : * %1 : Actor name * %2 : Attribute name * * Default Value = "%1 a acquis l'attribut %2" * * * Display Param Bonus Added Result * -------------------------------- * Define the text displayed after adding job points to a skillset, * improving parameters of an actor * * Parameter message list : * %1 : Parameter name * %2 : Actor name * %3 : Bonus value * * Default Value = "%1 de %2 augmente de %3 points" * * * Display Element Resist Raised Result * -------------------------------- * Define the text displayed after adding job points to a skillset, * improving element resistance of an actor * * Parameter message list : * %1 : Actor name * %2 : Element name * %3 : Bonus value * * Default Value = "La résistance de %1 à l'élément %2 augmente de %3%" * * * Display State Resist Raised Result * -------------------------------- * @desc Define the text displayed after adding job points to a skillset, * improving state resistance of an actor * * Parameter message list : * %1 : Actor name * %2 : State name * %3 : Bonus value * * Default Value = "La résistance de %1 au statut %2 augmente de %3%" * * * Display Debuff Resist Raised Result * -------------------------------- * Define the text displayed after adding job points to a skillset, * improving debuff resistance of an actor * * Parameter message list : * %1 : Actor name * %2 : Parameter name * %3 : Bonus value debuff resistance * * Default Value = "La résistance de %1 au debuff %2 augmente de %3%" * * * Display Mastering Skillset Result * -------------------------------- * @desc Define the text displayed after adding job points to a skillset, * when a skillset is mastered * * Parameter message list : * %1 : Actor name * %2 : Skillset name * * Default Value = "%1 a complètement maitrisé la compétence %2" * * * Skillset Confirm * -------------------------------- * Define the text displayed in the command to confirm skillset selection * * Default Value = "Accepter" * * * Skillset To Remove List * -------------------------------- * Define the name displayed above the list of skillset not remained by the actor * * Default Value = "Compétences à ajouter" * * * Skillset To Add List * -------------------------------- * Define the name displayed above the list of skillset remained by the actor * * Default Value = "Compétences ajoutées" * * * ---------------------------------------------------------------------------- * 11) Status screen * ---------------------------------------------------------------------------- * * Result Resist Value Steps * -------------------------------- * Define all range values of texts displayed to define resistances * list of an actor. * Each value are separated by the character "," * * The text displayed is defined by the parameter 'Result Resist Message Steps' * * Default Value = "0,0,100,100" * * * Result Resist Message Steps * -------------------------------- * Define the text displayed to define resistances list of an actor * Each value are separated by the character ";" * The text displayed is selected as follows : * 1st text : lower than 1st value of 'Result Resist Value Steps' * 2nd text : between 1st and 2nd values of 'Result Resist Value Steps' * 3rd text : between 2nd and 3rd values of 'Result Resist Value Steps' * ... * last text : higher than last value of 'Result Resist Value Steps' * * Parameter message list : * %1 : Element name/State name/"Debuff", followed by parameter name/Damage type name * * * These values used to select the text to display is defined by the parameter 'Result Resist Value Steps' * * Default Value = "Absorbe %1;Insensible à %1;Résistant à %1;;Faible face à %1" * * * Display Resistance Name * -------------------------------- * Define the text displayed above resistance list of an actor * * Default Value = "Résistances" * * * Display Synthese Historical Name * -------------------------------- * Define the text displayed above the historic of all synthesis of an * actor * * Default Value = "Historique des synthèses" * * * Display Sparam Name * -------------------------------- * Define the text displayed to define physical skills and magic skills * both names are separated by the character "," * the first part is for physical skills * the second part is for magic skills * * Default Value = "attaque physique,attaque magique" * * * ============================================================================ * Plugin commands * ============================================================================ * Following commands are developed for this plugin * Note that you can use Variables and Switches to replace parameters of all * these plugin commands. For that, add, before the number of the switch/ * variable, the letter S for switches, and V for variables. * * Example : V7 => the value of the 7th variable * S12 => the value of the 12th switch. * * addNewActor 8 25 12,8;46,24;32,15 * Create a new actor, with the class Id 8, the level 25, and also the * following skillsets : * the 12th skillset with 8 job points assigned to this * the 46th skillset with 24 job points assigned to this * the 32th skillset with 15 job points assigned to this * Add this new actor in your team, and launches the change name scene. * * NOTE : If you didn't give any job points value to a skillset, the * default number of job points assigned to the skillset is 0. * if you replace a skillset ID by the letters 'SD', the skillset * assigned is the default skillset for the monster with this class Id. * If you replace a skillset ID by the letters 'RD', the skillset is * selected randomly among the complete list of all skillsets. * * addSizeTeam 2 * Change the max size of all teams, rising up the size of 2 places. * NOTE : if you don't define any number to this command, this command * define the number to 1 as default. * * addSupplementaryTeam 2 * Change the number of supplementary teams which you can access * in main menu, with 2 new supplementary teams. * NOTE : if you don't define any number to this command, this command * define the number to 1 as default. * Furthermore, if the game is defined with stockage system accessable * in main menu (MaxSupplementaryTeam = -1), then, this command has no * effects. * * addMaxBattlers 50 * Change the place of the stockage with 50 supplementary places added * to your stockage system. * NOTE : if you don't define any number to this command, this command * define the number to 1 as default. * * setMapMinLevel 12 3,5,7 * This command set the minimum level for any enemies in regions * 3, 5 and 7 to 12. * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapListId a,b,c,...,z 3,5,7 * This command set the list of monsters authorized for random encounters * to monsters with class id a OR b OR c OR ... OR z in regions 3, 5 and 7 * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapListGroup a,b,c,...,z 3,5,7 * This command set the list of monsters authorized for random encounters * to monsters belonging to group class a OR b OR c OR ... OR z in regions * 3, 5 and 7 * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapListRank a,b,c,...,z 3,5,7 * This command set the list of monsters authorized for random encounters * to monsters with rank class a OR b OR c OR ... OR z in regions 3, 5 * and 7 * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapListSize a,b,c,...,z 3,5,7 * This command set the list of monsters authorized for random encounters * to monsters of size a OR b OR c OR ... OR z, in regions 3, 5 and 7 * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapSwitchOnlyEncountered true/false 3,5,7 * This command limit the list of monsters authorized for random encounters * in regions 3, 5 and 7 to monsters already encountered if true. * Unlock the restriction if false. * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapSkillsetMin 2 3,5,7 * This command sets the minimum of skillsets assigned to encountered * monsters in regions 3, 5 and 7 to 2. * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapMaxMembers 3 3,5,7 * This command sets the maximum of members of troop generated randomly * in regions 3, 5 and 7 to 3. This limit doesn't count the size of members. * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapSkillsetExcluded a,b,c,...,z 3,5,7 * This command set the list of skillsets excluded from the list * available for encounters in regions 3, 5 and 7 to those * with id a OR b OR c OR ... OR z * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapTroopExceptions a,b,c,...,z 3,5,7 * This command set the list of troops excluded from the list * for which the level/skillsets/special attributes generation is * executed during an encounter in regions 3, 5 and 7 to those * with id a OR b OR c OR ... OR z * NOTE : if the region list is not defined, this command applies to the * entire map. * * setMapskillsetDefaultAutomatic true/false 3,5,7 * This command adds always/in priority the skillset default of their class * to enemies for encounters in regions 3, 5 and 7 if true. Remove * this function if false. * NOTE : if the region list is not defined, this command applies to the * entire map. * * setFormationMenu * This command launches the scene where you can exchange your monsters * each other. The main difference with the same scene in the main menu * is that you can select monsters out of your battle and other teams, * in other words, in your stockage. * * setSynthesisMenu * This command launches the scene where you can synthetize your monsters. * * setBookMenu * This command launches the scene where you can view all you've discovered * in this game, as monsters, skillsets and attributes. * * setJobInputMenu * This command launches the scene where you can manage the job points of * all your monsters. * * setRenameMenu * This command launches the scene where you can change the name of all * your monsters. * * setRenamePlayerScreen 14 * This command launches the scene where you can rename your player with * at most 14 characters for the new name. * NOTE : if any maximum length is defined, the length for rename your * monsters is selected. * * ============================================================================ * Notetags * ============================================================================ * * Many notetags are created to define parameters of Dragon Quest Monsters. * Here are a exhaustive list : * * Actor Notetags * * Adds skillset with id x and y Job Points assigned to this skillset * The id of a skillset is the id of the class in which the skillset is * defined * You can replace x by DEFAULT to set the default skillset of the class of * the actor. * * * Adds x Job Points to the actor * Job Points are used to master skillsets. Assign job points to a skillset * allows actors to master a skillset. * You can replace x by DEFAULT to set the number of max job points acquired * at the start level of this actor. * * Class Notetags * * CLASS TAGS * * * All monsters, actors as enemies, of this class belongs to the family x. * * * All monsters, actors as enemies, of this class takes x places in your * team. * WARNING: if the size of the class exceeds the max size of your team, * this can trigger some errors in the game * * * All monsters, actors as enemies, of this class is of rank x. * * * The actors of this class gain access to the attribute x if it's the * result of y synthesis. * NOTE: in order to give always an attribute to this class, it suffices to * change y with 0. * * * The actors of this class gain access to the attribute x if it's the * result of a synthesis where one of the actors masters this attribute and * is either of the same class than the result of this synthesis, or belongs * to the family y. * * * The actors of this class gain access to the attribute x if it's the * result of a synthesis where one of the actors masters this attribute and * is either of the same class than the result of this synthesis, or is * of rank y. * * * The actors of this class gain access to the attribute x if it's the * result of a synthesis where one of the actors masters this attribute and * is either of the same class than the result of this synthesis, or is of * size y. * * * The default skillset for this class is the skillset x. * If this class is a result of a synthesis that you want to execute, this * skillset is always proposed among all selectable skillsets. * * * Gives to this class an immunity to all skills using the element x. * Furthermore, if any skill of this element is launched to an actor with * this class, it is healed in HP with y% of damage usually inflicted. * * * Gives to this class the profile described after the characters ': '. * You can use, for this name, letters, numbers but also these characters: * - + / _ "space" , . & ' * * * Gives file name and index of the face sprite of this class. * You can use, for this name, letters, numbers but also these characters: * - + / _ "space" , . & ' * this is the face sprite used for all actors of this class. * * * Defines the max parameter of this class at x for actors being the result * of y synthesis. * The parameter param must be written in the following values: * * MHP (Max Hp) * MMP (Max Mp) * ATK (Physical Attack) * DEF (Physical Defense) * MAT (Magical Attack) * MDF (Magical Defense) * AGI (Agility) * LUK (Luck) * * Example : * * The max level of attack of this class after 0 synthesis (then, directly) * is equal to 9000. * * * The resistance of this class for the element y is rised up of x% if it's * a result of z synthesis * * * The resistance of this class for the state y is rised up of x% if it's * a result of z synthesis * * * The resistance of this class for the debuff of the parameter y is rised up * of x% if it's a result of z synthesis * * * This class can't be the result of a classic synthesis. * * * This class can be obtained by synthesis if the conditions of actors used * in synthesis meets in this case. These conditions are given in the ??? * * Each member and its conditions are separated by the characters '; ' * Each member must be in the conditions described for him. * * Each set of conditions of a member are separated by the character ';' * The member must meet one of these sets of conditions to be valid. * * Each conditions on a member are separated by the character ', ' * A monster must meet all of these conditions to be valid. * These conditions are all preceded by a letter, giving the data to check. * * N = Id * S = Size * R = Rank * G = Family * * Each valid value for these conditions are separated by the character ',' * A monster must meet one of these conditions to pass this check. * * Note that the order of conditions isn't important : when two actors meets * conditions for a special synthesis, the selection order of these actors * allows always to select this class as result of synthesis. * * Here are some examples of valid notetags and its meaning: * * * This class is the result of synthesis between two actors respectively * of class with id 36 and id 38 * * * This class is the result of synthesis between two actors with * the one of the class id 2 and the other belonging to the family 1 * * * This class is the result of synthesis between two actors with the one * of the class id 2 and the other belonging to the family 1 AND being of * rank 1 * * * This class is the result of synthesis between two actors with the one * of the class id 2 and the other belonging to the family 1 OR family 2 * AND being of rank 1 * * * This class is the result of synthesis between two actors with the one * of the class id 2 and the other belonging to the family 1 OR being of * rank 1 * * * This class is the result of synthesis between two actors, being itself * the result of synthesis between 4 actors, with one with class id 2, a * second with class id 4, and the two others being at rank 7. * * * This class is the result of synthesis between two actors, one of them being * itself the result of synthesis between 2 others actors, such that the * actor used now and the 2 actors used in the synthesis of the second actor * meets these conditions, in others words * - One of them is of class id 2 * - The second is of family 3 AND of size 2 * - The third is of rank 7 OR is of class id 87 * * SKILLSET TAGS * * * Create a skillset with same id than the class for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this skillset the name described after * the characters ': ' * You can use, for this name, letters, numbers but also these characters: * - + / _ "space" , . & ' * * * Create a skillset with same id than the class for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this skillset the description given * after the characters ': ' * You can use, for this name, letters, numbers but also these characters: * - + / _ "space" , . & ' * * * Create a skillset with same id than the class for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this skillset the following parameter: * An actor with this skillset can learn the skill x if it gives to this * skillset y job points. * * * Create a skillset with same id than the class for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this skillset the following parameter: * A actor with this skillset can gain x bonus points for its parameter * param if it gives to this skillset y job points. * The parameter param must be written in the following values: * * MHP (Max Hp) * MMP (Max Mp) * ATK (Physical Attack) * DEF (Physical Defense) * MAT (Magical Attack) * MDF (Magical Defense) * AGI (Agility) * LUK (Luck) * * Example : * * if it gives 25 JP to this skillset, the actor gains 30 bonus points for * its max Hp * * * Create a skillset with same id than the class for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this skillset the following parameter: * An actor with this skillset can gain the attribute x if it gives to this * skillset y job points. * * * Create a skillset with same id than the class for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this skillset the following parameter: * An actor with this skillset can gain a resistance bonus of (-)x for the * element with id z if it gives to this skillset y job points. * * * Create a skillset with same id than the class for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this skillset the following parameter: * An actor with this skillset can gain a resistance bonus of (-)x for the * state with id z if it gives to this skillset y job points. * * * Create a skillset with same id than the class for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this skillset the following parameter: * An actor with this skillset can gain a resistance bonus of (-)x for the * debuff for parameter z if it gives to this skillset y job points. * * * Adds access to this skillset for the result of a synthesis, if actors used * in the synthesis masters some skillsets. These skillsets are defined in * the ???. * * Each set of skillsets are separated by the character ';'. Actors must * meet these sets of skillsets to give access to the skillset result. * * Each skillsets are separated by the character ','. Actors must master * one of these skillsets to validate this set of skillsets. * * Here are some examples of valid notetags and its meaning: * * * Adds access to this skillset if one of actors masters the skillset 1. * * * Adds access to this skillset if one of actors masters the skillset 1 OR * the skillset 2. * * * Adds access to this skillset if actors masters the skillset 1 AND the * skillset 2. * * * Adds access to this skillset if one of actors masters the skillset 1 AND * actors masters the skillset 2 OR 3, AND actors masters the skillset 4 OR 5 * * Enemy Notetags * * Gives to this enemy the class x. * Define the battler sprite of actors of same class with the battler sprite * of this enemy. * Gives to this enemy attributes from this class, access to the default * skillset of this class, and defines parameters of this enemy according * to the class given, and the level of this monster. * NOTE : skills defined for this enemy are defined in the database if * it hasn't a level. Otherwise, skills are defined according to the skillsets * given to this enemy, and its level. * * Skill Notetags * * SKILL NOTETAGS * * * Gives to the skill the power of change the tension level of the target * in order to level up (or down if -) x times. * * * Reset tension level of the target only if the tension is above 0. * * * Reset tension level of the target only if the tension is below 0. * * * Multiply by 1 + (-)x the damage of skills aiming enemies belonging to the * family z, and adds to these damage a bonus of (-)y points * * * Multiply by 1 + (-)x the damage of skills aiming enemies being of size z, * and adds to these damage a bonus of (-)y points * * * Multiply by 1 + (-)x the damage of skills aiming enemies being of rank z, * and adds to these damage a bonus of (-)y points * * * Multiply by 1 + (-)x the damage of skills aiming enemies using the * attribute z, and adds to these damage a bonus of (-)y points * * ATTRIBUTE NOTETAGS * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the name described after * the characters ': ' * You can use, for this name, letters, numbers but also these characters: * - + / _ "space" , . & ' * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the description given * after the characters ': ' * You can use, for this name, letters, numbers but also these characters: * - + / _ "space" , . & ' * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply by 1 + (-)x the damage of skills aiming enemies belonging to the * family z, and adds to these damage a bonus of (-)y points * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply by 1 + (-)x the damage of skills aiming enemies being of size z, * and adds to these damage a bonus of (-)y points * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply by 1 + (-)x the damage of skills aiming enemies being of rank z, * and adds to these damage a bonus of (-)y points * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply by 1 + (-)x the damage of skills aiming enemies using the * attribute z, and adds to these damage a bonus of (-)y points * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply by 1 + (-)x the damage of skills of the element k, * and adds to these damage a bonus of (-)y points. * NOTE : if you change z with 0, this effect change the damage of all skills * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply by 1 + (-)x the damage of skills of the type k, * and adds to these damage a bonus of (-)y points. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply by 1 + (-)x the damage of skills of the damage type k, * and adds to these damage a bonus of (-)y points. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Skills with effects "Inflict status normal Attack" has x% of chance to * inflict the state y to the target. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Reduces the consumption of MP of (-)x% of skills of element y. * NOTE : if you change y with 0, this effect change the MP consumption of * all skills. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Reduces the consumption of MP of (-)x% of skills of type y. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Reduces the consumption of MP of (-)x% of skills of damage type y. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * If one of enemies has this attribute, all escape try is a success. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Rises up the priority in battle turn of all monsters with this attribute * of (-)x. A monster with higher priority execute its action before those * with lower priority. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the battle, a monster with this attribute can use the skill * x with probability y%. * NOTE 1: you can replace x by TENSION if you want to use the skill Tension * NOTE 2: if you replace y by 100, the skill defined by x is always used. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the turn, a monster with this attribute can use the skill * x with probability y%. * NOTE 1: you can replace x by TENSION if you want to use the skill Tension * NOTE 2: if you replace y by 100, the skill defined by x is always used. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the end of the turn, a monster with this attribute can use the skill * x with probability y%. * NOTE 1: you can replace x by TENSION if you want to use the skill Tension * NOTE 2: if you replace y by 100, the skill defined by x is always used. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of its actions, a monster with this attribute can use the * skill x with probability y%. * NOTE 1: you can replace x by TENSION if you want to use the skill Tension * NOTE 2: if you replace y by 100, the skill defined by x is always used. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the end of its actions, a monster with this attribute can use the skill * x with probability y%. * NOTE 1: you can replace x by TENSION if you want to use the skill Tension * NOTE 2: if you replace y by 100, the skill defined by x is always used. * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * All physical attacks aiming one target, aim all candidates targets instead * if it has this attribute. * In other words, 1 enemy -> all enemies * 1 ally -> all allies * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * This attribute can add between x and y supplementary actions per turn * even if you give precise orders to the actor. * NOTE : Enemies with this attribute can always use this effect. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * This attribute can add between x and y supplementary actions per turn * only if you don't give any precise orders to the actor. * NOTE : Enemies with this attribute can always use this effect. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Reduces the resistance to skills of element y for all enemies of the * monster using this attribute * NOTE : if you replace y by 0, this attribute reduces the resistance of * all enemies of all skills. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Reduces the resistance to skills of type y for all enemies of the * monster using this attribute * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Reduces the resistance to debuff of parameter y for all enemies * of the monster using this attribute * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Reduces the resistance to state y for all enemies of the * monster using this attribute * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Adds a bonus of x points of actors using this attribute to the parameter y. * * y = 0 Max Hp * 1 Max Mp * 2 Attack physical * 3 Defense physical * 4 Attack magical * 5 Defense magical * 6 Agility * 7 Luck * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Adds a bonus of x points of actors using this attribute to the extra * parameter y. * These parameters' default value is always 0. * * y = 0 Hit rate * 1 Evasion rate * 2 Critical rate * 3 Critical evasion rate * 4 Magic evasion rate * 5 Magic reflection rate * 6 Counter attack rate * 7 Hp Regeneration rate * 8 Mp Regeneration rate * 9 Tp Regeneration rate * 10 Physical reflection rate * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Adds a bonus of x points of actors using this attribute to the * supplementary parameter y. * These parameters' default value is always 1. * * y = 0 Target rate * 1 Guard effect rate * 2 Recovery effect rate * 3 Pharmacology (effect of items giving Hp risen up by this param) * 4 Mp cost rate * 5 Tp cost rate * 6 Physical damage rate * 7 Magical damage rate * 8 Floor damage rate * 9 Experience rate * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * This attribute cancel effects of attribute x if used by the enemy. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Add the state x to the attribute user for y first turns of a battle. * NOTE : if y replaced by 0, the state inflicted is always active and * can't be removed by any skills. In that case, this state is automatically * removed at the end of a battle. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Raise the gold obtained at the end of a battle of x%. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Raise the experience obtained at the end of a battle of x%. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Raise the chance to obtain items obtained at the end of a battle of x%. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * The recruit skills used in battle are reinforced, adding the value x to * the recruit success probability bar. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * The recruit skills used in battle are reinforced, multiplying by the value * x the result of a recruit skill. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply the base value of parameter y of all monsters using this attribute * by x%. * * y = 0 Max Hp * 1 Max Mp * 2 Attack physical * 3 Defense physical * 4 Attack magical * 5 Defense magical * 6 Agility * 7 Luck * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply the base value of extra parameter y of all monsters using * this attribute by x%. * These parameters' default value is always 0. * * y = 0 Hit rate * 1 Evasion rate * 2 Critical rate * 3 Critical evasion rate * 4 Magic evasion rate * 5 Magic reflection rate * 6 Counter attack rate * 7 Hp Regeneration rate * 8 Mp Regeneration rate * 9 Tp Regeneration rate * 10 Physical reflection rate * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * Multiply the base value of supplementary parameter y of all monsters using * this attribute by x%. * These parameters' default value is always 1. * * y = 0 Target rate * 1 Guard effect rate * 2 Recovery effect rate * 3 Pharmacology (effect of items giving Hp risen up by this param) * 4 Mp cost rate * 5 Tp cost rate * 6 Physical damage rate * 7 Magical damage rate * 8 Floor damage rate * 9 Experience rate * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * An actor using this attribute can equip with any weapons. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * A monster with this attribute can use the skill x as any other actions * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the battle, add y buff(s) of parameter x for z turns at * the actors using this attribute. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the battle, add y buff(s) of parameter x for z turns at * all allies of actors using this attribute. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the battle, add y buff(s) of parameter x for z turns at * all enemies of actors using this attribute. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the battle, add y debuff(s) of parameter x for z turns at * the actors using this attribute. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the battle, add y debuff(s) of parameter x for z turns at * all allies of actors using this attribute. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the battle, add y debuff(s) of parameter x for z turns at * all enemies of actors using this attribute. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At the begin of the battle, actors using this attribute has z% of * probability to gain a buff for parameter x during y turns. If missed, * a debuff of same parameter become active for this actor for same turn * number. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At each end of turns of a battle, the user regains x% of its max Hp. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At each end of turns of a battle, all allies of the user regains x% of * their max Hp. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At each end of turns of a battle, the user regains x% of its max Mp. * * * Create an attribute with same id than the skill for which this notetag is * written (only if never created). * Furthermore, this notetags gives to this attribute the following effect: * At each end of turns of a battle, all allies of the user regains x% of * their max Mp. * * * Weapon, Armor Notetags * * An actor equipped with this weapon or armor, if it's used for a synthesis, * give as unique result a monster of same class as him. Others result cannot * be selected. * * * An actor equipped with this weapon or armor, if it's used for a synthesis, * define the gender of the result of the synthesis. 3 values are available : * * x = -1 Male * 1 Female * 0 Undefined * * Weapon Notetags * * Multiply by 1 + (-)x the damage of skills aiming enemies belonging to the * family z, and adds to these damage a bonus of (-)y points, if the user is * equipped with this weapon. * * * Multiply by 1 + (-)x the damage of skills aiming enemies being of * size z, and adds to these damage a bonus of (-)y points, if the user is * equipped with this weapon. * * * Multiply by 1 + (-)x the damage of skills aiming enemies being of * rank z, and adds to these damage a bonus of (-)y points, if the user is * equipped with this weapon. * * * Multiply by 1 + (-)x the damage of skills aiming enemies using the * attribute z, and adds to these damage a bonus of (-)y points, if the user * is equipped with this weapon. * * Item Notetags * * Allows to an actor to learn and master a new skillset x. * NOTE : if all skillset slots are used, the actor must forget one of its * skillsets to learn the skillset x * * * Give to an actor x job points to assign to its skillsets. * * * Gives to the skill the power of change the tension level of the target * in order to level up (or down if -) x times. * * * Reset tension level of the target only if the tension is above 0. * * * Reset tension level of the target only if the tension is below 0. * * State Notetags * * Adds a bonus of x points of actors using this attribute to the parameter y. * * y = 0 Max Hp * 1 Max Mp * 2 Attack physical * 3 Defense physical * 4 Attack magical * 5 Defense magical * 6 Agility * 7 Luck * * * Adds a bonus of x points of actors using this attribute to the extra * parameter y. In this case, the value added by this note is divided by 100. * These parameters' default value is always 0. * * y = 0 Hit rate * 1 Evasion rate * 2 Critical rate * 3 Critical evasion rate * 4 Magic evasion rate * 5 Magic reflection rate * 6 Counter attack rate * 7 Hp Regeneration rate * 8 Mp Regeneration rate * 9 Tp Regeneration rate * 10 Physical reflection rate * * Adds a bonus of x points of actors using this attribute to the * supplementary parameter y. In this case, the value added by this note * is divided by 100. * These parameters' default value is always 1. * * y = 0 Target rate * 1 Guard effect rate * 2 Recovery effect rate * 3 Pharmacology (effect of items giving Hp risen up by this param) * 4 Mp cost rate * 5 Tp cost rate * 6 Physical damage rate * 7 Magical damage rate * 8 Floor damage rate * 9 Experience rate * * Map Notetags * * All monsters of class x appeared in this map has level y * * * All monsters of class x appeared in this map in the troop z has level y. * This note has a higher priority than the previous. * * * hème monster of class x appeared in the troop z in this map has level y. * This note has a higher priority than the previous. * * * All monsters of class x appeared in regions a,b,...,c has level y. * This note has a higher priority than the previous. * * * All monsters of class x appeared in regions a,b,...,c in the troop z * has level y. * This note has a higher priority than the previous. * * * hème monster of class x appeared in the troop z in regions a,b,...,c * has level y. * This note has a higher priority than the previous. * * * All monsters of class x appeared in this map has skillset y with z job * points assigned to it. * NOTE: if you replace y by the word DEFAULT, the skillset selected is * the default skillset for the monster x * * * All monsters of class x appeared in this map in the troop h * has skillset y with z job points assigned to it. * This note has a higher priority than the previous. * NOTE: if you replace y by the word DEFAULT, the skillset selected is * the default skillset for the monster x * * * gème monster of class x appeared in the troop h in this map * has skillset y with z job points assigned to it. * This note has a higher priority than the previous. * NOTE: if you replace y by the word DEFAULT, the skillset selected is * the default skillset for the monster x * * * All monsters of class x appeared in regions a,b,...,c has skillset * y with z job points assigned to it. * This note has a higher priority than the previous. * NOTE: if you replace y by the word DEFAULT, the skillset selected is * the default skillset for the monster x * * * All monsters of class x appeared in regions a,b,...,c in the troop h * has skillset y with z job points assigned to it. * This note has a higher priority than the previous. * NOTE: if you replace y by the word DEFAULT, the skillset selected is * the default skillset for the monster x * * * gème monster of class x appeared in the troop h in regions a,b,...,c * has skillset y with z job points assigned to it. * This note has a higher priority than the previous. * NOTE: if you replace y by the word DEFAULT, the skillset selected is * the default skillset for the monster x * * * All monsters of class x appeared in this map has the attribute y activated * This notetag is only usable for attribute learned naturally by these * monsters but which has to meet a condition (number of synthesis, synthesis * with a particular type of monster, etc...) * * * All monsters of class x appeared in this map in the troop z has the * attribute y activated. * This notetag is only usable for attribute learned naturally by these * monsters but which has to meet a condition (number of synthesis, synthesis * with a particular type of monster, etc...) * This note has a higher priority than the previous. * * * gème monster of class x appeared in the troop z in this map has the * attribute y activated. * This notetag is only usable for attribute learned naturally by these * monsters but which has to meet a condition (number of synthesis, synthesis * with a particular type of monster, etc...) * This note has a higher priority than the previous. * * * All monsters of class x appeared in regions a,b,...,c has the attribute * y activated. * This notetag is only usable for attribute learned naturally by these * monsters but which has to meet a condition (number of synthesis, synthesis * with a particular type of monster, etc...) * This note has a higher priority than the previous. * * * All monsters of class x appeared in regions a,b,...,c in the troop z * has the attribute y activated. * This notetag is only usable for attribute learned naturally by these * monsters but which has to meet a condition (number of synthesis, synthesis * with a particular type of monster, etc...) * This note has a higher priority than the previous. * * * gème monster of class x appeared in the troop z in regions a,b,...,c * has the attribute y activated. * This notetag is only usable for attribute learned naturally by these * monsters but which has to meet a condition (number of synthesis, synthesis * with a particular type of monster, etc...) * This note has a higher priority than the previous. * * * Add as troop encounterable in this map the random troop. This special * troop generate at each time as many monsters as possible. * * * Add as troop encounterable in regions a,b,...,c the random troop. * This special troop generate at each time as many monsters as * possible. * * * Define the maximum of members addable in the troop generated randomly to * x. This limit isn't affected by size members. * * * Define the maximum of members addable in the troop generated randomly * in regions a,b,...,c to x. This limit isn't affected by size members. * This note has a higher priority than the previous. * * * All monsters in this map has at least the level x. * This note has the lowest priority on others. * * * All monsters in regions a,b,...,c has at least the level x. * This note has a higher priority than the previous. * * * All monsters in this map belonging of troop y has at least the level x. * This note has higher priority than previous, but lower than others. * * * All monsters in regions a,b,...,c belonging of troop y has at * least the level x. * This note has higher priority than previous, but lower than others. * * * Reduces the monster list selectable for random troop to those the player * has already recruited/synthetized/beaten. * * * Reduces the monster list selectable for random troop to those the player * has already recruited/synthetized/beaten, only in regions a,b,...,c. * This note has a lower priority than the previous. * * * Defines the minimum number of skillsets which all monsters must have * if encountered in this map. * * * Defines the minimum number of skillsets which all monsters must have * if encountered in regions a,b,...,c. * This note has a higher priority than the previous. * * * The default skillset is not automatically assigned to monsters * encountered in this map * * * The default skillset is not automatically assigned to monsters * encountered in regions a,b,...,c. * This note has a lower priority than the previous. * * * Reduces the skillset list assignable to monsters to skillsets which * hasn't the Id a AND b AND c AND ... AND z. * This note applies at all regions, in addition to the following note. * * * Reduces the skillset list assignable to monsters to skillsets which * hasn't the Id a AND b AND c AND ... AND z, only in regions a1, a2,..., am. * * * Reduces the monster list selectable for random troop to those having the * class Id a OR b OR c OR ... OR z. * This note applies at all regions, in addition to the following note. * * * Reduces the monster list selectable for random troop to those having the * class Id a OR b OR c OR ... OR z, only in regions a1,a2,...,am * * * Reduces the monster list selectable for random troop to those having the * rank a OR b OR c OR ... OR z. * This note applies at all regions, in addition to the following note. * * * Reduces the monster list selectable for random troop to those having the * rank a OR b OR c OR ... OR z, only in regions a1,a2,...,am * * * Reduces the monster list selectable for random troop to those being of the * size a OR b OR c OR ... OR z. * This note applies at all regions, in addition to the following note. * * * Reduces the monster list selectable for random troop to those being of the * size a OR b OR c OR ... OR z, only in regions a1,a2,...,am * * * Reduces the monster list selectable for random troop to those belonging to * the family a OR b OR c OR ... OR z. * This note applies at all regions, in addition to the following note. * * * Reduces the monster list selectable for random troop to those belonging to * the family a OR b OR c OR ... OR z, only in regions a1,a2,...,am * * * This troop is not affected by skillset and level applications of the map * (To use for boss battles for example) * * * This troop is not affected by skillset and level applications of the * regions a,b,...,c * (To use for boss battles for example) * * ============================================================================ * Script functions * ============================================================================ * newActorAddable * Return TRUE if there remains at least 1 place in your stockage team * to add a new monster. * Else, return FALSE * * MonstersEncounteredIsReached(35) * return TRUE is you encountered at least 35 monsters from the start of * the game. * Else, return FALSE * * MonstersRecruitedIsReached(35) * return TRUE is you encountered and recruited/synthetized at least 35 * monsters from the start of the game. * Else, return FALSE * * SkillsetDiscoveredIsReached(35) * return TRUE is you discovered at least 35 different skillsets from * the start of the game. * Else, return FALSE * * SkillsetMasteredIsReached(35) * return TRUE is you discovered and mastered at least 35 different * skillsets from the start of the game. * Else, return FALSE * * AttributeDiscoveredIsReached(35) * return TRUE is you discovered at least 35 attributes from the start of * the game. * Else, return FALSE * * PercentMonsterEncounteredIsReached(35) * return TRUE is you encountered at least 35% of existing monsters * from the start of the game. * Else, return FALSE * * PercentMonsterRecruitedIsReached(35) * return TRUE is you encountered and recruited/synthetized at least 35% * of existing monsters from the start of the game. * Else, return FALSE * * PercentSkillsetDiscoveredIsReached(35) * return TRUE is you discovered at least 35% of existing skillsets from * the start of the game. * Else, return FALSE * * PercentSkillsetMasteredIsReached(35) * return TRUE is you discovered and mastered at least 35% of existing * skillsets from the start of the game. * Else, return FALSE * * PercentAttributeDiscoveredIsReached(35) * return TRUE is you discovered at least 35% of existing attributes * from the start of the game. * Else, return FALSE * * ============================================================================ * Changelog * ============================================================================ * * Version 1.00: * - Finished plugin! */ //============================================================================= //============================================================================= // Parameter Variables //============================================================================= DQM.Parameters = PluginManager.parameters('DQM_plugin'); DQM.Param = DQM.Param || {}; // Parameter System DQM.Param.MaxSizeTeam = Number(DQM.Parameters['Max Size Team'] || 4); DQM.Param.MaxSupplementaryTeam = Number(DQM.Parameters['Max Supplementary Team'] || 0); DQM.Param.NameMainTeam = String(DQM.Parameters['Name Main Team'] || 'Équipe'); DQM.Param.NameSupplementaryTeam = String(DQM.Parameters['Name Supplementary Team'] || 'Réserve'); DQM.Param.NameStockageSystem = String(DQM.Parameters['Name Stockage System'] || 'Stockage'); DQM.Param.MaxBattlers = Number(DQM.Parameters['Max Battlers'] || 0); DQM.Param.SynthesisAccessMainMenu = String(DQM.Parameters['Synthesis Access Main Menu'] || 'Y') === 'Y' ? true : false; DQM.Param.BookListAccessMainMenu = String(DQM.Parameters['BookList Access Main Menu'] || 'Y') === 'Y' ? true : false; DQM.Param.RenameAccessMainMenu = String(DQM.Parameters['Rename Access Main Menu'] || 'Y') === 'Y' ? true : false; DQM.Param.SynthesisAccessMainMenuEvent = String(DQM.Parameters['Synthesis Access Main Menu Event'] || 'Y') === 'Y' ? true : false; DQM.Param.BookListAccessMainMenuEvent = String(DQM.Parameters['BookList Access Main Menu Event'] || 'Y') === 'Y' ? true : false; DQM.Param.RenameAccessMainMenuEvent = String(DQM.Parameters['Rename Access Main Menu Event'] || 'Y') === 'Y' ? true : false; DQM.Param.RenameMainMenuName = String(DQM.Parameters['Rename Main Menu Name'] || 'Renommer'); DQM.Param.MessageGetNewActor = String(DQM.Parameters['Message Get New Actor'] || 'Vous avez reçu un %1 !'); DQM.Param.GenderActorList = String(DQM.Parameters['Gender Actor List'] || '-,+-,+').split(','); DQM.Param.GenderActorLabel = String(DQM.Parameters['Gender Actor Label'] || 'Genre'); DQM.Param.HitDefault = Number(DQM.Parameters['Hit Default'] || 0) / 100; DQM.Param.EvasionDefault = Number(DQM.Parameters['Evasion Default'] || 0) / 100; DQM.Param.CriticalDefault = Number(DQM.Parameters['Critical Default'] || 0) / 100; DQM.Param.WeaponDefault = Number(DQM.Parameters['Weapon Default'] || 0); DQM.Param.rateExpBattleTeam = Number(DQM.Parameters['Rate Exp Battle Team'] || 100); DQM.Param.rateExpStockage = Number(DQM.Parameters['Rate Exp Stockage'] || 20); DQM.Param.rateExpSupTeam = Number(DQM.Parameters['Rate Exp Sup Team'] || 50); DQM.Param.RateSkillsetsEnemy = Number(DQM.Parameters['Rate Skillsets Enemy'] || 80); DQM.Param.RateResistancesEnemy = Number(DQM.Parameters['Rate Resistances Enemy'] || 80); DQM.Param.RateAttributesEnemy = Number(DQM.Parameters['Rate Attributes Enemy'] || 80); DQM.Param.RateLevelEnemy = Number(DQM.Parameters['Rate Level Enemy'] || 80); DQM.Param.CriticalEffectApplication = String(DQM.Parameters['Critical Effect Application'] || 'Y') === 'Y' ? true : false; DQM.Param.RateCriticalEffect = Number(DQM.Parameters['Rate Critical Effect'] || 300); DQM.Param.LengthNameActor = Number(DQM.Parameters['Length Name Actor'] || 12); DQM.Param.DisplayNamePlayer = String(DQM.Parameters['Display Name Player'] || 'Nom'); DQM.Param.DisplayBookDataAsPercent = String(DQM.Parameters['Display Book Data As Percent'] || 'Y') === 'Y' ? true : false; DQM.Param.DisplayResultMonsterEncountered = String(DQM.Parameters['Display Result Monster Encountered'] || 'Monstres rencontrés'); DQM.Param.DisplayResultMonsterRecruited = String(DQM.Parameters['Display Result Monster Recruited'] || 'Monstres capturés'); DQM.Param.DisplayResultSkillsetDiscovered = String(DQM.Parameters['Display Result Skillset Discovered'] || 'Compétences découvertes'); DQM.Param.DisplayResultSkillsetMastered = String(DQM.Parameters['Display Result Skillset Mastered'] || 'Compétences maîtrisés'); DQM.Param.DisplayResultAttributeDiscovered = String(DQM.Parameters['Display Result Attribute Discovered'] || 'Attributs découverts'); // Parameter Classes Classements DQM.Param.GroupClassList = [null].concat(String(DQM.Parameters['Class Group List'] || 'Gluant,Dragon,Bête,Nature,Matière,Démon,Mort-Vivant,Inconnu').split(",")); DQM.Param.GroupClassLabel = String(DQM.Parameters['Class Group Label'] || 'Famille'); DQM.Param.SizeClassList = [null].concat(String(DQM.Parameters['Class Size List'] || 'Petit,Moyen,Grand,Géant').split(",")); DQM.Param.SizeClassIcon = [null].concat(String(DQM.Parameters['Class Size List Icon'] || 'S,M,G,SG').split(",")); DQM.Param.SizeClassLabel = String(DQM.Parameters['Class Size List Label'] || 'Taille'); DQM.Param.RankClassList = [null].concat(String(DQM.Parameters['Class Rank List'] || 'F,E,D,C,B,A,S,X').split(",")); DQM.Param.RankClassLabel = String(DQM.Parameters['Class Rank Label'] || 'Rang'); // Parameter Job Points DQM.Param.LevelJobPoint = String(DQM.Parameters['Level Job Points Add'] || '2,5,8,10,12,15,18,20,22,25,28,30,32,35,38,40,42,45,48,50,52,55,58,60,62,65,68,70,72,75,78,80,82,85,88,90,92,95,98,100').split(","); DQM.Param.ValueJobPoint = String(DQM.Parameters['Value Job Points Add'] || '5,8,5,7,5,5,4,4,5,5,4,3,4,4,3,5,2,3,5,5,3,2,3,5,3,3,4,3,2,2,5,3,4,2,3,2,4,4,3,5').split(","); DQM.Param.JobPointName = String(DQM.Parameters['Job Points Name'] || 'Point de compétence'); DQM.Param.JobPointIcon = String(DQM.Parameters['Job Points Icon'] || 'PC'); DQM.Param.DisplayGainJobPoints = String(DQM.Parameters['Display Gain Job Points'] || '%1 a gagné %2 points de compétences'); // Parameter Synthese DQM.Param.SynthesisName = String(DQM.Parameters['Synthesis order name'] || 'Synthétiser'); DQM.Param.DisplayNoMonsterSelectedSynthesis = String(DQM.Parameters['Display No Monster Selected Synthesis'] || 'Veuillez sélectionner un monstre à synthétiser!'); DQM.Param.MinLevelToBeUsedInSynthesis = Number(DQM.Parameters['Min Level To Be Used In Synthesis'] || '10'); DQM.Param.specialSynthesisOnly = String(DQM.Parameters['Special Synthesis Only'] || 'N') === 'Y' ? true : false; DQM.Param.RankValueAddable = String(DQM.Parameters['Rank Value Addable'] || 'Y') === 'Y' ? true : false; DQM.Param.ThirdClassicResultDefinable = String(DQM.Parameters['Third Classic Result Definable'] || 'N') === 'Y' ? true : false; DQM.Param.ThirdClassicResultDefinition = String(DQM.Parameters['Third Classic Result Definition'] || '1+2=3,1+3=4,1+4=5,1+5=6,1+6=7,1+7=2,2+3=5,2+4=6,2+5=7,2+6=1,2+7=3,3+4=7,3+5=1,3+6=2,3+7=4,4+5=2,4+6=3,4+7=5,5+6=4,5+7=6,6+7=1').split(',').map(function(formula) { if (formula.match(/([0-9]+)[ ]*[+][ ]*([0-9]+)[ ]*[=][ ]*([0-9]+)/i)) { return [Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else { return [0,0,0]; } }); DQM.Param.capChangeLevelMax = String(DQM.Parameters['Cap Change Level Max'] || '0,5,10').split(","); DQM.Param.valueChangeLevelMax = String(DQM.Parameters['Value Change Level Max'] || '50,75,100').split(","); DQM.Param.RateSynthesisParamPlus = Number(DQM.Parameters['Rate Synthesis Param Plus'] || 25); DQM.Param.RateSynthesisJobPointsAssigned = Number(DQM.Parameters['Rate Synthesis Job Points Assigned'] || 50); DQM.Param.RateSynthesisJobPointsFree = Number(DQM.Parameters['Rate Synthesis Job Points Free'] || 25); DQM.Param.SynthesisResultMessage = String(DQM.Parameters['Synthesis Result Message'] || 'Vous avez obtenu un %1.'); DQM.Param.SynthesisNameInputMessage = String(DQM.Parameters['Synthesis Name Input Message'] || 'Veuillez lui donner un nom.'); DQM.Param.SynthesisAnimationId = Number(DQM.Parameters['Synthesis Animation Id'] || 120); DQM.Param.SynthesisBackSprite1 = String(DQM.Parameters['Synthesis Back Sprite 1'] || ''); DQM.Param.SynthesisBackSprite2 = String(DQM.Parameters['Synthesis Back Sprite 2'] || ''); DQM.Param.SynthesisWaitStart = Number(DQM.Parameters['Synthesis Wait Start'] || 50); DQM.Param.SynthesisWaitSpeed = Number(DQM.Parameters['Synthesis Wait Speed'] || 80); DQM.Param.SynthesisWaitEnd = Number(DQM.Parameters['Synthesis Wait End'] || 80); // Parameter Auto-Attack DQM.Param.autoAttackPartyText = String(DQM.Parameters['Auto Attack Text Party'] || "Auto Attack"); DQM.Param.autoAttackActorText = String(DQM.Parameters['Auto Attack Text Actor'] || "Auto Attack"); // Parameter Recruit DQM.Param.RecruitCommand = String(DQM.Parameters['Recruit Command'] || 'Recruter'); DQM.Param.RecruitMessageUse = ' '.concat(String(DQM.Parameters['Recruit Message Use'] || 'exécute une démonstration de force!')); DQM.Param.RecruitFormula = String(DQM.Parameters['Recruit Formula'] || '(a.atk * 4 - b.def * 2)*(1/2)'); DQM.Param.RecruitGaugePositions = String(DQM.Parameters['Recruit Gauge Positions'] || '0,70,120').split(","); DQM.Param.RecruitMessageText = String(DQM.Parameters['Recruit Message Text'] || '%1 n\'est pas du tout impressioné;,%1 n\'est pas très impressioné;,%1 est un peu impressioné;,%1 est très impressioné').split(";,"); DQM.Param.RecruitMessageValueMin = String(DQM.Parameters['Recruit Message Value Min'] || '0,1,10,30').split(","); DQM.Param.RecruitCheckMessage = String(DQM.Parameters['Recruit Check Message'] || '%1 réfléchit...'); DQM.Param.RecruitWinMessage = String(DQM.Parameters['Recruit Win Message'] || '%1 se décide à rejoindre votre équipe.'); DQM.Param.RecruitWinInsertTeamMessage = String(DQM.Parameters['Recruit Win Insert Team Message'] || '%1 intègre votre %2.'); DQM.Param.RecruitWinInsertSystemMessage = String(DQM.Parameters['Recruit Win Insert System Message'] || '%1 est envoyé dans votre système de stockage.'); DQM.Param.RecruitLoseMessage = String(DQM.Parameters['Recruit Lose Message'] || 'Le dressage a échoué'); DQM.Param.MalusRecruitLoseChance = Number(DQM.Parameters['Malus Recruit Lose Chance'] || 30); DQM.Param.MalusRecruitLoseMessage = String(DQM.Parameters['Malus Recruit Lose Message'] || 'Les ennemis se vexent.'); DQM.Param.NoMalusRecruitLoseMessage = String(DQM.Parameters['No Malus Recruit Lose Message'] || '%1 évalue la situation.'); DQM.Param.MalusRecruitSameMonsterActivation = String(DQM.Parameters['Malus Recruit Same Monster Activation'] || 'Y') === 'Y' ? true : false; DQM.Param.RateMalusRecruitSameMonster = Number(DQM.Parameters['Rate Malus Recruit Same Monster'] || 100); DQM.Param.RateMaxMalusRecruitSameMonster = Number(DQM.Parameters['Rate Max Malus Recruit Same Monster'] || 800); DQM.Param.FightNumberToResetMalusRecruit = Number(DQM.Parameters['Fight Number To Reset Malus Recruit'] || 100); // Parameter Tension DQM.Param.TensionName = String(DQM.Parameters['Tension Name'] || 'Tension'); DQM.Param.TensionMessageUse = ' '.concat(String(DQM.Parameters['Tension Message Use'] || 'utilise Tension')); DQM.Param.TensionListLevel = String(DQM.Parameters['Tension List Level'] || '5,20,50,100').split(','); DQM.Param.TensionMessageResult = String(DQM.Parameters['Tension Message Result'] || 'Sa tension passe à %1'); DQM.Param.TensionMessageTooHigh = String(DQM.Parameters['Tension Message Too High'] || 'Sa tension était déjà au maximum'); DQM.Param.TensionMessageTooLow = String(DQM.Parameters['Tension Message Too Low'] || 'Sa tension ne peut pas descendre plus bas'); DQM.Param.TensionFormulaDamage = String(DQM.Parameters['Tension Formula Damage'] || '%1 * (1 + 4*%2/100)'); // Parameter Strategy DQM.Param.StrategyName = String(DQM.Parameters['Strategy Name'] || 'Stratégie'); DQM.Param.StrategyList = String(DQM.Parameters['Strategy List'] || 'Aucune,Berserker,Soigneur,Soutien,Sournois,Pas de gaspillage').split(","); // Parameter Book Menus DQM.Param.BookListNameCommand = String(DQM.Parameters['Book List Name Command'] || 'Bibliothèque'); DQM.Param.SkillsetBookNameCommand = String(DQM.Parameters['Skillset Book Name Command'] || 'Compétences'); DQM.Param.ResistanceStateName = String(DQM.Parameters['Resistance State Name'] || 'Rés. %1+%2'); DQM.Param.ResistanceDebuffName = String(DQM.Parameters['Resistance Debuff Name'] || 'Rés. debuff %1+%2'); DQM.Param.ResistanceElementName = String(DQM.Parameters['Resistance Element Name'] || 'Rés. %1+%2'); DQM.Param.MonsterBookNameCommand = String(DQM.Parameters['Monster Book Name Command'] || 'Monstres'); DQM.Param.AttributeBookNameCommand = String(DQM.Parameters['Attribute Book Name Command'] || 'Attributs'); DQM.Param.DisplayAttributeWithoutConditions = String(DQM.Parameters['Display Attribute Without Conditions'] || 'Maîtrise naturellement l\'attribut'); DQM.Param.DisplayAttributeConditionLevelSynthesis = String(DQM.Parameters['Display Attribute Condition Level Synthesis'] || 'Après %1 synthèses'); DQM.Param.DisplayAttributeConditionGroupClass = String(DQM.Parameters['Display Attribute Condition Group Class'] || 'Après synthèse avec un monstre de la famille %1'); DQM.Param.DisplayAttributeConditionSizeClass = String(DQM.Parameters['Display Attribute Condition Size Class'] || 'Après synthèse avec un monstre de taille %1'); DQM.Param.DisplayAttributeConditionRankClass = String(DQM.Parameters['Display Attribute Condition Rank Class'] || 'Après synthèse avec un monstre de rang %1'); DQM.Param.DisplayAttributeConditionSkillset = String(DQM.Parameters['Display Attribute Condition Skillset'] || 'Via maîtrise de compétence'); DQM.Param.UnknownData = String(DQM.Parameters['Unknown Data'] || '??????'); DQM.Param.DisplayMonsterLearningsSwitch = String(DQM.Parameters['Display Monster Learnings Switch'] || 'Y') === 'Y' ? true : false; DQM.Param.DisplayMonsterLearningsName = String(DQM.Parameters['Display Monster Learnings Name'] || 'Apprentissage'); DQM.Param.DisplayMonsterLocationSwitch = String(DQM.Parameters['Display Monster Location Switch'] || 'Y') === 'Y' ? true : false; DQM.Param.DisplayMonsterLocationName = String(DQM.Parameters['Display Monster Location Name'] || 'Habitat'); DQM.Param.DisplayMonsterAttributesSwitch = String(DQM.Parameters['Display Monster Attributes Switch'] || 'Y') === 'Y' ? true : false; DQM.Param.DisplayMonsterAttributesName = String(DQM.Parameters['Display Monster Attributes Name'] || 'Attributs'); DQM.Param.DisplayMonsterAttributesSynthesisCondition = String(DQM.Parameters['Display Monster Attributes Synthesis Condition'] || 'Synthèse'); DQM.Param.DisplayMonsterSynthesisSwitch = String(DQM.Parameters['Display Monster Synthesis Switch'] || 'Y') === 'Y' ? true : false; DQM.Param.DisplayMonsterSynthesisFormulaName = String(DQM.Parameters['Display Monster Synthesis Formula Name'] || 'Synthèses'); DQM.Param.DisplayMonsterSynthesisEtc = String(DQM.Parameters['Display Monster Synthesis etc'] || 'et plus...'); DQM.Param.UnknownLevel = String(DQM.Parameters['Unknown Level'] || '???'); // Parameter Skillset Result Screen DQM.Param.DisplayAddedSkillsetResult = String(DQM.Parameters['Display Added Skillset Result'] || '%1 a appris la compétence %2'); DQM.Param.DisplayAddedJobPointsOnSkillsetResult = String(DQM.Parameters['Display Added Job Points On Skillset Result'] || '%1 a utilisé %2 points de compétences sur la compétence %3'); DQM.Param.DisplayObtainAttributeResult = String(DQM.Parameters['Display Obtain Attribute Result'] || '%1 a acquis l\'attribut %2'); DQM.Param.DisplayParamBonusAddedResult = String(DQM.Parameters['Display Param Bonus Added Result'] || '%1 de %2 augmente de %3 points'); DQM.Param.DisplayElementResistRaisedResult = String(DQM.Parameters['Display Element Resist Raised Result'] || 'La résistance de %1 à l\'élément %2 augmente de %3%'); DQM.Param.DisplayStateResistRaisedResult = String(DQM.Parameters['Display State Resist Raised Result'] || 'La résistance de %1 au statut %2 augmente de %3%'); DQM.Param.DisplayDebuffResistRaisedResult = String(DQM.Parameters['Display Debuff Resist Raised Result'] || 'La résistance de %1 au debuff %2 augmente de %3%'); DQM.Param.DisplayMasteringSkillsetResult = String(DQM.Parameters['Display Mastering Skillset Result'] || '%1 a complètement maitrisé la compétence %2'); DQM.Param.SkillsetConfirm = String(DQM.Parameters['Skillset Confirm'] || 'Accepter'); DQM.Param.SkillsetToAddListName = String(DQM.Parameters['Skillset To Add List'] || 'Compétences ajoutées'); DQM.Param.SkillsetToRemoveListName = String(DQM.Parameters['Skillset To Remove List'] || 'Compétences à ajouter'); // Parameter Resistance Status Screen DQM.Param.ResultResistValueSteps = String(DQM.Parameters['Result Resist Value Steps'] || '0,0,100,100').split(','); DQM.Param.ResultResistMessageSteps = String(DQM.Parameters['Result Resist Message Steps'] || 'Absorbe %1;Insensible à %1;Résistant à %1;;Faible face à %1').split(';'); DQM.Param.DisplayResistanceName = String(DQM.Parameters['Display Resistance Name'] || 'Résistances'); DQM.Param.DisplaySyntheseHistoricalName = String(DQM.Parameters['Display Synthese Historical Name'] || 'Historique des synthèses'); DQM.Param.DisplaySParamName = String(DQM.Parameters['Display Sparam Name'] || 'attaque physique,attaque magique').split(','); DQM.Param.ActorBasis = {"id":0,"battlerName":"","characterIndex":0,"characterName":"","classId":1,"equips":[0,0,0,0,0],"faceIndex":0,"faceName":"","traits":[],"initialLevel":1,"maxLevel":99,"name":"","nickname":"","note":"","profile":""}; DQM.Param.TroopBasis = {"id":-1,"members":[],"name":"","pages":[{"conditions":{"actorHp":50,"actorId":1,"actorValid":false,"enemyHp":50,"enemyIndex":0,"enemyValid":false,"switchId":1,"switchValid":false,"turnA":0,"turnB":0,"turnEnding":false,"turnValid":false},"list":[{"code":0,"indent":0,"parameters":[]}],"span":0}]}; DQM.Param.playerSprite = {"characterName":'', "characterIndex":0}; DQM.Param.playerFace = {"faceName":'',"faceIndex":0}; DQM.Param.SkillsetData = []; DQM.Param.SynthesisFormula = []; DQM.Param.AttributeData = []; DQM.Param.SkillsetSynthesisData = []; var SkillSet = []; //============================================================================= // DataManager //============================================================================= DQM.Core.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded; DataManager.isDatabaseLoaded = function() { if (!DQM.Core.DataManager_isDatabaseLoaded.call(this)) return false; if (!DQM._loaded_DQM_plugins) { this.processDQMNotetags4(); this.processDQMNotetags2(); this.processDQMNotetags1(); this.processDQMNotetags3(); this.processDQMNotetags5(); this.processDQMNotetags6(); this.processDQMNotetags8(); this.processDQMNotetags9(); $dataClasses.slice(1).forEach(function(monster) { if (monster && monster.faceName) { ImageManager.loadFace(monster.faceName, monster.battlerHue); } }); DQM._loaded_DQM_plugins = true; ImageManager.loadFace(DQM.Param.playerFace.faceName); } return true; }; DataManager.processDQMNotetags1 = function() { var noteA = /<(?:BEGIN WITH SKILLSET)[ ]([0-9]+|DEFAULT)[ ](?:AT)[ ]([0-9]+)>/i; var noteB = /<(?:BEGIN WITH)[ ]([0-9]+|DEFAULT)[ ](?:JOB POINTS)>/i; for (var n = 1; n < $dataActors.length; n++) { var obj = $dataActors[n]; var notedata = obj.note.split(/[\r\n]+/); $dataActors[n].Skillsets = []; $dataActors[n].JobPoints = 0; $dataActors[n].monster = true; for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { $dataActors[n].Skillsets.push([String(RegExp.$1) === 'DEFAULT' ? $dataClasses[$dataActors[n].classId].SkillSetDefault : Number(RegExp.$1),Number(RegExp.$2)]); } else if (line.match(noteB)) { $dataActors[n].JobPoints = String(RegExp.$1) === 'DEFAULT' ? DQM.Param.ValueJobPoint.filter(function(value, id) { return Number(DQM.Param.LevelJobPoint[id]) <= $dataActors[n].initialLevel; }).reduce(function(r, value) { return r + Number(value); }, 0) : Number(RegExp.$1); } } } DQM.Param.playerSprite = $dataActors.slice(1,2).map(function(actor) { return {"characterName":actor.characterName, "characterIndex":actor.characterIndex}; })[0]; DQM.Param.playerFace = $dataActors.slice(1,2).map(function(actor) { return {"faceName":actor.faceName, "faceIndex":actor.faceIndex}; })[0]; }; DataManager.processDQMNotetags2 = function() { var noteA = /<(?:SKILLSET NAME):[ ]([\wàáâäéèêëíìîïùúûüóòôôýÿçÁÀÂÄÉÈÊËÍÌÎÏÚÙÛÜÝ\d-+/_ ,.:;?%µ*$"()°<>&']+)>/i; var noteB = /<(?:SKILLSET DESC):[ ]([\wàáâäéèêëíìîïùúûüóòôôýÿçÁÀÂÄÉÈÊËÍÌÎÏÚÙÛÜÝ\d-+/_ ,.:;%?µ*$"()°<>&']+)>/i; var noteC = /<(?:SKILLSET LEARN)[ ]([0-9]+)[ ](?:AT)[ ]([0-9]+)>/i; var noteD = /<(?:CLASS IS IN GROUP)[ ]([0-9]+)>/i; var noteE = /<(?:CLASS IS OF SIZE)[ ]([0-9]+)>/i; var noteF = /<(?:CLASS IS OF RANK)[ ]([0-9]+)>/i; var noteG = /<(?:SKILLSET GAIN)[ ]([0-9]+)[ ](MHP|MMP|ATK|DEF|MAT|MDF|AGI|LUK)[ ](?:AT)[ ]([0-9]+)>/i; var noteH = /<(?:GAIN ATTRIBUTE)[ ]([0-9]+)[ ](?:AFTER)[ ]([0-9]+)[ ](?:SYNTHESIS)>/i; var noteI = /<(?:MAX PARAMETER OF)[ ](MHP|MMP|ATK|DEF|MAT|MDF|AGI|LUK)[ ](?:AT)[ ]([0-9]+)[ ](?:AFTER)[ ]([0-9]+)[ ](?:SYNTHESIS)>/i; var noteJ = /<(?:DEFAULT SKILLSET IS)[ ]([0-9]+)>/i; var noteK = /<(?:CANNOT BE OBTAINED BY CLASSIC SYNTHESIS)>/i; var noteL = /<(?:CAN BE OBTAINED BY SYNTHESIS BETWEEN)[ ]((?:(?:(?:(?:(?:N|S|R|G)(?:[0-9]+[,])*(?:[0-9]+)[,][ ])*(?:(?:N|S|R|G)(?:[0-9]+[,])*(?:[0-9]+))[;])*(?:(?:(?:N|S|R|G)(?:[0-9]+[,])*(?:[0-9]+)[,][ ])*(?:(?:N|S|R|G)(?:[0-9]+[,])*(?:[0-9]+))))[;][ ])+(?:(?:(?:(?:N|S|R|G)(?:[0-9]+[,])*(?:[0-9]+)[,][ ])*(?:(?:N|S|R|G)(?:[0-9]+[,])*(?:[0-9]+))[;])*(?:(?:(?:N|S|R|G)(?:[0-9]+[,])*(?:[0-9]+)[,][ ])*(?:(?:N|S|R|G)(?:[0-9]+[,])*(?:[0-9]+)))))>/i; var noteM = /<(?:SKILLSET ADD)[ ]([-]?[0-9]+)[ ](?:RESISTANCE[+])[ ]([0-9]+)[ ](?:TO)[ ](ELEMENT|STATE|DEBUFF)[ ](?:AT)[ ]([0-9]+)>/i; var noteN = /<(?:SKILLSET ADD ATTRIBUTE)[ ]([0-9]+)[ ](?:AT)[ ]([0-9]+)>/i; var noteO = /<(?:GAIN ATTRIBUTE)[ ]([0-9]+)[ ](?:AFTER SYNTHESIS WITH ITSELF OR MONSTER OF)[ ](GROUP|SIZE|RANK)[ ]([0-9]+)>/i; var noteR = /<(?:SKILLSET = SKILLSETS)[ ]((?:(?:[0-9]+[,])*(?:[0-9]+)[;])*(?:(?:[0-9]+[,])*(?:[0-9]+)))[ ](?:AT LEVEL MAX BY SYNTHESIS)>/i; var noteS = /<(?:BLOCK ANY SKILL OF ELEMENT)[ ]([0-9]+)[ ](?:AND ABSORB)[ ]([0-9]+)[ ](?:OF DAMAGE)>/i; var noteT = /<(?:PROFILE):[ ]([\wàáâäéèêëíìîïùúûüóòôôýÿçÁÀÂÄÉÈÊËÍÌÎÏÚÙÛÜÝ\d-+/_ ,.:;?µ*%$"()°<>&']+)>/i; var noteU = /<(?:FACE NAME:)[ ]([\wàáâäéèêëíìîïùúûüóòôôýÿçÁÀÂÄÉÈÊËÍÌÎÏÚÙÛÜÝ\d-+/_ ,.:;?µ*%$"()°<>&']+)(?:, FACE INDEX:)[ ]([\w\d0-9-+/_ ,.&']+)>/i; var noteV = /<(?:RISE UP RESISTANCE AT)[ ]([0-9]+)[ ](?:FOR THE)[ ](ELEMENT|STATE|DEBUFF)[ ]([0-9]+)[ ](?:AFTER)[ ]([0-9]+)[ ](?:SYNTHESIS)>/i; var noteW = /<(?:LEARN SKILL TENSION AT LEVEL)[ ]([0-9]+)>/i; for (var n = 1; n < $dataClasses.length; n++) { var obj = $dataClasses[n]; var notedata = obj.note.split(/[\r\n]+/); $dataClasses[n].GroupClassId = 1; $dataClasses[n].SizeClass = 1; $dataClasses[n].RankClassId = 1; $dataClasses[n].SkillSetDefault = 1; $dataClasses[n].AttributeList = []; $dataClasses[n].ParamMaxList = []; $dataClasses[n].ParamMaxList.push({'synthesisLevel':0, 'params':$dataClasses[n].params.map(function(paramLevel) { return paramLevel[paramLevel.length - 1]; })}); $dataClasses[n].IsClassicSynthesys = true; $dataClasses[n].Profile = "c\'est un monstre"; $dataClasses[n].faceName = "Actor1"; $dataClasses[n].faceIndex = 1; $dataClasses[n].battlerName = "Actor1_3"; $dataClasses[n].battlerHue = 0; $dataClasses[n].absorbElement = []; $dataClasses[n].resistSynthesisUp = []; var j = 0; var length = $dataSystem.elements.length; while(j < length) { $dataClasses[n].absorbElement.push(0); j++; } for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { DQM.Param.SkillsetData[DQM.Param.SkillsetData.length] = [n, 0, String(RegExp.$1)]; } else if (line.match(noteB)) { DQM.Param.SkillsetData[DQM.Param.SkillsetData.length] = [n, 1, String(RegExp.$1)]; } else if (line.match(noteC)) { DQM.Param.SkillsetData[DQM.Param.SkillsetData.length] = [n, 2, Number(RegExp.$2), Number(RegExp.$1)]; } else if (line.match(noteD)) { $dataClasses[n].GroupClassId = Number(RegExp.$1); } else if (line.match(noteE)) { $dataClasses[n].SizeClass = Number(RegExp.$1); } else if (line.match(noteF)) { $dataClasses[n].RankClassId = Number(RegExp.$1); } else if (line.match(noteG)) { DQM.Param.SkillsetData[DQM.Param.SkillsetData.length] = [n, 3, Number(RegExp.$3), Number(RegExp.$1), String(RegExp.$2)]; } else if (line.match(noteH)) { $dataClasses[n].AttributeList[$dataClasses[n].AttributeList.length] = {"attributeId":Number(RegExp.$1), "levelSynthesis":Number(RegExp.$2), "particularConditions":[]}; } else if (line.match(noteI)) { var newData = [Number(RegExp.$3), Number(String(RegExp.$1).replace('MHP',0).replace('MMP',1).replace('ATK',2).replace('DEF',3).replace('MAT',4).replace('MDF',5).replace('AGI',6).replace('LUK',7)), Number(RegExp.$2)]; var oldData = $dataClasses[n].ParamMaxList.filter(function(param) { return param.synthesisLevel === newData[0]; }); var index; if (oldData.length > 0) { index = $dataClasses[n].ParamMaxList.indexOf(oldData[0]); } else { oldData = $dataClasses[n].ParamMaxList.filter(function(param) { return param.synthesisLevel <= newData[0]; }); $dataClasses[n].ParamMaxList.push(oldData[oldData.length - 1]); index = $dataClasses[n].ParamMaxList.length - 1; $dataClasses[n].ParamMaxList.synthesisLevel = newData[0]; } $dataClasses[n].ParamMaxList[index].params[newData[1]] = newData[2]; $dataClasses[n].ParamMaxList = $dataClasses[n].ParamMaxList.sort(function(a, b) { return a.synthesisLevel - b.synthesisLevel; }); } else if (line.match(noteJ)) { $dataClasses[n].SkillSetDefault = Number(RegExp.$1); } else if (line.match(noteK)) { $dataClasses[n].IsClassicSynthesys = false; } else if (line.match(noteL)) { var NewFormula = String(line.substr(38,line.length-39)).split("; "); var newFormulaIndex = DQM.Param.SynthesisFormula.length; DQM.Param.SynthesisFormula[newFormulaIndex] = [n, NewFormula]; DQM.Param.SynthesisFormula[newFormulaIndex][1] = DQM.Param.SynthesisFormula[newFormulaIndex][1].map(function(newArray) { if (newArray.includes(';')) { var TempNewArray = newArray.split(';'); } else { var TempNewArray = [newArray]; } return TempNewArray.map(function(SmallArray) { if (SmallArray.includes(', ')) { var SmallTempArray = SmallArray.split(', '); } else { var SmallTempArray = [SmallArray]; } return SmallTempArray.map(function(MiniArray) { var FirstLetter = MiniArray.slice(0,1); var TempMiniArray = MiniArray.substr(1); if (TempMiniArray.includes(',')) { var MiniTempArray = [FirstLetter, TempMiniArray.split(',')]; } else { var MiniTempArray = [FirstLetter, [TempMiniArray]]; } return MiniTempArray; }); }); }); } else if (line.match(noteM)) { DQM.Param.SkillsetData[DQM.Param.SkillsetData.length] = [n, 4, Number(RegExp.$4), Number(RegExp.$2), String(RegExp.$3), Number(RegExp.$1)]; } else if (line.match(noteN)) { DQM.Param.SkillsetData[DQM.Param.SkillsetData.length] = [n, 5, Number(RegExp.$2), Number(RegExp.$1)]; } else if (line.match(noteO)) { $dataClasses[n].AttributeList[$dataClasses[n].AttributeList.length] = {"attributeId":Number(RegExp.$1), "levelSynthesis":0, "particularConditions":[{"ConditionsType":Number(String(RegExp.$2).replace('GROUP','1').replace('SIZE','2').replace('RANK','3')), "ValueId":Number(RegExp.$3)}]}; } else if (line.match(noteR)) { var newFormula = String(RegExp.$1); var finalFormula = []; if (newFormula.includes(';')) { finalFormula = newFormula.split(';'); } else { finalFormula = [newFormula]; } finalFormula = finalFormula.map(function(element) { if (element.includes(',')) { return element.split(','); } else { return [element]; } }); DQM.Param.SkillsetSynthesisData[DQM.Param.SkillsetSynthesisData.length] = {"id":n, "required":finalFormula}; } else if (line.match(noteS)) { $dataClasses[n].absorbElement[Number(RegExp.$1)] = $dataClasses[n].absorbElement[Number(RegExp.$1)] + Number(RegExp.$2); } else if (line.match(noteT)) { $dataClasses[n].Profile = String(RegExp.$1); } else if (line.match(noteU)) { $dataClasses[n].faceName = String(RegExp.$1); $dataClasses[n].faceIndex = String(RegExp.$2); } else if (line.match(noteV)) { $dataClasses[n].resistSynthesisUp.push({"code":Number(String(RegExp.$2).replace('ELEMENT','11').replace('DEBUFF','12').replace('STATE','13')),"dataId":Number(RegExp.$3),"value":(100 - Number(RegExp.$1)) / 100,"levelSynthesis":Number(RegExp.$4)}); } else if (line.match(noteW)) { $dataClasses[n].learnings.push({"level":Number(String(RegExp.$1)),"skillId":DQM.Param.TensionId}); } } } }; DataManager.processDQMNotetags3 = function() { var noteA = /<(?:IS CLASS OF)[ ]([0-9]+)>/i; var noteB = /<(?:SCALE BATTLER SPRITE IS)[ ]([0-9]+)(?:%)>/i; var noteC = /<(?:SCALE BATTLER SPRITE FOR AXE)[ ](X|Y)[ ](?:IS)[ ]([0-9]+)(?:%)>/i; for (var n = 1; n < $dataEnemies.length; n++) { var obj = $dataEnemies[n]; var notedata = obj.note.split(/[\r\n]+/); for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { $dataEnemies[n].ClassId = Number(RegExp.$1); $dataClasses[$dataEnemies[n].ClassId].battlerName = $dataEnemies[n].battlerName; $dataClasses[$dataEnemies[n].ClassId].battlerHue = $dataEnemies[n].battlerHue; } else if (line.match(noteB)) { $dataEnemies[n]._scaleX = Number(RegExp.$1); $dataEnemies[n]._scaleY = Number(RegExp.$1); } else if (line.match(noteC)) { if (String(RegExp.$1) === 'X') { $dataEnemies[n]._scaleX = Number(RegExp.$2); } else if (String(RegExp.$1) === 'Y') { $dataEnemies[n]._scaleY = Number(RegExp.$2); } } } for (var i = 0; i < notedata.length; i++){ if ($dataEnemies[n].ClassId && 0 < $dataEnemies[n].ClassId && $dataEnemies[n].ClassId < $dataClasses.length) { $dataClasses[$dataEnemies[n].ClassId].battlerName = $dataEnemies[n].battlerName; $dataClasses[$dataEnemies[n].ClassId].battlerHue = $dataEnemies[n].battlerHue; $dataClasses[$dataEnemies[n].ClassId]._scaleX = $dataEnemies[n]._scaleX; $dataClasses[$dataEnemies[n].ClassId]._scaleY = $dataEnemies[n]._scaleY; } } } DQM.Param.RandomTroopId = $dataTroops.length; $dataTroops[DQM.Param.RandomTroopId] = DQM.Param.TroopBasis; $dataTroops[DQM.Param.RandomTroopId].id = DQM.Param.RandomTroopId; }; DataManager.processDQMNotetags4 = function() { var noteA = /<(?:ATTRIBUTE NAME):[ ]([\wàáâäéèêëíìîïùúûüóòôôýÿçÁÀÂÄÉÈÊËÍÌÎÏÚÙÛÜÝ\d-+/_ ,.:;?µ*$"()°<>&%']+)>/i; var noteB = /<(?:ATTRIBUTE DESC):[ ]([\wàáâäéèêëíìîïùúûüóòôôýÿçÁÀÂÄÉÈÊËÍÌÎÏÚÙÛÜÝ\d-+/_ ,.:;?µ*$"()°<>&%']+)>/i; var noteC = /<(?:ATTRIBUTE DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS GROUP)[ ]([0-9]+)>/i; var noteD = /<(?:ATTRIBUTE DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS SIZE)[ ]([0-9]+)>/i; var noteE = /<(?:ATTRIBUTE DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS RANK)[ ]([0-9]+)>/i; var noteF = /<(?:ATTRIBUTE DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET WITH ATTRIBUTE)[ ]([0-9]+)>/i; var noteG = /<(?:ATTRIBUTE DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE WITH SKILLS OF ELEMENT)[ ]([0-9]+)>/i; var noteH = /<(?:ATTRIBUTE DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE WITH SKILLS OF TYPE)[ ]([0-9]+)>/i; var noteI = /<(?:ATTRIBUTE DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE WITH SKILLS OF DAMAGE TYPE)[ ]([0-9]+)>/i; var noteJ = /<(?:ATTRIBUTE NORMAL ATTACKS HAS)[ ]([0-9]+)(?:% OF CHANCE TO INFLICT THE STATUS)[ ]([0-9]+)>/i; var noteK = /<(?:ATTRIBUTE USE)[ ]([-]?[0-9]+)(?:%)[ ](?:LESS MP WITH SKILLS OF ELEMENT)[ ]([0-9]+)>/i; var noteL = /<(?:ATTRIBUTE USE)[ ]([-]?[0-9]+)(?:%)[ ](?:LESS MP WITH SKILLS OF TYPE)[ ]([0-9]+)>/i; var noteM = /<(?:ATTRIBUTE USE)[ ]([-]?[0-9]+)(?:%)[ ](?:LESS MP WITH SKILLS OF DAMAGE TYPE)[ ]([0-9]+)>/i; var noteN = /<(?:ATTRIBUTE CHANCE OF ESCAPE ARE ASSURED)>/i; var noteO = /<(?:ATTRIBUTE GAIN)[ ]([-]?[0-9]+)[ ](?:PRIORITIZE IN THE ORDER TURN)>/i; var noteP = /<(?:ATTRIBUTE USE SKILL)[ ]([0-9]+|TENSION)[ ](?:AT THE)[ ](BEGIN|END)[ ](?:OF THE)[ ](TURN|BATTLE|ACTION)[ ](?:WITH PROBABILITY)[ ]([0-9]+)>/i; var noteQ = /<(?:ATTRIBUTE ALL PHYSICAL SKILLS OF ACTOR TOUCH ALL ENEMIES)>/i; var noteR = /<(?:ATTRIBUTE GAIN BETWEEN)[ ]([0-9]+)[ ](?:AND)[ ]([0-9]+)[ ](?:SUPPLEMENTARY ATTACKS PER TURN)[ ](WITH|WITHOUT)[ ](?:ORDER)>/i; var noteS = /<(?:ATTRIBUTE REDUCES OF)[ ]([0-9]+)[ ](?:THE RESISTANCE OF ALL ENEMIES TO SKILLS OF ELEMENT)[ ]([0-9]+)>/i; var noteT = /<(?:ATTRIBUTE REDUCES OF)[ ]([0-9]+)[ ](?:THE RESISTANCE OF ALL ENEMIES TO SKILLS OF TYPE)[ ]([0-9]+)>/i; var noteV = /<(?:ATTRIBUTE REDUCES OF)[ ]([0-9]+)[ ](?:THE RESISTANCE OF ALL ENEMIES TO SKILLS WITH DEBUFF)[ ]([0-9]+)>/i; var noteW = /<(?:ATTRIBUTE REDUCES OF)[ ]([0-9]+)[ ](?:THE RESISTANCE OF ALL ENEMIES TO STATUS)[ ]([0-9]+)>/i; var noteX = /<(?:ATTRIBUTE GAIN)[ ]([-]?[0-9]+)[ ](?:BONUS FOR)[ ](PARAM|SPARAM|XPARAM)[ ]([0-9]+)>/i; var noteY = /<(?:ATTRIBUTE CANCEL EFFECT OF ATTRIBUTE)[ ]([0-9]+)>/i; var noteZ = /<(?:ATTRIBUTE GAIN STATE)[ ]([0-9]+)[ ](?:FOR)[ ]([0-9]+)[ ](?:FIRST TURNS)>/i; var noteAA = /<(?:ATTRIBUTE RAISE THE)[ ](GOLD|EXP|ITEM)[ ](?:OF)[ ]([0-9]+)(?:%)[ ](?:OBTAINED AT THE END OF BATTLE)>/i; var noteAB = /<(?:ATTRIBUTE RAISE THE POWER OF RECRUIT SKILL OF)[ ]([0-9]+)[ ](?:BY)[ ](ADDITION|MULTIPLICATION)>/i; var noteAC = /<(?:ATTRIBUTE MULTIPLY BY)[ ]([-]?[0-9]+)(?:%)[ ](?:THE)[ ](PARAM|SPARAM|XPARAM)[ ]([0-9]+)>/i; var noteAD = /<(?:ATTRIBUTE CAN EQUIP WITH ANY WEAPONS)>/i; var noteAE = /<(?:ATTRIBUTE GAIN USE OF SKILL)[ ]([0-9]+|TENSION)>/i; var noteAF = /<(?:ATTRIBUTE ACTIVATE)[ ]([0-9]+)[ ](?:TIMES THE SKILL)[ ]([0-9]+|TENSION)[ ](?:WHEN THE ACTOR HP IS BELOW)[ ]([0-9]+)(?:%)>/i; var noteAG = /<(?:ATTRIBUTE ACTIVATE)[ ](BUFF|DEBUFF)[ ](?:OF PARAM)[ ]([0-9]+)[ ]([0-9]+)[ ](?:TIMES AT THE BEGIN OF BATTLE TO)[ ](USER|ALL ALLIES|ALL ENEMIES)[ ](?:FOR)[ ]([0-9]+)[ ](?:TURNS)>/i; var noteAH = /<(?:ATTRIBUTE ACTIVATE BUFF OF PARAM)[ ]([0-9]+)[ ](?:AT THE BEGIN OF BATTLE FOR)[ ]([0-9]+)[ ](?:TURNS WITH PROBABILITY)[ ]([0-9]+)[ ](?:AND DEBUFF ELSE)>/i; var noteAI = /<(?:ATTRIBUTE REGENERATE)[ ]([0-9]+)(?:%)[ ](?:OF)[ ](HP|MP)[ ](?:OF)[ ](USER|ALL ALLIES)[ ](?:AT THE END OF THE TURN)>/i; var noteAJ = /<(?:CHANGE TENSION OF TARGET TO THE CURRENT LEVEL)[ ]([-]?[0-9]+)>/i; var noteAK = /<(?:DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS GROUP)[ ]([0-9]+)>/i; var noteAL = /<(?:DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS SIZE)[ ]([0-9]+)>/i; var noteAM = /<(?:DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS RANK)[ ]([0-9]+)>/i; var noteAN = /<(?:DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET WITH ATTRIBUTE)[ ]([0-9]+)>/i; var noteAO = /<(?:REMOVE ANY TENSION BOOST)>/i; var noteAP = /<(?:REMOVE ANY TENSION UNBOOST)>/i; var noteAQ = /<(?:REPLACE THE ATTRIBUTE)[ ]([0-9]+)>/i; var noteAR = /<(?:FOR EACH ADDITIONNAL HIT, REDUCE THE STRENGTH OF)[ ]([0-9]+)(%| POINTS)>/i; var noteAS = /<(?:MONSTERS WITH CLASS ID)[ ]((?:[0-9]+[,])*(?:[0-9]+))[ ](?:MULTIPLY PHYSICAL HITS BY)[ ]([0-9]+)>/i; for (var n = 1; n < $dataSkills.length; n++) { var obj = $dataSkills[n]; var notedata = obj.note.split(/[\r\n]+/); for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 0, String(RegExp.$1)]; } else if (line.match(noteB)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 1, String(RegExp.$1)]; } else if (line.match(noteC)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 2, Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteD)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 3, Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteE)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 4, Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteF)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 5, Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteG)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 6, Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteH)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 7, Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteI)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 8, Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteJ)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 35, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteK)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 10, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteL)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 11, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteM)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 12, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteN)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 36]; } else if (line.match(noteO)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 14, Number(RegExp.$1)]; } else if (line.match(noteP)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 15, String(RegExp.$1), String(RegExp.$2), String(RegExp.$3), Number(RegExp.$4)]; } else if (line.match(noteQ)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 16]; } else if (line.match(noteR)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 17, Number(RegExp.$1), Number(RegExp.$2), String(RegExp.$3)]; } else if (line.match(noteS)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 18, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteT)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 19, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteV)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 21, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteW)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 22, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteX)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 23, Number(RegExp.$1), String(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteY)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 24, Number(RegExp.$1)]; } else if (line.match(noteZ)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 25, Number(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteAA)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 26, String(RegExp.$1), Number(RegExp.$2)]; } else if (line.match(noteAB)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 27, Number(RegExp.$1), String(RegExp.$2)]; } else if (line.match(noteAC)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 28, Number(RegExp.$1), String(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteAD)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 29]; } else if (line.match(noteAE)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 30, String(RegExp.$1)]; } else if (line.match(noteAF)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 31, Number(RegExp.$1), String(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteAG)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 32, String(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3), String(RegExp.$4), Number(RegExp.$5)]; } else if (line.match(noteAH)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 33, Number(RegExp.$1), Number(RegExp.$2), Number(RegExp.$3)]; } else if (line.match(noteAI)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 34, Number(RegExp.$1), String(RegExp.$2), String(RegExp.$3)]; } else if (line.match(noteAJ)) { $dataSkills[n].effects.push({"code":101,"dataId":0,"value1":Number(RegExp.$1),"value2":0}); } else if (line.match(noteAK)) { $dataSkills[n].effects.push({"code":105,"dataId":Number(RegExp.$3),"value1":Number(RegExp.$1),"value2":Number(RegExp.$2)}); } else if (line.match(noteAL)) { $dataSkills[n].effects.push({"code":106,"dataId":Number(RegExp.$3),"value1":Number(RegExp.$1),"value2":Number(RegExp.$2)}); } else if (line.match(noteAM)) { $dataSkills[n].effects.push({"code":107,"dataId":Number(RegExp.$3),"value1":Number(RegExp.$1),"value2":Number(RegExp.$2)}); } else if (line.match(noteAN)) { $dataSkills[n].effects.push({"code":108,"dataId":Number(RegExp.$3),"value1":Number(RegExp.$1),"value2":Number(RegExp.$2)}); } else if (line.match(noteAO)) { $dataSkills[n].effects.push({"code":109,"dataId":0,"value1":1,"value2":0}); } else if (line.match(noteAP)) { $dataSkills[n].effects.push({"code":109,"dataId":0,"value1":-1,"value2":0}); } else if (line.match(noteAQ)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 37, Number(RegExp.$1)]; } else if (line.match(noteAR)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 38, Number(RegExp.$1), String(RegExp.$2)]; } else if (line.match(noteAS)) { DQM.Param.AttributeData[DQM.Param.AttributeData.length] = [n, 39, String(RegExp.$1), Number(RegExp.$2)]; } } } DQM.Param.RecruitId = $dataSkills.length; DQM.Param.TensionId = $dataSkills.length+1; $dataSkills[DQM.Param.RecruitId] = {}; $dataSkills[DQM.Param.RecruitId] = {"id":DQM.Param.RecruitId,"animationId":-1,"damage":{"critical":true,"elementId":-1,"formula":DQM.Param.RecruitFormula,"type":0,"variance":20},"description":"","effects":[{"code":102,"dataId":0,"value1":0,"value2":0}],"hitType":1,"iconIndex":76,"message1":DQM.Param.RecruitMessageUse,"message2":"","mpCost":0,"name":"Recruter","note":"Compétence #2001 sera utilisée lorsque\nvous sélectionnerez la commande Recruter.","occasion":1,"repeats":1,"requiredWtypeId1":0,"requiredWtypeId2":0,"scope":1,"speed":0,"stypeId":0,"successRate":100,"tpCost":0,"tpGain":0}; $dataSkills[DQM.Param.TensionId] = {}; $dataSkills[DQM.Param.TensionId] = {"id":DQM.Param.TensionId,"animationId":58,"damage":{"critical":false,"elementId":0,"formula":0,"type":0,"variance":0},"description":"","effects":[{"code":101,"dataId":0,"value1":1,"value2":0}],"hitType":0,"iconIndex":0,"message1":DQM.Param.TensionMessageUse,"message2":"","mpCost":0,"name":"Tension","note":"Compétence #2002 sera utilisée lorsque\nvous sélectionnerez la commande Tension.","occasion":1,"repeats":1,"requiredWtypeId1":0,"requiredWtypeId2":0,"scope":11,"speed":0,"stypeId":0,"successRate":100,"tpCost":0,"tpGain":0}; }; DataManager.processDQMNotetags5 = function() { var noteA = /<(?:ACTOR EQUIPPED WITH THIS GIVE CLASS TO SYNTHESIS RESULT)>/i; var noteB = /<(?:ACTOR EQUIPPED WITH THIS GIVE GENDER)[ ](-1|0|1)[ ](?:TO SYNTHESIS RESULT)>/i; var noteC = /<(?:WEAPON DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS GROUP)[ ]([0-9]+)>/i; var noteD = /<(?:WEAPON DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS SIZE)[ ]([0-9]+)>/i; var noteE = /<(?:WEAPON DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET OF CLASS RANK)[ ]([0-9]+)>/i; var noteF = /<(?:WEAPON DEALT)[ ]([-]?[0-9]+)(?:%)[ ](?:MORE DAMAGE AND)[ ]([-]?[0-9]+)[ ](?:BONUS DAMAGE TO TARGET WITH ATTRIBUTE)[ ]([0-9]+)>/i; for (var n = 1; n < $dataWeapons.length; n++) { var obj = $dataWeapons[n]; var notedata = obj.note.split(/[\r\n]+/); $dataWeapons[n]._attributeAddedEffect = []; for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { $dataWeapons[n].traits.push({"code":104,"dataId":0,"value":0}); } else if (line.match(noteB)) { $dataWeapons[n].traits.push({"code":105,"dataId":0,"value":Number(RegExp.$1)}); } else if (line.match(noteC)) { $dataWeapons[n]._attributeAddedEffect.push({"code":1, "type":1, "id":Number(RegExp.$4), "value1":Number(RegExp.$2), "value2":Number(RegExp.$3), "chance":1, "occasion":0, "target":0}); } else if (line.match(noteD)) { $dataWeapons[n]._attributeAddedEffect.push({"code":1, "type":2, "id":Number(RegExp.$4), "value1":Number(RegExp.$2), "value2":Number(RegExp.$3), "chance":1, "occasion":0, "target":0}); } else if (line.match(noteE)) { $dataWeapons[n]._attributeAddedEffect.push({"code":1, "type":3, "id":Number(RegExp.$4), "value1":Number(RegExp.$2), "value2":Number(RegExp.$3), "chance":1, "occasion":0, "target":0}); } else if (line.match(noteF)) { $dataWeapons[n]._attributeAddedEffect.push({"code":1, "type":4, "id":Number(RegExp.$4), "value1":Number(RegExp.$2), "value2":Number(RegExp.$3), "chance":1, "occasion":0, "target":0}); } } } }; DataManager.processDQMNotetags6 = function() { var noteA = /<(?:ACTOR EQUIPPED WITH THIS GIVE CLASS TO SYNTHESIS RESULT)>/i; var noteB = /<(?:ACTOR EQUIPPED WITH THIS GIVE GENDER)[ ](-1|0|1)[ ](?:TO SYNTHESIS RESULT)>/i; for (var n = 1; n < $dataArmors.length; n++) { var obj = $dataArmors[n]; var notedata = obj.note.split(/[\r\n]+/); for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { $dataArmors[n].traits.push({"code":104,"dataId":0,"value":0}); } else if (line.match(noteB)) { $dataArmors[n].traits.push({"code":105,"dataId":0,"value":Number(RegExp.$1)}); } } } }; DataManager.processDQMNotetags7 = function() { var noteA = /<(?:MONSTER)[ ]([0-9]+)[ ](?:IN THIS ZONE HAS LEVEL)[ ]([0-9]+)(?:[ ](?:IN TROOP)[ ]([0-9]+)(?:[ ](?:FOR MEMBER)[ ]([0-9]+))?)?>/i; var noteB = /<(?:MONSTER)[ ]([0-9]+)[ ](?:IN THIS ZONE HAS SKILLSET)[ ]([0-9]+|DEFAULT)[ ](?:WITH)[ ]([0-9]+)[ ](?:JOB POINTS)(?:[ ](?:IN TROOP)[ ]([0-9]+)(?:[ ](?:FOR MEMBER)[ ]([0-9]+))?)?>/i; var noteC = /<(?:MONSTER)[ ]([0-9]+)[ ](?:IN THIS ZONE HAS ATTRIBUTE)[ ]([0-9]+)[ ](?:ACTIVATED)(?:[ ](?:IN TROOP)[ ]([0-9]+)(?:[ ](?:FOR MEMBER)[ ]([0-9]+))?)?>/i; var noteD = /<(?:CAN GENERATE RANDOM TROOP IN THIS ZONE)>/i; var noteE = /<(?:ALL MONSTERS IN THIS ZONE HAS MINIMUM LEVEL)[ ]([0-9]+)>/i; var noteF = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST BE ALREADY ENCOUNTERED)>/i; var noteG = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST HAVE THE ID)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteH = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST HAVE THE RANK)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteI = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST HAVE THE SIZE)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteJ = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST BE IN THE GROUP)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteK = /<(?:DON'T APPLY LEVEL AND SKILLSET GENERATION FOR TROOP)[ ]([0-9]+)>/i; var noteL = /<(?:ALL MONSTERS IN THIS MAP MUST HAVE AT LEAST)[ ]([0-9]+)[ ](?:SKILLSETS ASSIGNED)>/i; var noteM = /<(?:MONSTERS ENCOUNTERED HAVEN'T NECESSARILY THEIR DEFAULT SKILLSET)>/i; var noteN = /<(?:MONSTERS IN THIS ZONE CANNOT HAVE SKILLSETS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteO = /<(?:ALL MONSTERS OF TROOP)[ ]([0-9]+)[ ](?:IN THIS ZONE HAS MINIMUM LEVEL)[ ]([0-9]+)>/i; var noteP = /<(?:RANDOM TROOP HAS AT MOST)[ ]([0-9]+)[ ](?:MEMBERS)>/i; var noteQ = /<(?:MONSTER)[ ]([0-9]+)[ ](?:IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS LEVEL)[ ]([0-9]+)(?:[ ](?:IN TROOP)[ ]([0-9]+)(?:[ ](?:FOR MEMBER)[ ]([0-9]+))?)?>/i; var noteR = /<(?:MONSTER)[ ]([0-9]+)[ ](?:IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS SKILLSET)[ ]([0-9]+|DEFAULT)[ ](?:WITH)[ ]([0-9]+)[ ](?:JOB POINTS)(?:[ ](?:IN TROOP)[ ]([0-9]+)(?:[ ](?:FOR MEMBER)[ ]([0-9]+))?)?>/i; var noteS = /<(?:MONSTER)[ ]([0-9]+)[ ](?:IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS ATTRIBUTE)[ ]([0-9]+)[ ](?:ACTIVATED)(?:[ ](?:IN TROOP)[ ]([0-9]+)(?:[ ](?:FOR MEMBER)[ ]([0-9]+))?)?>/i; var noteT = /<(?:CAN GENERATE RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteU = /<(?:ALL MONSTERS IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS MINIMUM LEVEL)[ ]([0-9]+)>/i; var noteV = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST BE ALREADY ENCOUNTERED)>/i; var noteW = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST HAVE THE ID)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteX = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST HAVE THE RANK)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteY = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST HAVE THE SIZE)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteZ = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST BE IN THE GROUP)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteAA = /<(?:DON'T APPLY LEVEL AND SKILLSET GENERATION IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:FOR TROOP)[ ]([0-9]+)>/i; var noteAB = /<(?:ALL MONSTERS IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST HAVE AT LEAST)[ ]([0-9]+)[ ](?:SKILLSETS ASSIGNED)>/i; var noteAC = /<(?:MONSTERS ENCOUNTERED IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAVEN'T NECESSARILY THEIR DEFAULT SKILLSET)>/i; var noteAD = /<(?:MONSTERS IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:CANNOT HAVE SKILLSETS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteAE = /<(?:ALL MONSTERS OF TROOP)[ ]([0-9]+)[ ](?:IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS MINIMUM LEVEL)[ ]([0-9]+)>/i; var noteAF = /<(?:RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS AT MOST)[ ]([0-9]+)[ ](?:MEMBERS)>/i; var noteAG = /<(?:SKILLSETS ARE SELECTED RANDOMLY)>/i; var noteAH = /<(?:ATTRIBUTES ARE SELECTED RANDOMLY)>/i; var noteAI = /<(?:SKILLSETS ARE SELECTED RANDOMLY IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteAJ = /<(?:ATTRIBUTES ARE SELECTED RANDOMLY IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var obj = $dataMap; $dataMap.randomSkillset = []; $dataMap.randomAttributes = []; $dataMap.detailsMonster = []; $dataMap.troopExceptions = []; $dataMap.levelMin = []; $dataMap.skillsetDefaultAutomatic = []; $dataMap.skillsetMin = []; $dataMap.skillsetExcluded = []; $dataMap.maxEnemies = []; $dataMap.encounterRandomConditions = [{"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}]; var notedata = obj.note.split(/[\r\n]+/); for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { var newLine = {"enemyId":Number(RegExp.$1), "codeDetail":1, "idDetail":0, "value":Number(RegExp.$2), "troopId":Number(RegExp.$3 || 0), "memberId":Number(RegExp.$4 || 0), "regionSet":[]}; if ($dataMap.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMap.detailsMonster.push(newLine); } } else if (line.match(noteB)) { var newLine = {"enemyId":Number(RegExp.$1), "codeDetail":2, "idDetail":String(RegExp.$2) !== 'DEFAULT' ? Number(RegExp.$2) : $dataClasses[$dataEnemies[Number(RegExp.$1)].ClassId].SkillSetDefault, "value":Number(RegExp.$3), "troopId":Number(RegExp.$4 || 0), "memberId":Number(RegExp.$5 || 0), "regionSet":[]}; if ($dataMap.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMap.detailsMonster.push(newLine); } } else if (line.match(noteC)) { var newLine = {"enemyId":Number(RegExp.$1), "codeDetail":3, "idDetail":Number(RegExp.$2), "value":0, "troopId":Number(RegExp.$3 || 0), "memberId":Number(RegExp.$4 || 0), "regionSet":[]}; if ($dataMap.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMap.detailsMonster.push(newLine); } } else if (line.match(noteD)) { if ($dataMap.encounterList.every(function(troop) { return troop.troopId !== DQM.Param.RandomTroopId || troop.regionSet.length < 1; })) { $dataMap.encounterList.push({"troopId":DQM.Param.RandomTroopId, "weight":5, "regionSet":[]}); } } else if (line.match(noteE)) { var newLine = {"levelMin":Number(RegExp.$1), "regionSet":[]}; if ($dataMap.levelMin.every( function(detail) { return detail.levelMin !== newLine.levelMin || detail.regionSet !== newLine.regionSet; })) { $dataMap.levelMin.push(newLine); } } else if (line.match(noteF)) { $dataMap.encounterRandomConditions[0].onlyEncountered = true; } else if (line.match(noteG)) { $dataMap.encounterRandomConditions[0].idList = String(RegExp.$1).split(','); } else if (line.match(noteH)) { $dataMap.encounterRandomConditions[0].rankClass = String(RegExp.$1).split(','); } else if (line.match(noteI)) { $dataMap.encounterRandomConditions[0].sizeClass = String(RegExp.$1).split(','); } else if (line.match(noteJ)) { $dataMap.encounterRandomConditions[0].groupClass = String(RegExp.$1).split(','); } else if (line.match(noteK)) { $dataMap.troopExceptions[0] = $dataMap.troopExceptions[0] || []; $dataMap.troopExceptions[0].push(Number(RegExp.$1)); } else if (line.match(noteL)) { $dataMap.skillsetMin[Number(RegExp.$1)] = $dataMap.skillsetMin[Number(RegExp.$1)] || []; $dataMap.skillsetMin[Number(RegExp.$1)].push(0); } else if (line.match(noteM)) { $dataMap.skillsetDefaultAutomatic.push(0); } else if (line.match(noteN)) { $dataMap.skillsetExcluded[0] = String(RegExp.$1).split(','); } else if (line.match(noteO)) { var newLine = {"enemyId":0, "codeDetail":1, "idDetail":0, "value":Number(RegExp.$2), "troopId":Number(RegExp.$1), "memberId":0, "regionSet":[]}; if ($dataMap.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMap.detailsMonster.push(newLine); } } else if (line.match(noteP)) { $dataMap.maxEnemies[Number(RegExp.$1)] = $dataMap.maxEnemies[Number(RegExp.$1)] || []; $dataMap.maxEnemies[Number(RegExp.$1)].push(0); } else if (line.match(noteQ)) { var newLine = {"enemyId":Number(RegExp.$1), "codeDetail":1, "idDetail":0, "value":Number(RegExp.$3), "troopId":Number(RegExp.$4 || 0), "memberId":Number(RegExp.$5 || 0), "regionSet":String(RegExp.$2).split(',')}; if ($dataMap.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMap.detailsMonster.push(newLine); } } else if (line.match(noteR)) { var newLine = {"enemyId":Number(RegExp.$1), "codeDetail":2, "idDetail":String(RegExp.$3) !== 'DEFAULT' ? Number(RegExp.$3) : $dataClasses[$dataEnemies[Number(RegExp.$1)].ClassId].SkillSetDefault, "value":Number(RegExp.$4), "troopId":Number(RegExp.$5 || 0), "memberId":Number(RegExp.$6 || 0), "regionSet":String(RegExp.$2).split(',')}; if ($dataMap.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMap.detailsMonster.push(newLine); } } else if (line.match(noteS)) { var newLine = {"enemyId":Number(RegExp.$1), "codeDetail":3, "idDetail":Number(RegExp.$3), "value":0, "troopId":Number(RegExp.$4 || 0), "memberId":Number(RegExp.$5 || 0), "regionSet":String(RegExp.$2).split(',')}; if ($dataMap.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMap.detailsMonster.push(newLine); } } else if (line.match(noteT)) { if ($dataMap.encounterList.every(function(troop) { return troop.troopId !== DQM.Param.RandomTroopId; })) { $dataMap.encounterList.push({"troopId":DQM.Param.RandomTroopId, "weight":5, "regionSet":String(RegExp.$1).split(',')}); } } else if (line.match(noteU)) { var newLine = {"levelMin":Number(RegExp.$2), "regionSet":String(RegExp.$1).split(',')}; if ($dataMap.levelMin.every( function(detail) { return detail.levelMin !== newLine.levelMin || detail.regionSet !== newLine.regionSet; })) { $dataMap.levelMin.push(newLine); } } else if (line.match(noteV)) { var result = {"regionList":String(RegExp.$1).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMap.encounterRandomConditions[Number(result.regionList[k])] = $dataMap.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[Number(result.regionList[k])].onlyEncountered = true; } } else if (line.match(noteW)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMap.encounterRandomConditions[Number(result.regionList[k])] = $dataMap.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[Number(result.regionList[k])].idList = result.detail; } } else if (line.match(noteX)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMap.encounterRandomConditions[Number(result.regionList[k])] = $dataMap.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[Number(result.regionList[k])].rankClass = result.detail; } } else if (line.match(noteY)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMap.encounterRandomConditions[Number(result.regionList[k])] = $dataMap.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[Number(result.regionList[k])].sizeClass = result.detail; } } else if (line.match(noteZ)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMap.encounterRandomConditions[Number(result.regionList[k])] = $dataMap.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[Number(result.regionList[k])].groupClass = result.detail; } } else if (line.match(noteAA)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":Number(RegExp.$2)}; for (var k = 0; k < result.regionList.length; k++) { $dataMap.troopExceptions[Number(result.regionList[k])] = $dataMap.troopExceptions[Number(result.regionList[k])] || []; $dataMap.troopExceptions[Number(result.regionList[k])].push(Number(RegExp.$1)); } } else if (line.match(noteAB)) { $dataMap.skillsetMin[Number(RegExp.$2)] = $dataMap.skillsetMin[Number(RegExp.$2)] || []; $dataMap.skillsetMin[Number(RegExp.$2)] = $dataMap.skillsetMin[Number(RegExp.$2)].concat(String(RegExp.$1).split(',')); } else if (line.match(noteAC)) { $dataMap.skillsetDefaultAutomatic = $dataMap.skillsetDefaultAutomatic.concat(String(RegExp.$1).split(',')); } else if (line.match(noteAD)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMap.skillsetExcluded[Number(result.regionList[k])] = $dataMap.skillsetExcluded[Number(result.regionList[k])] || []; $dataMap.skillsetExcluded[Number(result.regionList[k])] = $dataMap.skillsetExcluded[Number(result.regionList[k])].concat(result.detail); } } else if (line.match(noteAE)) { var newLine = {"enemyId":0, "codeDetail":1, "idDetail":0, "value":Number(RegExp.$3), "troopId":Number(RegExp.$1), "memberId":0, "regionSet":String(RegExp.$2).split(',')}; if ($dataMap.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMap.detailsMonster.push(newLine); } } else if (line.match(noteAF)) { $dataMap.maxEnemies[Number(RegExp.$2)] = $dataMap.maxEnemies[Number(RegExp.$2)] || []; $dataMap.maxEnemies[Number(RegExp.$2)] = $dataMap.maxEnemies[Number(RegExp.$2)].concat(String(RegExp.$1).split(',')); } else if (line.match(noteAG)) { $dataMap.randomSkillset.push(0); } else if (line.match(noteAH)) { $dataMap.randomAttributes.push(0); } else if (line.match(noteAI)) { $dataMap.randomSkillset = $dataMap.randomSkillset.concat(String(RegExp.$1).split(',')); } else if (line.match(noteAJ)) { $dataMap.randomAttributes = $dataMap.randomAttributes.concat(String(RegExp.$1).split(',')); } } }; DataManager.processDQMNotetags8 = function() { var noteA = /<(?:GIVE SKILLSET)[ ]([0-9]+)[ ](?:TO THE TARGET)>/i; var noteB = /<(?:GIVE)[ ]([0-9]+)[ ](?:JOB POINTS TO THE TARGET)>/i; var noteC = /<(?:CHANGE TENSION OF TARGET TO THE CURRENT LEVEL)[ ]([-]?[0-9]+)>/i; var noteD = /<(?:REMOVE ANY TENSION BOOST)>/i; var noteE = /<(?:REMOVE ANY TENSION UNBOOST)>/i; for (var n = 1; n < $dataItems.length; n++) { var obj = $dataItems[n]; var notedata = obj.note.split(/[\r\n]+/); for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { $dataItems[n].effects.push({"code":104,"dataId":Number(RegExp.$1),"value1":0,"value2":0}); } else if (line.match(noteB)) { $dataItems[n].effects.push({"code":103,"dataId":0,"value1":Number(RegExp.$1),"value2":0}); } else if (line.match(noteC)) { $dataSkills[n].effects.push({"code":101,"dataId":0,"value1":Number(RegExp.$1),"value2":0}); } else if (line.match(noteD)) { $dataSkills[n].effects.push({"code":109,"dataId":0,"value1":1,"value2":0}); } else if (line.match(noteE)) { $dataSkills[n].effects.push({"code":109,"dataId":0,"value1":-1,"value2":0}); } } } }; DataManager.processDQMNotetags9 = function() { var noteA = /<(?:GAIN)[ ]([-]?[0-9]+)[ ](?:BONUS FOR)[ ](PARAM|SPARAM|XPARAM)[ ]([0-9]+)>/i; for (var n = 1; n < $dataStates.length; n++) { var obj = $dataStates[n]; var notedata = obj.note.split(/[\r\n]+/); for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { var newTrait = {"code":Number(String(RegExp.$2).replace('PARAM','21').replace('SPARAM','23').replace('XPARAM','22')),"dataId":Number(RegExp.$3),"value":Number(RegExp.$1)}; if (newTrait !== 21) { newTrait.value = newTrait.value / 100; } $dataStates[n].traits.push(newTrait); } } } }; DQM.Core.DataManager_createGameObjects = DataManager.createGameObjects; DataManager.createGameObjects = function() { $gameSkillset = new Game_Skillset(); $gameSynthesis = new Game_Synthesis(); $gameAttributes = new Game_Attribute(); DQM.Core.DataManager_createGameObjects.apply(this); $gameSystem._maxSizeTeam = $gameSystem._maxSizeTeam || DQM.Param.MaxSizeTeam; $gameSystem._maxBattlers = $gameSystem._maxBattlers || DQM.Param.MaxBattlers; $gameSystem._maxSupplementaryTeam = $gameSystem._maxSupplementaryTeam || DQM.Param.MaxSupplementaryTeam; $gameParty._allMembers = true; $gameParty._changeListMembersAllowed = true; $gameParty._namePlayer = $gameParty._namePlayer || $dataActors[1].name; }; DQM.Core.DataManager_extractSaveContents = DataManager.extractSaveContents; DataManager.extractSaveContents = function(contents) { DQM.Core.DataManager_extractSaveContents.call(this, contents); $gameSystem._maxSizeTeam = $gameSystem._maxSizeTeam || DQM.Param.MaxSizeTeam; $gameSystem._maxBattlers = $gameSystem._maxBattlers || DQM.Param.MaxBattlers; $gameSystem._maxSupplementaryTeam = $gameSystem._maxSupplementaryTeam || DQM.Param.MaxSupplementaryTeam; $gameParty._allMembers = true; $gameParty._changeListMembersAllowed = true; $gameParty._namePlayer = $gameParty._namePlayer || $dataActors[1].name; this.extractForActors(); }; DataManager.extractForActors = function() { $gameActors._data.forEach(function(actor) { if (actor) { var data = $dataActors[actor._actorId]; if (!data) { data = {"id":null,"battlerName":null,"characterIndex":null,"characterName":null,"classId":null,"equips":null,"faceIndex":null,"faceName":null,"traits":null,"initialLevel":null,"maxLevel":null,"name":null,"nickname":null,"note":null,"profile":null}; data.id = actor._actorId; data.traits = []; } data.battlerName = actor._battlerName; data.characterIndex = actor._characterIndex; data.characterName = actor._characterName; data.classId = actor._classId; data.equips = actor._equips; data.faceIndex = actor._faceIndex; data.faceName = actor._faceName; data.initialLevel = 1; data.maxLevel = actor.maxLevel(); data.name = actor._name; data.nickname = actor._nickname; data.profile = actor._profile; data.Skillsets = actor._skillsets.map(function(skillset) { return [skillset.id, skillset.jobPoints]; }); data.jobPoints = actor._jobPoints; $dataActors[actor._actorId] = data; } }); }; //============================================================================= // Scene_Manager //============================================================================= //============================================================================= // BattleManager //============================================================================= DQM.Core.BattleManager_initMembers = BattleManager.initMembers; BattleManager.initMembers = function() { DQM.Core.BattleManager_initMembers.call(this); this._recruitLvl = null; this._canRecruit = null; this._recruitIndex = null; this._recruitSuccess = false; }; DQM.Core.BattleManager_setup = BattleManager.setup; BattleManager.setup = function(troopId, canEscape, canLose) { DQM.Core.BattleManager_setup.call(this, troopId, canEscape, canLose); this._recruitLvl = 0; $gameTroop.setMapDatas(); this._canRecruit = this._canEscape && $gameTroop.members().every(function(enemy) { return enemy._level && enemy.hasAClass() ; }) && $gameParty.canAddNewActor(); if ($gameTroop.members().some(function(enemy) { return !enemy._level; })) { this.recruitForbidden(); } if (this._canEscape && $gameTroop.members().every(function(enemy) { return enemy._level; }) && $gameMap.displayName()) { for (var k = 0; k < $gameTroop.members().length; k++) { $gameSystem.addLocationInfo($gameTroop.members()[k].enemy().ClassId, $gameMap.displayName()); } } }; BattleManager.startInput = function() { this._phase = 'input'; if (!this._surprise) { $gameParty.makeActions(); } if (!this._preemptive) { $gameTroop.makeActions(); } this.clearActor(); if (this._surprise || !$gameParty.canInput()) { this.startTurn(); } }; DQM.Core.BattleManager_makeEscapeRatio = BattleManager.makeEscapeRatio; BattleManager.makeEscapeRatio = function() { var result = $gameParty.members().some(function(actor) { return actor.AttributeEnsureEscape().length > 0; }) || $gameTroop.members().some(function(enemy) { return enemy.AttributeEnsureEscape().length > 0; }); if (result) { this._escapeRatio = 1; } else { DQM.Core.BattleManager_makeEscapeRatio.call(this); } }; DQM.Core.BattleManager_startBattle = BattleManager.startBattle; BattleManager.startBattle = function() { DQM.Core.BattleManager_startBattle.call(this); this.allBattleMembers().forEach(function(subject) { if (subject.isAlive() && (!this._preemptive || !subject.isEnemy()) && (!this._surprise || !subject.isActor())) { subject._actions = [null].concat(subject._actions); this.processAutomatedAction(subject, 2, true, true); } }, this); this._phase = 'turn'; this.clearActor(); this.makeActionOrders(); $gameParty.requestMotionRefresh(); this._logWindow.startTurn(); var priorityA; var priorityB; this._actionBattlers = this._actionBattlers.sort(function(a, b) { priorityA = a.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; priorityB = b.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; if (priorityB !== priorityA) { return priorityB - priorityA; } else { return b.speed() - a.speed(); } }); }; BattleManager.recruitForbidden = function() { this._canRecruit = false; }; BattleManager.isRecruitAllowed = function() { return this._canRecruit; }; DQM.Core.BattleManager_startTurn = BattleManager.startTurn; BattleManager.startTurn = function() { var IsRecruit = false; if (!this._surprise) { $gameParty.members().forEach(function(battler) { var action = battler.inputtingAction(); if (action) { if (action.isSkill() && action._item._itemId === battler.attackRecruitId()) { IsRecruit = true; } } }); } if (IsRecruit) { this._phase = 'turn'; this.clearActor(); $gameTroop.increaseTurn(); this.makeActionOrdersRecruit(); $gameParty.requestMotionRefresh(); this._logWindow.startTurnRecruit(); } else { this.allBattleMembers().forEach(function(subject) { if (subject.isAlive() && (!this._preemptive || !subject.isEnemy()) && (!this._surprise || !subject.isActor())) { subject._actions = [null].concat(subject._actions).concat([null]); this.processAutomatedAction(subject, 1, true, true); this.processAutomatedAction(subject, 4, true, false); } }, this); DQM.Core.BattleManager_startTurn.call(this); var priorityA; var priorityB; this._actionBattlers.sort(function(a, b) { priorityA = a.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; priorityB = b.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; if (priorityB !== priorityA) { return priorityB - priorityA; } else { return b.speed() - a.speed(); } }); } }; BattleManager.makeActionOrdersRecruit = function() { var battlers_1 = []; var battlers_2 = []; if (!this._surprise) { battlers_1 = battlers_1.concat($gameParty.members()); } if (!this._preemptive) { battlers_2 = battlers_2.concat($gameTroop.members()); } battlers_1.forEach(function(battler) { battler.makeSpeed(); }); battlers_2.forEach(function(battler) { battler.makeSpeed(); }); var priorityA; var priorityB; battlers_1.sort(function(a, b) { priorityA = a.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; priorityB = b.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; if (priorityB !== priorityA) { return priorityB - priorityA; } else { return b.speed() - a.speed(); } }); battlers_2.sort(function(a, b) { priorityA = a.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; priorityB = b.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; if (priorityB !== priorityA) { return priorityB - priorityA; } else { return b.speed() - a.speed(); } }); this._actionBattlers = battlers_1.concat(battlers_2); }; BattleManager.startAction = function() { var subject = this._subject; var action = subject.currentAction(); var targets = action.makeTargets(); this._phase = 'action'; this._action = action; this._targets = targets; subject.useItem(action.item(), action.byAttribute); this._action.applyGlobal(); this.refreshStatus(); this._logWindow.startAction(subject, action, targets); }; DQM.Core.BattleManager_invokeAction = BattleManager.invokeAction; BattleManager.invokeAction = function(subject, target) { this._logWindow._waitCount = 0; if (this._action.isSkill() && this._action._item._itemId === subject.attackRecruitId()) { this._logWindow.push('pushBaseLine'); var result = this.invokeRecruitAction(subject, target); subject.setLastTarget(target); this._logWindow.push('popBaseLine'); this.refreshStatus(); var nextActor = this._actionBattlers[0]; if ((nextActor && subject && nextActor.isEnemy() && subject.isActor()) || this._recruitLvl + result >= 100) { this.checkRecruit(target, result); } } else if (Math.random() < this._action.itemPrf(target)) { this._logWindow.push('pushBaseLine'); this.invokeMagicReflection(subject, target); subject.setLastTarget(target); this._logWindow.push('popBaseLine'); this.refreshStatus(); } else { DQM.Core.BattleManager_invokeAction.call(this, subject, target); } }; BattleManager.invokeRecruitAction = function(subject, target) { var realTarget = this.applySubstitute(target); this._action.apply(realTarget); var result = realTarget.result()._recruitGaugeUp; result = Math.max(result, 0); this._logWindow.displayRecruitResults(subject, realTarget, result); var posx = Number(DQM.Param.RecruitGaugePositions[0]); var posy = Number(DQM.Param.RecruitGaugePositions[1]); var width = Number(DQM.Param.RecruitGaugePositions[2]); this._logWindow.updateRecruitGauge(posx, posy, width, result); return result; }; BattleManager.checkRecruit = function(target, result) { var CheckMessage = DQM.Param.RecruitCheckMessage; var posx = Number(DQM.Param.RecruitGaugePositions[0]); var posy = Number(DQM.Param.RecruitGaugePositions[1]); var width = Number(DQM.Param.RecruitGaugePositions[2]); var chance = this._recruitLvl + result; chance = chance.clamp(0, 100); this._logWindow.push('addText', CheckMessage.format(target.name())); this._logWindow.push('drawRecruitGauge', posx, posy, width); this._logWindow.push('ReflexionWait'); this._logWindow.push('popBaseLine'); var randomInt = Math.randomInt(100); if (randomInt < chance) { var WinMessage = DQM.Param.RecruitWinMessage; this._logWindow.push('addText', WinMessage.format(target.name())); this._logWindow.push('wait'); this._logWindow.push('resetRecruitLvl'); this._logWindow.push('processRecruit', target); } else { var LoseMessage = DQM.Param.RecruitLoseMessage; this._logWindow.push('addText', LoseMessage.format(target.name())); this._logWindow.push('wait'); this._logWindow.push('resetRecruitLvl'); while (this._subject.isActor()) { this._subject = this.getNextSubject(); } var randomIntLoseRecruit = Math.randomInt(100); if (randomIntLoseRecruit < DQM.Param.MalusRecruitLoseChance) { var MalusMessage = DQM.Param.MalusRecruitLoseMessage; $gameTroop.aliveMembers().forEach(function(enemy) { enemy.TensionUp(1); }, this); this._logWindow.push('addText', MalusMessage.format(target.name())); this._logWindow.push('showNormalAnimation', $gameTroop.aliveMembers(), $dataSkills[DQM.Param.TensionId].animationId); this._logWindow.push('cancelRecruit'); } else { var NoMalusMessage = DQM.Param.NoMalusRecruitLoseMessage; this._logWindow.push('addText', NoMalusMessage.format(target.name())); } } this._logWindow.push('wait'); }; BattleManager.processRecruit = function(target) { $gameParty.removeBattleStates(); $gameParty.performVictory(); this.playVictoryMe(); this.replayBgmAndBgs(); var index = $gameParty.SetEnemyAsActor(target); var teamIndex = $gameActors.actor(index)._teamIndex; $gameSystem.countRecruitSuccess($gameActors.actor(index)._classId); if (teamIndex === $gameParty.stockageId()) { $gameMessage.add(DQM.Param.RecruitWinInsertSystemMessage.format(target.name(), DQM.Param.NameStockageSystem)); } else if (teamIndex === 0) { $gameMessage.add(DQM.Param.RecruitWinInsertTeamMessage.format(target.name(), DQM.Param.NameMainTeam)); } else { $gameMessage.add(DQM.Param.RecruitWinInsertTeamMessage.format(target.name(), DQM.Param.NameSupplementaryTeam || ' ' || teamIndex)); } this.endBattle(0); this._recruitSuccess = true; this._recruitIndex = index; }; DQM.Core.BattleManager_updateBattleEnd = BattleManager.updateBattleEnd; BattleManager.updateBattleEnd = function() { if (this._recruitSuccess) { SceneManager._nextScene = new Scene_Name(); SceneManager._nextScene.initialize(); SceneManager._nextScene.prepare(this._recruitIndex, DQM.Param.LengthNameActor); SceneManager._scene.stop(); this._phase = null; } else { DQM.Core.BattleManager_updateBattleEnd.call(this); } }; DQM.Core.BattleManager_processTurn = BattleManager.processTurn; BattleManager.processTurn = function() { var subject = this._subject; var action = subject.currentAction(); if (!action && (subject._actions.length > 0)) { subject.removeCurrentAction(); this._subject = this.getNextSubject(); } else { DQM.Core.BattleManager_processTurn.call(this); } }; DQM.Core.BattleManager_getNextSubject = BattleManager.getNextSubject; BattleManager.getNextSubject = function() { var oldSubject = this._subject; if (oldSubject) { var isTurnProcess = (oldSubject._actions.filter(function(action) { return !action; }).length === 1); if (isTurnProcess && ($gameTroop.turnCount() > 0) && oldSubject.isAlive() && (!this._preemptive || !oldSubject.isEnemy()) && (!this._surprise || !oldSubject.isActor())) { this.processAutomatedAction(oldSubject, 6, false, true); } } var newSubject = DQM.Core.BattleManager_getNextSubject.call(this); if (newSubject) { var isTurnProcess = (newSubject._actions.filter(function(action) { return !action; }).length === 1); if (isTurnProcess && ($gameTroop.turnCount() > 0) && newSubject.isAlive() && (!this._preemptive || !newSubject.isEnemy()) && (!this._surprise || !newSubject.isActor())) { this.processAutomatedAction(newSubject, 3, true, true); this.processAutomatedAction(newSubject, 6, true, false); } } return newSubject; }; DQM.Core.BattleManager_endTurn = BattleManager.endTurn; BattleManager.endTurn = function() { var isEndTurn = this.allBattleMembers().every(function(battler) { return (battler._actions.length === 0 || !battler.isAlive()); }); if (!isEndTurn) { this._phase = 'turn'; this.clearActor(); this.makeActionOrders(); $gameParty.requestMotionRefresh(); this._logWindow.startTurn(); var priorityA; var priorityB; this._actionBattlers.sort(function(a, b) { priorityA = a.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; priorityB = b.AttributeChangePrioritize().reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; if (priorityB !== priorityA) { return priorityB - priorityA; } else { return b.speed() - a.speed(); } }); } else { if ($gameTroop.turnCount() > 0) { this.allBattleMembers().forEach(function(subject) { if (subject.isAlive() && (!this._preemptive || !subject.isEnemy()) && (!this._surprise || !subject.isActor())) { this.processAutomatedAction(subject, 4, false, true); } }, this); } else { this.allBattleMembers().forEach(function(subject) { if (subject.isAlive()) { this.processStateStart(subject); } }, this); var preemptive = this._preemptive; var surprise = this._surprise; } DQM.Core.BattleManager_endTurn.call(this); if ($gameTroop.turnCount() <= 0) { this._preemptive = preemptive; this._surprise = surprise; } } }; BattleManager.processStateStart = function(subject) { var allStates = subject.AttributeGainStateAtBattleStart(); var stateId; var numTurns; for (var k = 0; k < allStates.length; k++) { stateId = allStates[k].id; numTurns = allStates[k].value2; if (numTurns === 0) { numTurns = -1; } subject.addState(stateId); subject._stateTurns[stateId] = numTurns; } }; DQM.Core.BattleManager_endAction = BattleManager.endAction; BattleManager.endAction = function() { DQM.Core.BattleManager_endAction.call(this); var newSkillActivated = false; var subject = this._subject; this._action.itemTargetCandidates().forEach(function(target) { if (target.isAlive() && (!this._preemptive || !subject.isEnemy()) && (!this._surprise || !subject.isActor())) { this.canExecuteAction(subject, target, newSkillActivated); } }, this); }; BattleManager.canExecuteAction = function(subject, target, newSkillAdded) { var actions = target.AttributeActivateSkill(7); var newValue = target.hp; var oldValue = target.hp + target._result.hpDamage; var floorValue; var newSkill = true; for (var k = 0; k < actions.length; k++) { floorValue = Math.floor(target.mhp * actions[k].value2 / 100); if ((newValue < oldValue) && (floorValue === floorValue.clamp(newValue, oldValue))) { if (newSkill) { target._actions = [null].concat(target._actions); if (!newSkillAdded) { this._actionsBattlers = [subject].concat(this._actionsBattlers); newSkillAdded = true; } this._actionsBattlers = [target].concat(this._actionsBattlers); newSkill = false; } this.addAction(target, actions[k].id, actions[k].value1, false); } } }; BattleManager.processAutomatedAction = function(subject, occasion, skillEnabled, otherEnabled) { if (subject && subject.canMove()) { var actions = subject.AttributeActivateSkill(occasion); var chance; var randomInt; var numTimes; var numTurns; var idAction; var targets; for (var k = 0; k < actions.length; k++) { idAction = actions[k].id; numTimes = actions[k].value1; numTurns = actions[k].value2; targets = actions[k].target; chance = (actions[k].chance * 100).clamp(0,100); randomInt = Math.randomInt(100); if (randomInt < chance) { switch (actions[k].type) { case 1: if (skillEnabled) { this.addAction(subject, idAction, numTimes, (occasion > 3), (occasion === 6)); } break; case 2: if (otherEnabled) { this.affectBuff(subject, idAction, numTimes, numTurns, targets); } break; case 3: if (otherEnabled) { this.affectBuff(subject, idAction, numTimes, numTurns, targets); } break; case 4: if (otherEnabled) { this.regenerate(subject, idAction, numTimes, targets); } break; default: break; } } else { switch (actions[k].type) { case 1: break; case 2: break; case 3: if (otherEnabled) { this.affectBuff(subject, idAction, -numTimes, numTurns, targets); } break; case 4: break; default: break; } } } } }; BattleManager.affectBuff = function(subject, paramId, bonusValue, TurnNumber, targets) { switch (targets) { case 0: subject.affectBuff(paramId, bonusValue, TurnNumber); break; case 1: subject.friendsUnit().members().forEach(function(ally) { if (ally.isAlive()) { ally.affectBuff(paramId, bonusValue, TurnNumber); } }, this); break; case 2: subject.opponentsUnit().members().forEach(function(enemy) { if (enemy.isAlive()) { enemy.affectBuff(paramId, bonusValue, TurnNumber); } }, this); break; default: break; } }; BattleManager.regenerate = function(subject, paramId, bonusValue, target) { switch (target) { case 0: subject.regenerate(paramId, bonusValue); break; case 1: subject.friendsUnit().members().forEach(function(ally) { if (ally.isAlive()) { ally.regenerate(paramId, bonusValue); } }, this); break; default: break; } }; BattleManager.addAction = function(subject, idSkill, numTimes, isAtEnd, isAfterAction) { var action; var indexWhereAdd; for (var k = 0; k < numTimes; k++) { action = new Game_Action(subject, true, true); action.setSkill(idSkill); if (action.isForOne()) { if (action.isForFriend()) { action.setTarget(subject.index()); } else { action.setTarget(-1); } } if (isAtEnd) { if (!isAfterAction) { subject._actions.push(action); } else { indexWhereAdd = subject._actions.lastIndexOf(null); subject._actions = subject._actions.slice(0,indexWhereAdd).concat([action]).concat(subject._actions.slice(indexWhereAdd)); } } else { subject._actions = [action].concat(subject._actions); } } }; BattleManager.gainExp = function() { var exp = this._rewards.exp; $gameParty.allMembers().forEach(function(actor) { if (actor._teamIndex === 0) { actor.gainExp(exp * DQM.Param.rateExpBattleTeam / 100); } else if (actor._teamIndex === $gameParty.stockageId()) { actor.gainExp(exp * DQM.Param.rateExpStockage / 100); } else { actor.gainExp(exp * DQM.Param.rateExpSupTeam / 100); } }); }; //============================================================================= // Scene_Title //============================================================================= //============================================================================= // Scene_Menu //============================================================================= DQM.Core.Scene_Menu_initialize = Scene_Menu.prototype.initialize; Scene_Menu.prototype.initialize = function() { if ($gameParty._changeListMembersAllowed) { $gameParty._allMembers = false; } DQM.Core.Scene_Menu_initialize.call(this); }; Scene_Menu.prototype.setAllMembers = function() { $gameParty._allMembers = true; $gameParty._changeListMembersAllowed = false; }; DQM.Core.Scene_Menu_start = Scene_Menu.prototype.start; Scene_Menu.prototype.start = function() { DQM.Core.Scene_Menu_start.call(this); this._statusWindow.hide(); this._statusWindow.close(); this._playerStatusWindow.open(); this._playerStatusWindow.show(); }; Scene_Menu.prototype.createPlayerStatusWindow = function() { this._playerStatusWindow = new Window_PlayerStatus(this._commandWindow.width, 0); this.addWindow(this._playerStatusWindow); }; DQM.Core.Scene_Menu_create = Scene_Menu.prototype.create; Scene_Menu.prototype.create = function() { DQM.Core.Scene_Menu_create.call(this); this.createPlayerStatusWindow(); }; DQM.Core.Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow; Scene_Menu.prototype.createCommandWindow = function() { DQM.Core.Scene_Menu_createCommandWindow.call(this); this._commandWindow.setHandler('SkillsetBook', this.openBook.bind(this)); this._commandWindow.setHandler('JobPoints', this.commandJobPersonal.bind(this)); this._commandWindow.setHandler('SynthesisActor', this.commandSynthesisActor.bind(this)); this._commandWindow.setHandler('Strategy', this.commandPersonal.bind(this)); this._commandWindow.setHandler('Rename', this.commandPersonal.bind(this)); this.addWindow(this._commandWindow); }; Scene_Menu.prototype.commandJobPersonal = function() { this.createStatusJobWindow(); this._statusWindow.setFormationMode(false); this._statusWindow.selectLast(); this._statusWindow.activate(); this._statusWindow.setHandler('ok', this.onPersonalOk.bind(this)); this._statusWindow.setHandler('cancel', this.onPersonalCancel.bind(this)); this._playerStatusWindow.hide(); this._playerStatusWindow.close(); }; Scene_Menu.prototype.createStrategyWindow = function() { $gameParty.setMenuActor($gameParty.members()[this._statusWindow.index()]); this._strategyWindow = new Window_MenuStrategy(0, 0, $gameParty.menuActor()); this._strategyWindow.setHandler('ok', this.onStrategyOk.bind(this)); this._strategyWindow.setHandler('cancel', this.onStrategyCancel.bind(this)); this._strategyWindow.activate(); this._strategyWindow.refresh(); this.addWindow(this._strategyWindow); }; Scene_Menu.prototype.onStrategyOk = function() { var newIndex = this._strategyWindow.index(); var actor = this._strategyWindow._actor; actor.setStrategy(newIndex); this.onStrategyCancel(); }; Scene_Menu.prototype.onStrategyCancel = function() { this._strategyWindow.deactivate(); this._strategyWindow.hide(); this._strategyWindow.close(); this.commandPersonal(); }; Scene_Menu.prototype.openBook = function() { SceneManager.push(Scene_BookList); }; Scene_Menu.prototype.commandSynthesisActor = function() { SceneManager.push(Scene_SynthesisActor); }; Scene_Menu.prototype.createStatusJobWindow = function() { this._statusWindow = new Window_MenuJobStatus(this._commandWindow.width, 0); this.addWindow(this._statusWindow); }; Scene_Menu.prototype.commandFormation = function() { SceneManager.push(Scene_Formation); }; Scene_Menu.prototype.commandRename = function() { SceneManager.push(Scene_Name); SceneManager._nextScene.prepare($gameParty._menuActorId, DQM.Param.LengthNameActor); }; DQM.Core.Scene_Menu_commandPersonal = Scene_Menu.prototype.commandPersonal; Scene_Menu.prototype.commandPersonal = function() { DQM.Core.Scene_Menu_commandPersonal.call(this); this._playerStatusWindow.hide(); this._playerStatusWindow.close(); this._statusWindow.open(); this._statusWindow.show(); this._statusWindow.activate(); }; DQM.Core.Scene_Menu_onPersonalOk = Scene_Menu.prototype.onPersonalOk; Scene_Menu.prototype.onPersonalOk = function() { switch (this._commandWindow.currentSymbol()) { case 'Rename': this.commandRename(); break; case 'Strategy': this.createStrategyWindow(); this._statusWindow.deactivate(); break; case 'JobPoints': SceneManager.push(Scene_SkillListActor); break; default: DQM.Core.Scene_Menu_onPersonalOk.call(this); break; } }; DQM.Core.Scene_Menu_onPersonalCancel = Scene_Menu.prototype.onPersonalCancel; Scene_Menu.prototype.onPersonalCancel = function() { DQM.Core.Scene_Menu_onPersonalCancel.call(this); this._statusWindow.hide(); this._statusWindow.close(); this.createStatusWindow(); this._statusWindow.hide(); this._statusWindow.close(); this._playerStatusWindow.open(); this._playerStatusWindow.show(); }; DQM.Core.Scene_Menu_popScene = Scene_Menu.prototype.popScene; Scene_Menu.prototype.popScene = function() { DQM.Core.Scene_Menu_popScene.call(this); $gameParty._allMembers = true; $gameParty._changeListMembersAllowed = true; }; //============================================================================= // Scene_Name //============================================================================= DQM.Core.Scene_Name_create = Scene_Name.prototype.create; Scene_Name.prototype.create = function() { if (this._actorId === 0) { Scene_MenuBase.prototype.create.call(this); this._actor = this._actorId; this.createEditWindow(); this.createInputWindow(); } else { DQM.Core.Scene_Name_create.call(this); } }; DQM.Core.Scene_Name_onInputOk = Scene_Name.prototype.onInputOk; Scene_Name.prototype.onInputOk = function() { if (this._actorId === 0) { $gameParty._namePlayer = this._editWindow.name(); this.popScene(); } else { DQM.Core.Scene_Name_onInputOk.call(this); } }; //============================================================================= // Scene_Battle //============================================================================= DQM.Core.Scene_Battle_createPartyCommandWindow = Scene_Battle.prototype.createPartyCommandWindow; Scene_Battle.prototype.createPartyCommandWindow = function() { DQM.Core.Scene_Battle_createPartyCommandWindow.apply(this, arguments); this._partyCommandWindow.setHandler('autofight', this.commandAutoFight.bind(this)); this._partyCommandWindow.setHandler('recruit', this.commandRecruit.bind(this)); this._partyCommandWindow.setHandler('Strategy', this.commandPartyStrategy.bind(this)); }; DQM.Core.Scene_Battle_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow; Scene_Battle.prototype.createActorCommandWindow = function() { DQM.Core.Scene_Battle_createActorCommandWindow.call(this,arguments); this._actorCommandWindow.setHandler('autoattack', this.commandAutoAttack.bind(this)); this._actorCommandWindow.setHandler('tension', this.commandTension.bind(this)); this._actorCommandWindow.setHandler('Strategy', this.commandActorStrategy.bind(this)); }; Scene_Battle.prototype.commandPartyStrategy = function() { this._partyCommandWindow.deactivate(); this.selectActorSelection(); }; Scene_Battle.prototype.commandActorStrategy = function() { this._actorCommandWindow.deactivate(); this.createStrategyWindow(this._actorCommandWindow._actor); }; DQM.Core.Scene_Battle_createAllWindows = Scene_Battle.prototype.createAllWindows; Scene_Battle.prototype.createAllWindows = function() { DQM.Core.Scene_Battle_createAllWindows.call(this); this.createStrategyWindow(); this._strategyWindow.deactivate(); this._strategyWindow.hide(); this._strategyWindow.close(); }; Scene_Battle.prototype.createStrategyWindow = function(actor) { this._strategyWindow = new Window_MenuStrategy(0, 0, actor); this._strategyWindow.setHandler('ok', this.onStrategyOk.bind(this)); this._strategyWindow.setHandler('cancel', this.onStrategyCancel.bind(this)); if (actor) { this._strategyWindow.activate(); this._strategyWindow.refresh(); } this.addWindow(this._strategyWindow); }; Scene_Battle.prototype.onStrategyOk = function() { var newIndex = this._strategyWindow.index(); var actor = this._strategyWindow._actor; actor.setStrategy(newIndex); this.onStrategyCancel(); }; Scene_Battle.prototype.onStrategyCancel = function() { this._strategyWindow.deactivate(); this._strategyWindow.hide(); this._strategyWindow.close(); if (this._partyCommandWindow.currentSymbol() === 'Strategy') { this._actorWindow.show(); this._actorWindow.activate(); } else { this.startActorCommandSelection(); } }; DQM.Core.Scene_Battle_isAnyInputWindowActive = Scene_Battle.prototype.isAnyInputWindowActive; Scene_Battle.prototype.isAnyInputWindowActive = function() { return this._strategyWindow.active || DQM.Core.Scene_Battle_isAnyInputWindowActive.call(this); }; DQM.Core.Scene_Battle_onActorOk = Scene_Battle.prototype.onActorOk; Scene_Battle.prototype.onActorOk = function() { switch (this._partyCommandWindow.currentSymbol()) { case 'Strategy': this._actorWindow.deactivate(); this.createStrategyWindow(this._actorWindow.actor()); break; default: DQM.Core.Scene_Battle_onActorOk.call(this); break; } }; DQM.Core.Scene_Battle_onActorCancel = Scene_Battle.prototype.onActorCancel; Scene_Battle.prototype.onActorCancel = function() { switch (this._partyCommandWindow.currentSymbol()) { case 'Strategy': this._actorWindow.hide(); this._actorWindow.deactivate(); this._actorWindow.deselect(); this._partyCommandWindow.show(); this._partyCommandWindow.activate(); break; default: DQM.Core.Scene_Battle_onActorCancel.call(this); break; } }; DQM.Core.Scene_Battle_onEnemyOk = Scene_Battle.prototype.onEnemyOk; Scene_Battle.prototype.onEnemyOk = function() { var action = BattleManager.inputtingAction(); if (action.isSkill() && action._item._itemId === BattleManager.actor().attackRecruitId()) { this.commandFinalRecruit(); } else { DQM.Core.Scene_Battle_onEnemyOk.call(this); } }; DQM.Core.Scene_Battle_onEnemyCancel = Scene_Battle.prototype.onEnemyCancel; Scene_Battle.prototype.onEnemyCancel = function() { switch (this._partyCommandWindow.currentSymbol()) { case 'recruit': this._enemyWindow.hide(); BattleManager.selectPreviousCommand(); this._partyCommandWindow.activate(); break; default: DQM.Core.Scene_Battle_onEnemyCancel.call(this); break; } BattleManager._logWindow.displayScreenActor(); }; Scene_Battle.prototype.commandAutoFight = function() { this.selectNextCommand(); do { this.commandAutoAttack.apply(this, arguments); } while(BattleManager.isInputting()); this._actorCommandWindow.deactivate(); }; Scene_Battle.prototype.commandTension = function() { BattleManager.inputtingAction().setTension(); this.selectNextCommand(); }; Scene_Battle.prototype.commandRecruit = function() { BattleManager.selectNextCommand(); BattleManager.inputtingAction().setRecruit(); this.onSelectAction(); this._actorWindow.deactivate(); }; Scene_Battle.prototype.commandFinalRecruit = function() { var action = BattleManager.inputtingAction(); var enemyId = this._enemyWindow.enemyIndex(); action.setTarget(enemyId); $gameParty.battleMembers().forEach(function(actor) { if (actor.canMove()) { actor._actions = actor._actions.slice(0,1); } }); this._enemyWindow.hide(); this._skillWindow.hide(); this._itemWindow.hide(); this.selectNextCommand(); while (BattleManager.isInputting()) { BattleManager.inputtingAction().setRecruit(); var action = BattleManager.inputtingAction(); action.setTarget(enemyId); this.selectNextCommand(); } this._actorCommandWindow.deactivate(); }; Scene_Battle.prototype.commandAutoAttack = function() { var actor = BattleManager.actor(); actor.clearActions(); if (actor.canMove()) { var actionTimes = actor.makeActionTimes(true); actor._actions = []; for (var i = 0; i < actionTimes; i++) { actor._actions.push(new Game_Action(actor)); } } actor.makeAutoBattleActions(); this.selectNextCommand(); }; DQM.Core.Scene_Battle_commandAttack = Scene_Battle.prototype.commandAttack; Scene_Battle.prototype.commandAttack = function() { var action = BattleManager.inputtingAction(); action.setAttack(); if (!action.needsSelection()) { this.selectNextCommand(); } else { DQM.Core.Scene_Battle_commandAttack.call(this); } }; DQM.Core.Scene_Battle_selectNextCommand = Scene_Battle.prototype.selectNextCommand; Scene_Battle.prototype.selectNextCommand = function() { DQM.Core.Scene_Battle_selectNextCommand.call(this); if (BattleManager._actorIndex === -1) { BattleManager._logWindow.displayScreenEnemy(); } else { BattleManager._logWindow.displayScreenActor(); } }; DQM.Core.Scene_Battle_selectActorSelection = Scene_Battle.prototype.selectActorSelection; Scene_Battle.prototype.selectActorSelection = function() { DQM.Core.Scene_Battle_selectActorSelection.call(this); BattleManager._logWindow.displayScreenActor(); }; DQM.Core.Scene_Battle_selectEnemySelection = Scene_Battle.prototype.selectEnemySelection; Scene_Battle.prototype.selectEnemySelection = function() { DQM.Core.Scene_Battle_selectEnemySelection.call(this); BattleManager._logWindow.displayScreenEnemy(); }; DQM.Core.Scene_Battle_onActorCancel = Scene_Battle.prototype.onActorCancel; Scene_Battle.prototype.onActorCancel = function() { DQM.Core.Scene_Battle_onActorCancel.call(this); BattleManager._logWindow.displayScreenActor(); }; //============================================================================= // Scene_Gameover //============================================================================= //============================================================================= // Scene_ItemBase //============================================================================= DQM.Core.Scene_ItemBase_onActorOk = Scene_ItemBase.prototype.onActorOk; Scene_ItemBase.prototype.onActorOk = function() { var maxSlot = this.user().MaxSkillSetSlots(); var usedSlot = this.user().SkillSetSlotUsed(); var listSkillset = this.item().effects.filter(function(trait) { return trait.code === Game_Action.EFFECT_ADD_SKILLSET; }); var skillset; if (listSkillset.length > 0) { skillset = {"id":listSkillset[0].dataId, "jobPoints":0}; } if ((maxSlot < (usedSlot + listSkillset.length)) && skillset) { this.createSkillsetWindow(this.user(), skillset); this._actorWindow.deactivate(); this._actorWindow.hide(); } else { DQM.Core.Scene_ItemBase_onActorOk.call(this); } }; Scene_ItemBase.prototype.createSkillsetWindow = function(actor, newSkillset) { var ww = Graphics.boxWidth; var wh = Graphics.boxHeight; this._skillsetWindow = new Window_SkillsetSelect(0, 0, ww, wh); this._skillsetWindow.setHandler('ok', this.processOkSkillset.bind(this)); this._skillsetWindow.setHandler('cancel', this.nothingToDo.bind(this)); this._skillsetWindow.setHandler('add', this.addSkillset.bind(this)); this._skillsetWindow.setHandler('remove', this.removeSkillset.bind(this)); this._skillsetWindow.setActor(actor); this._skillsetWindow.setNewSkillset(newSkillset); this._skillsetWindow._isForSynthesis = false; this._skillsetWindow.activate(); this._skillsetWindow.refresh(); this.addWindow(this._skillsetWindow); }; Scene_ItemBase.prototype.nothingToDo = function() { this._skillsetWindow.deactivate(); this._skillsetWindow.hide(); this._skillsetWindow.close(); this.onActorCancel(); }; Scene_ItemBase.prototype.removeSkillset = function() { this._skillsetWindow.removeFromAdded(this._skillsetWindow.index()); this._skillsetWindow.addToAdded(this._skillsetWindow._numAdded); this._skillsetWindow.activate(); }; Scene_ItemBase.prototype.addSkillset = function() { this._skillsetWindow.activate(); }; Scene_ItemBase.prototype.processOkSkillset = function() { var actor = this._skillsetWindow._actor; var skillsets = this._skillsetWindow.listToAdd()[0]; if (skillsets !== this._skillsetWindow._newSkillset) { var slotId = actor._skillsets.indexOf(skillsets); actor.RemoveSkillSet(slotId); this._skillsetWindow.deactivate(); this._skillsetWindow.hide(); this._skillsetWindow.close(); this.onActorOk(); this.activateItemWindow(); } else { this.nothingToDo(); } }; //============================================================================= // Scene_Formation //============================================================================= function Scene_Formation() { this.initialize.apply(this, arguments); } Scene_Formation.prototype = Object.create(Scene_MenuBase.prototype); Scene_Formation.prototype.constructor = Scene_Formation; Scene_Formation.prototype.initialize = function() { Scene_MenuBase.prototype.initialize.call(this); }; Scene_Formation.prototype.create = function() { Scene_MenuBase.prototype.create.call(this); this.createCommandWindow(); }; Scene_Formation.prototype.start = function() { Scene_MenuBase.prototype.start.call(this); }; Scene_Formation.prototype.createCommandWindow = function() { this._formationWindow = new Window_TeamFormation(0, 0); this._formationWindow.setHandler('ok', this.commandOk.bind(this)); this._formationWindow.setHandler('cancel', this.commandCancel.bind(this)); this._formationWindow.activate(); this.addWindow(this._formationWindow); }; Scene_Formation.prototype.commandOk = function() { if (this._formationWindow.pendingIndex() === -1) { this._formationWindow.setPendingIndex(this._formationWindow.index()); } else { var newTeamIndex = Math.min(Math.floor(this._formationWindow.index() / $gameParty.maxBattleMembers()), $gameParty.stockageId()); var newIndex = this._formationWindow.index() - (newTeamIndex * $gameParty.maxBattleMembers()); var oldTeamIndex = Math.min(Math.floor(this._formationWindow.pendingIndex() / $gameParty.maxBattleMembers()), $gameParty.stockageId()); var oldIndex = this._formationWindow.pendingIndex() - (oldTeamIndex * $gameParty.maxBattleMembers()); $gameParty.swapOrder(oldTeamIndex, oldIndex, newTeamIndex, newIndex); this._formationWindow.setPendingIndex(-1); this._formationWindow.refresh(); } this._formationWindow.activate(); }; Scene_Formation.prototype.commandCancel = function() { if (this._formationWindow.pendingIndex() !== -1) { this._formationWindow.setPendingIndex(-1); this._formationWindow.activate(); } else { SceneManager.pop(); } }; Scene_Formation.prototype.onProcessCancel = function() { if (this._formationWindow.pendingIndex() !== -1) { this._formationWindow.setPendingIndex(-1); this._formationWindow.activate(); } else { SceneManager.pop(); } }; //============================================================================= // Scene_BookList //============================================================================= function Scene_BookList() { this.initialize.apply(this, arguments); } Scene_BookList.prototype = Object.create(Scene_MenuBase.prototype); Scene_BookList.prototype.constructor = Scene_BookList; Scene_BookList.prototype.initialize = function() { Scene_MenuBase.prototype.initialize.call(this); }; Scene_BookList.prototype.create = function() { Scene_MenuBase.prototype.create.call(this); this.createCommandWindow(); }; Scene_BookList.prototype.start = function() { Scene_MenuBase.prototype.start.call(this); }; Scene_BookList.prototype.createCommandWindow = function() { this._commandWindow = new Window_BookList(0, 0); this._commandWindow.setHandler('SkillsetList', this.commandSkillSet.bind(this)); this._commandWindow.setHandler('MonsterList', this.commandMonster.bind(this)); this._commandWindow.setHandler('AttributeList', this.commandAttribute.bind(this)); this._commandWindow.setHandler('cancel', this.onProcessCancel.bind(this)); this.addWindow(this._commandWindow); }; Scene_BookList.prototype.commandSkillSet = function() { SceneManager.push(Scene_SkillsetBook); }; Scene_BookList.prototype.commandMonster = function() { SceneManager.push(Scene_MonsterBook); }; Scene_BookList.prototype.commandAttribute = function() { SceneManager.push(Scene_AttributeBook); }; Scene_BookList.prototype.onProcessCancel = function() { SceneManager.pop(); }; //============================================================================= // Scene_SkillListActor //============================================================================= function Scene_SkillListActor() { this.initialize.apply(this, arguments); } Scene_SkillListActor.prototype = Object.create(Scene_ItemBase.prototype); Scene_SkillListActor.prototype.constructor = Scene_SkillListActor; Scene_SkillListActor.prototype.initialize = function() { Scene_ItemBase.prototype.initialize.call(this); }; Scene_SkillListActor.prototype.create = function() { Scene_ItemBase.prototype.create.call(this); this.createLogWindow(); this.createSkillsetListWindow(); this.createStatusWindow(); this.createActorWindow(); this.createItemWindow(); this.refreshActor(); }; Scene_SkillListActor.prototype.createLogWindow = function() { this._helpWindow = new Window_SkillListLog(0, 0); this.addWindow(this._helpWindow); }; Scene_SkillListActor.prototype.createSkillsetListWindow = function() { var wy = this._helpWindow.height; this._skillTypeWindow = new Window_SkillsetList(0, wy); this._skillTypeWindow.setHelpWindow(this._helpWindow); this._skillTypeWindow.setHandler('skill', this.commandSkill.bind(this)); this._skillTypeWindow.setHandler('cancel', this.popScene.bind(this)); this._skillTypeWindow.setHandler('pagedown', this.nextActor.bind(this)); this._skillTypeWindow.setHandler('pageup', this.previousActor.bind(this)); this.addWindow(this._skillTypeWindow); }; Scene_SkillListActor.prototype.createStatusWindow = function() { var wx = this._skillTypeWindow.width; var wy = this._helpWindow.height; var ww = Graphics.boxWidth - wx; var wh = this._skillTypeWindow.height; this._statusWindow = new Window_SkillStatus(wx, wy, ww, wh); this.addWindow(this._statusWindow); }; Scene_SkillListActor.prototype.createItemWindow = function() { var wx = 0; var wy = this._statusWindow.y + this._statusWindow.height; var ww = Graphics.boxWidth; var wh = Graphics.boxHeight - wy; this._itemWindow = new Window_SkillsetStatus(wx, wy, ww, wh); this._skillTypeWindow.setSkillWindow(this._itemWindow); this.addWindow(this._itemWindow); }; Scene_SkillListActor.prototype.createJobWindow = function() { var wx = 0; var wy = 0; var ww = Graphics.boxWidth; var wh = this._helpWindow.height; this._jobInputWindow = new Window_JobPointsInput(wx, wy, ww, wh); this._jobInputWindow.setMaxInput(this.actor().MaxJobPointsUsableSlot(this._skillTypeWindow.currentExt())); this.addWindow(this._jobInputWindow); }; Scene_SkillListActor.prototype.refreshActor = function() { var actor = this.actor(); this._skillTypeWindow.setActor(actor); this._statusWindow.setActor(actor); this._itemWindow.setActor(actor); this._itemWindow.setIndex(this._skillTypeWindow.currentExt()); }; Scene_SkillListActor.prototype.user = function() { return this.actor(); }; Scene_SkillListActor.prototype.commandSkill = function() { this.createJobWindow(); this._jobInputWindow.start(); }; Scene_SkillListActor.prototype.playSeForItem = function() { SoundManager.playUseSkill(); }; Scene_SkillListActor.prototype.onActorChange = function() { this.refreshActor(); this._skillTypeWindow.activate(); }; Scene_SkillListActor.prototype.onInputJobOk = function() { var value = this._jobInputWindow._number; var index = this._skillTypeWindow.currentExt(); this.actor().AddJobPointsToSkillSet(index, value); this.actor().UseJobPoints(value); this._helpWindow.displayResult(this.actor(), index, value); this.restartAll(); }; Scene_SkillListActor.prototype.restartAll = function() { this._jobInputWindow.close(); this._skillTypeWindow.activate(); this._skillTypeWindow.refresh(); this._statusWindow.refresh(); this._itemWindow.refresh(); }; //============================================================================= // Scene_SkillListActor_Independant //============================================================================= function Scene_SkillListActor_Independant() { this.initialize.apply(this, arguments); } Scene_SkillListActor_Independant.prototype = Object.create(Scene_ItemBase.prototype); Scene_SkillListActor_Independant.prototype.constructor = Scene_SkillListActor_Independant; Scene_SkillListActor_Independant.prototype.initialize = function() { Scene_ItemBase.prototype.initialize.call(this); }; Scene_SkillListActor_Independant.prototype.create = function() { Scene_ItemBase.prototype.create.call(this); this.createStatusJobWindow(); }; Scene_SkillListActor_Independant.prototype.createStatusJobWindow = function() { this._statusJobWindow = new Window_MenuJobStatus(0, 0); this._statusJobWindow.setFormationMode(false); this._statusJobWindow.selectLast(); this._statusJobWindow.activate(); this._statusJobWindow.setHandler('ok', this.onPersonalOk.bind(this)); this._statusJobWindow.setHandler('cancel', this.popScene.bind(this)); this.addWindow(this._statusJobWindow); }; Scene_SkillListActor_Independant.prototype.onPersonalOk = function() { this._statusJobWindow.close(); this._statusJobWindow.deactivate(); $gameParty.setMenuActor($gameParty.members()[this._statusJobWindow.index()]); this.updateActor(); this.createLogWindow(); this.createSkillsetListWindow(); this.createStatusWindow(); this.createActorWindow(); this.createItemWindow(); this.refreshActor(); }; Scene_SkillListActor_Independant.prototype.popScene = function() { SceneManager.pop(); }; Scene_SkillListActor_Independant.prototype.createLogWindow = function() { this._helpWindow = new Window_SkillListLog(0, 0); this.addWindow(this._helpWindow); }; Scene_SkillListActor_Independant.prototype.createSkillsetListWindow = function() { var wy = this._helpWindow.height; this._skillTypeWindow = new Window_SkillsetList(0, wy); this._skillTypeWindow.setHelpWindow(this._helpWindow); this._skillTypeWindow.setHandler('skill', this.commandSkill.bind(this)); this._skillTypeWindow.setHandler('cancel', this.returnSelectActor.bind(this)); this._skillTypeWindow.setHandler('pagedown', this.nextActor.bind(this)); this._skillTypeWindow.setHandler('pageup', this.previousActor.bind(this)); this.addWindow(this._skillTypeWindow); }; Scene_SkillListActor_Independant.prototype.returnSelectActor = function() { this._skillTypeWindow.close(); this._helpWindow.close(); this._statusWindow.close(); this._itemWindow.close(); if (this._jobInputWindow) { this._jobInputWindow.close(); this._jobInputWindow.deactivate(); } this._skillTypeWindow.deactivate(); this.createStatusJobWindow(); }; Scene_SkillListActor_Independant.prototype.createStatusWindow = function() { var wx = this._skillTypeWindow.width; var wy = this._helpWindow.height; var ww = Graphics.boxWidth - wx; var wh = this._skillTypeWindow.height; this._statusWindow = new Window_SkillStatus(wx, wy, ww, wh); this.addWindow(this._statusWindow); }; Scene_SkillListActor_Independant.prototype.createItemWindow = function() { var wx = 0; var wy = this._statusWindow.y + this._statusWindow.height; var ww = Graphics.boxWidth; var wh = Graphics.boxHeight - wy; this._itemWindow = new Window_SkillsetStatus(wx, wy, ww, wh); this._skillTypeWindow.setSkillWindow(this._itemWindow); this.addWindow(this._itemWindow); }; Scene_SkillListActor_Independant.prototype.createJobWindow = function() { var wx = 0; var wy = 0; var ww = Graphics.boxWidth; var wh = this._helpWindow.height; this._jobInputWindow = new Window_JobPointsInput(wx, wy, ww, wh); this._jobInputWindow.setMaxInput(this.actor().MaxJobPointsUsableSlot(this._skillTypeWindow.currentExt())); this.addWindow(this._jobInputWindow); }; Scene_SkillListActor_Independant.prototype.refreshActor = function() { var actor = this.actor(); this._skillTypeWindow.setActor(actor); this._statusWindow.setActor(actor); this._itemWindow.setActor(actor); this._itemWindow.setIndex(this._skillTypeWindow.currentExt()); }; Scene_SkillListActor_Independant.prototype.user = function() { return this.actor(); }; Scene_SkillListActor_Independant.prototype.commandSkill = function() { this.createJobWindow(); this._jobInputWindow.start(); }; Scene_SkillListActor_Independant.prototype.playSeForItem = function() { SoundManager.playUseSkill(); }; Scene_SkillListActor_Independant.prototype.onActorChange = function() { this.refreshActor(); this._skillTypeWindow.activate(); }; Scene_SkillListActor_Independant.prototype.onInputJobOk = function() { var value = this._jobInputWindow._number; var index = this._skillTypeWindow.currentExt(); this.actor().AddJobPointsToSkillSet(index, value); this.actor().UseJobPoints(value); this._helpWindow.displayResult(this.actor(), index, value); this.restartAll(); }; Scene_SkillListActor_Independant.prototype.restartAll = function() { this._jobInputWindow.close(); this._skillTypeWindow.activate(); this._skillTypeWindow.refresh(); this._statusWindow.refresh(); this._itemWindow.refresh(); }; //============================================================================= // Scene_Rename_Independant //============================================================================= function Scene_Rename_Independant() { this.initialize.apply(this, arguments); } Scene_Rename_Independant.prototype = Object.create(Scene_MenuBase.prototype); Scene_Rename_Independant.prototype.constructor = Scene_Rename_Independant; Scene_Rename_Independant.prototype.initialize = function() { Scene_MenuBase.prototype.initialize.call(this); }; Scene_Rename_Independant.prototype.create = function() { Scene_MenuBase.prototype.create.call(this); this.createStatusWindow(); }; Scene_Rename_Independant.prototype.createStatusWindow = function() { this._statusJobWindow = new Window_MenuStatus(0, 0); this._statusJobWindow.setFormationMode(false); this._statusJobWindow.selectLast(); this._statusJobWindow.activate(); this._statusJobWindow.setHandler('ok', this.onPersonalOk.bind(this)); this._statusJobWindow.setHandler('cancel', this.popScene.bind(this)); this.addWindow(this._statusJobWindow); }; Scene_Rename_Independant.prototype.onPersonalOk = function() { this._statusJobWindow.close(); this._statusJobWindow.deactivate(); $gameParty.setMenuActor($gameParty.members()[this._statusJobWindow.index()]); this.updateActor(); this.createNameInputWindow(this._statusJobWindow.index()); }; Scene_Rename_Independant.prototype.popScene = function() { SceneManager.pop(); }; Scene_Rename_Independant.prototype.createNameInputWindow = function(index) { this._nameEditWindow = new Window_NameEdit($gameParty.members()[index], DQM.Param.LengthNameActor); this.addWindow(this._nameEditWindow); this._nameInputWindow = new Window_NameInput(this._nameEditWindow); this._nameInputWindow.setHandler('ok', this.openActorSelection.bind(this)); this._nameEditWindow.refresh(); this.addWindow(this._nameInputWindow); this._nameInputWindow.activate(); }; Scene_Rename_Independant.prototype.openActorSelection = function() { this._nameEditWindow._actor.setName(this._nameEditWindow.name()); this._nameEditWindow.close(); this._nameInputWindow.close(); this._nameInputWindow.deactivate(); this._statusJobWindow.open(); this._statusJobWindow.activate(); }; //============================================================================= // Scene_SynthesisActor //============================================================================= function Scene_SynthesisActor() { this.initialize.apply(this, arguments); } Scene_SynthesisActor.prototype = Object.create(Scene_ItemBase.prototype); Scene_SynthesisActor.prototype.constructor = Scene_SynthesisActor; Scene_SynthesisActor.prototype.initialize = function() { Scene_ItemBase.prototype.initialize.call(this); this._messageIsPassed = true; }; Scene_SynthesisActor.prototype.create = function() { Scene_ItemBase.prototype.create.call(this); this.createWindowSelection(); }; Scene_SynthesisActor.prototype.update = function() { Scene_ItemBase.prototype.update.call(this); if (!this._messageIsPassed) { this.passToNameInput(); } }; Scene_SynthesisActor.prototype.passToNameInput = function() { if (this._nameInputWindow && this._messageWindow) { if (this._messageWindow.isClosing()) { this._nameInputWindow.activate(); this._messageIsPassed = true; } } }; Scene_SynthesisActor.prototype.createWindowSelection = function() { var ww = Graphics.boxWidth; var wh = Graphics.boxHeight; this._synthesisWindow = new Window_SynthesisActor(0, 0, ww, wh); this._synthesisWindow.setHandler('ok', this.processOk.bind(this)); this._synthesisWindow.setHandler('cancel', this.popScene.bind(this)); this._synthesisWindow.activate(); this.addWindow(this._synthesisWindow); }; Scene_SynthesisActor.prototype.popScene = function() { SceneManager.pop(); }; Scene_SynthesisActor.prototype.canSelectNeutral = function() { var otherIndex = 1 - this._synthesisWindow.index(); otherIndex = this._synthesisWindow.getRealIndex(otherIndex); if (otherIndex === -1) { return true; } var actor = $gameParty.members()[otherIndex]; return !(actor._gender === 0); }; Scene_SynthesisActor.prototype.processOk = function() { if (this._synthesisWindow.index() !== -1) { if (this._synthesisWindow.index() < 2) { this.processSelectActor(); } else { this.processSynthesis(); } } else { this._synthesisWindow.activate(); } }; Scene_SynthesisActor.prototype.processSynthesis = function() { this.createResultWindow(); this.createSkillsetSelectWindow(); this._synthesisWindow.close(); }; Scene_SynthesisActor.prototype.createResultWindow = function() { this._resultWindow = new Window_SynthesisResult(0, 0); this._resultWindow.setClassId(this._synthesisWindow.getRealIndex(this._synthesisWindow.index())); this.setFormulaUsed(); this.addWindow(this._resultWindow); }; Scene_SynthesisActor.prototype.setFormulaUsed = function() { var classId = this._synthesisWindow.getRealIndex(this._synthesisWindow.index()); var result = $gameSynthesis._specialData.filter(function(res) { return res.idResult === classId; }); if (result.length > 0) { this._formulaUsed = result[0].formulaUsed; } else { this._formulaUsed = []; } }; Scene_SynthesisActor.prototype.createSkillsetSelectWindow = function() { var vy = this._resultWindow.height; var ww = Graphics.boxWidth; var wh = Graphics.boxHeight - this._resultWindow.height; this._skillsetWindow = new Window_SkillsetSelect(0, vy, ww, wh); this._skillsetWindow.setHandler('ok', this.processOkFinal.bind(this)); this._skillsetWindow.setHandler('cancel', this.cancelSynthesis.bind(this)); this._skillsetWindow.setHandler('add', this.addSkillset.bind(this)); this._skillsetWindow.setHandler('remove', this.removeSkillset.bind(this)); this._skillsetWindow.addListToAdd(this.getListFinal()); this._skillsetWindow._isForSynthesis = true; this._skillsetWindow.activate(); this._skillsetWindow.refresh(); this.addWindow(this._skillsetWindow); }; Scene_SynthesisActor.prototype.createMessageWindow = function(index) { $gameMessage.clear(); $gameMessage.setPositionType(1); $gameMessage.add(DQM.Param.SynthesisResultMessage.format($gameActors.actor(index).name())); $gameMessage.add(DQM.Param.SynthesisNameInputMessage.format($gameActors.actor(index).name())); this._messageWindow = new Window_Message(); this._messageWindow.activate(); this.addWindow(this._messageWindow); this._messageIsPassed = false; }; Scene_SynthesisActor.prototype.createNameInputActorWindow = function(index) { this._nameEditWindow = new Window_NameEdit($gameActors.actor(index), DQM.Param.LengthNameActor); this.addWindow(this._nameEditWindow); this._nameInputWindow = new Window_NameInput(this._nameEditWindow); this._nameInputWindow.setHandler('ok', this.setResultOfSynthesis.bind(this)); this._nameEditWindow.refresh(); this.addWindow(this._nameInputWindow); this._nameInputWindow.deactivate(); }; Scene_SynthesisActor.prototype.setResultOfSynthesis = function() { this._nameEditWindow._actor.setName(this._nameEditWindow.name()); var index = this._nameEditWindow._actor.actorId(); this._nameInputWindow.deactivate(); this._nameInputWindow.close(); this._nameEditWindow.deactivate(); this._nameEditWindow.close(); this.createStatusActorWindow(index); }; Scene_SynthesisActor.prototype.createStatusActorWindow = function(index) { this._statusWindow = new Window_Status(); this._statusWindow.setHandler('ok', this.restartSynthese.bind(this)); this._statusWindow.setHandler('cancel', this.restartSynthese.bind(this)); this._statusWindow.setActor($gameActors.actor(index)); this._statusWindow.activate(); this._statusWindow.refresh(); this.addWindow(this._statusWindow); }; Scene_SynthesisActor.prototype.restartSynthese = function() { if (SceneManager._previousScene === Scene_Menu) { var SceneClass = SceneManager._previousScene; } SceneManager.pop(); if (SceneClass === Scene_Menu) { SceneManager.push(Scene_SynthesisActor); SceneManager._previousScene = SceneClass; SceneManager._stack[SceneManager._stack.length - 1] = SceneClass; } }; Scene_SynthesisActor.prototype.getListFinal = function() { var FirstList = $gameSynthesis._skillsetList; var nextSkillset = $dataClasses[this._synthesisWindow.getRealIndex(this._synthesisWindow.index())].SkillSetDefault; if (FirstList.filter(function(skillset) { return nextSkillset === skillset.id; }).length < 1 && nextSkillset && $gameSkillset._data[nextSkillset]) { FirstList = FirstList.concat({"id":nextSkillset, "jobPoints":0}); } return FirstList; }; Scene_SynthesisActor.prototype.removeSkillset = function() { this._skillsetWindow.removeFromAdded(this._skillsetWindow.index()); this._skillsetWindow.activate(); }; Scene_SynthesisActor.prototype.addSkillset = function() { var maxSkillset = $dataClasses[this._resultWindow._classId].SizeClass + 2; if (this._skillsetWindow._numAdded + 1 <= maxSkillset) { this._skillsetWindow.addToAdded(this._skillsetWindow.index()); } this._skillsetWindow.activate(); }; Scene_SynthesisActor.prototype.cancelSynthesis = function() { this._skillsetWindow.deactivate(); this._skillsetWindow.close(); this._resultWindow.close(); this._synthesisWindow.open(); this._synthesisWindow.activate(); }; Scene_SynthesisActor.prototype.processOkFinal = function() { var classId = this._resultWindow._classId; var actorId1 = this._synthesisWindow._index1; var actorId2 = this._synthesisWindow._index2; var skillsets = this._skillsetWindow.listAdded(); var index = $gameParty.SetNewActorBySynthesis(classId, actorId1, actorId2, skillsets); if (this._formulaUsed && this._formulaUsed.length > 0) { $gameSystem.addSynthesisFormula(classId, this._formulaUsed.sort(function(a,b) { return a - b; })); } this._skillsetWindow.deactivate(); this._skillsetWindow.close(); this._resultWindow.close(); this.createWindowSynthesisLog(actorId1, actorId2, index); }; Scene_SynthesisActor.prototype.createWindowSynthesisLog = function(actorId1, actorId2, actorIdFinal) { this._logWindow = new Window_SynthesisLog(); this._logWindow.setSpriteset(new Spriteset_Synthesis($gameParty.members()[actorId1], $gameParty.members()[actorId2], $gameActors.actor(actorIdFinal))); this.addChild(this._logWindow._spriteset); this._logWindow.refresh(); this._logWindow.push('miniWait'); this._logWindow.push('setNewPositionHome'); this._logWindow.push('makeAppearActors'); for (var k = 0; k < DQM.Param.SynthesisWaitStart; k++) { this._logWindow.push('miniWait'); } this._logWindow.push('showSynthesisAnimation'); for (var k = 0; k < DQM.Param.SynthesisWaitSpeed; k++) { this._logWindow.push('processSynthesis'); } for (var k = 0; k < DQM.Param.SynthesisWaitEnd; k++) { this._logWindow.push('miniWait'); } this._logWindow.push('stopProcessing'); this.addWindow(this._logWindow); }; Scene_SynthesisActor.prototype.stopProcessingSynthesis = function() { var newActor = this._logWindow._spriteset._actorCenter; var actorToSuppress1 = this._logWindow._spriteset._actorLeft; var actorToSuppress2 = this._logWindow._spriteset._actorRight; $gameParty.suppressActor(actorToSuppress1); $gameParty.suppressActor(actorToSuppress2); $gameParty.addActor(newActor.actorId()); if ($gameParty.battleMembers().length < 1) { $gameParty.swapOrder(newActor._teamIndex, newActor._index, 0, 0); } this.children = this.children.filter(function(child) { return child !== this._logWindow._spriteset; }, this); this._logWindow._spriteset = null; this._logWindow.close(); this._logWindow.deactivate(); this._logWindow.hide(); this.createNameInputActorWindow(newActor.actorId()); this.createMessageWindow(newActor.actorId()); }; Scene_SynthesisActor.prototype.processSelectActor = function() { if (this._synthesisWindow.index() !== -1) { var currentIndex = (this._synthesisWindow.index() - 1/2)*2; var neutralAuthorized = this.canSelectNeutral(); this._synthesisWindow.deactivate(); this._selectWindow = new Window_SynthesisSelect(240, 0); this._selectWindow.setHandler('cancel', this.cancelSelect.bind(this)); this._selectWindow.setHandler('ok', this.okSelect.bind(this)); this._selectWindow._genderValue = currentIndex; this._selectWindow._neutralAuthorized = neutralAuthorized; this._selectWindow.activate(); this._selectWindow.refresh(); this.addWindow(this._selectWindow); } else { this._synthesisWindow.activate(); } }; Scene_SynthesisActor.prototype.cancelSelect = function() { this._selectWindow.close(); this._synthesisWindow.activate(); this._synthesisWindow.refresh(); }; Scene_SynthesisActor.prototype.okSelect = function() { var newIndex = this._selectWindow.getRealIndex(); var Index = (this._selectWindow._genderValue / 2) + (1/2); this._synthesisWindow.setNewIndex(Index, newIndex); this._selectWindow.close(); this._synthesisWindow.activate(); this._synthesisWindow.refresh(); this._synthesisWindow.updateRankValueAdded(); }; //============================================================================= // Scene_SkillsetBook //============================================================================= function Scene_SkillsetBook() { this.initialize.apply(this, arguments); } Scene_SkillsetBook.prototype = Object.create(Scene_MenuBase.prototype); Scene_SkillsetBook.prototype.constructor = Scene_SkillsetBook; Scene_SkillsetBook.prototype.initialize = function() { Scene_MenuBase.prototype.initialize.call(this); }; Scene_SkillsetBook.prototype.create = function() { Scene_MenuBase.prototype.create.call(this); this._indexWindow = new Window_SkillsetBookIndex(0, 0); this._indexWindow.setHandler('cancel', this.popScene.bind(this)); this._indexWindow.setHandler('pageup', this.pageUp.bind(this)); this._indexWindow.setHandler('pagedown', this.pageDown.bind(this)); var wy = this._indexWindow.height; var ww = Graphics.boxWidth; var wh = Graphics.boxHeight - wy; this._statusWindow = new Window_SkillsetBookStatus(0, wy, ww, wh); this.addWindow(this._indexWindow); this.addWindow(this._statusWindow); this._indexWindow.setStatusWindow(this._statusWindow); }; Scene_SkillsetBook.prototype.pageUp = function() { this._statusWindow.setPagNum(this._statusWindow._pagnum + 1); this._indexWindow.activate(); }; Scene_SkillsetBook.prototype.pageDown = function() { this._statusWindow.setPagNum(this._statusWindow._pagnum - 1); this._indexWindow.activate(); }; //============================================================================= // Scene_AttributeBook //============================================================================= function Scene_AttributeBook() { this.initialize.apply(this, arguments); } Scene_AttributeBook.prototype = Object.create(Scene_MenuBase.prototype); Scene_AttributeBook.prototype.constructor = Scene_AttributeBook; Scene_AttributeBook.prototype.initialize = function() { Scene_MenuBase.prototype.initialize.call(this); }; Scene_AttributeBook.prototype.create = function() { Scene_MenuBase.prototype.create.call(this); this._indexWindow = new Window_AttributeBookIndex(0, 0); this._indexWindow.setHandler('cancel', this.popScene.bind(this)); this._indexWindow.setHandler('pageup', this.pageUp.bind(this)); this._indexWindow.setHandler('pagedown', this.pageDown.bind(this)); var wy = this._indexWindow.height; var ww = Graphics.boxWidth; var wh = Graphics.boxHeight - wy; this._statusWindow = new Window_AttributeBookStatus(0, wy, ww, wh); this.addWindow(this._indexWindow); this.addWindow(this._statusWindow); this._indexWindow.setStatusWindow(this._statusWindow); }; Scene_AttributeBook.prototype.pageUp = function() { this._statusWindow.setPagNum(this._statusWindow._pagnum + 1); this._indexWindow.activate(); }; Scene_AttributeBook.prototype.pageDown = function() { this._statusWindow.setPagNum(this._statusWindow._pagnum - 1); this._indexWindow.activate(); }; //============================================================================= // Scene_MonsterBook //============================================================================= function Scene_MonsterBook() { this.initialize.apply(this, arguments); } Scene_MonsterBook.prototype = Object.create(Scene_MenuBase.prototype); Scene_MonsterBook.prototype.constructor = Scene_MonsterBook; Scene_MonsterBook.prototype.initialize = function() { Scene_MenuBase.prototype.initialize.call(this); }; Scene_MonsterBook.prototype.create = function() { Scene_MenuBase.prototype.create.call(this); this._indexWindow = new Window_MonsterBookIndex(0, 0); this._indexWindow.setHandler('cancel', this.popScene.bind(this)); this._indexWindow.setHandler('pageup', this.pageUp.bind(this)); this._indexWindow.setHandler('pagedown', this.pageDown.bind(this)); var wy = this._indexWindow.height; var ww = Graphics.boxWidth; var wh = Graphics.boxHeight - wy; this._statusWindow = new Window_MonsterBookStatus(0, wy, ww, wh); this.addWindow(this._indexWindow); this.addWindow(this._statusWindow); this._indexWindow.setStatusWindow(this._statusWindow); }; Scene_MonsterBook.prototype.pageUp = function() { this._statusWindow.setPagNum(this._statusWindow._pagnum + 1); this._indexWindow.activate(); }; Scene_MonsterBook.prototype.pageDown = function() { this._statusWindow.setPagNum(this._statusWindow._pagnum - 1); this._indexWindow.activate(); }; //============================================================================= // Scene_Map //============================================================================= DQM.Core.Scene_Map_onMapLoaded = Scene_Map.prototype.onMapLoaded; Scene_Map.prototype.onMapLoaded = function() { DQM.Core.Scene_Map_onMapLoaded.call(this); DataManager.processDQMNotetags7(); }; //============================================================================= // Sprite_Animation //============================================================================= //============================================================================= // Sprite_Battler //============================================================================= Sprite_Battler.prototype.setupAnimation = function() { while (this._battler.isAnimationRequested()) { var data = this._battler.shiftAnimation(); var animation = $dataAnimations[data.animationId]; var mirror = data.mirror; var delay = animation.position === 3 ? 0 : data.delay; this.startAnimation(animation, mirror, delay); for (var i = 0; i < this._animationSprites.length; i++) { var sprite = this._animationSprites[i]; sprite.visible = true; } } }; //============================================================================= // Sprite_Actor //============================================================================= function Sprite_Actor() { this.initialize.apply(this, arguments); } Sprite_Actor.prototype = Object.create(Sprite_Battler.prototype); Sprite_Actor.prototype.constructor = Sprite_Actor; Sprite_Actor.prototype.initialize = function(battler) { Sprite_Battler.prototype.initialize.call(this, battler); }; Sprite_Actor.prototype.initMembers = function() { Sprite_Battler.prototype.initMembers.call(this); this._actor = null; this._appeared = false; this._battlerName = ''; this._battlerHue = 0; this._effectType = null; this._effectDuration = 0; this._shake = 0; this.createStateIconSprite(); }; Sprite_Actor.prototype.createStateIconSprite = function() { this._stateIconSprite = new Sprite_StateIcon(); this.addChild(this._stateIconSprite); }; Sprite_Actor.prototype.setBattler = function(battler) { Sprite_Battler.prototype.setBattler.call(this, battler); var changed = (battler !== this._actor); if (changed) { this._actor = battler; if (battler) { this.setHome(battler.screenX(), battler.screenY()); } this._stateIconSprite.setup(battler); } }; Sprite_Actor.prototype.update = function() { Sprite_Battler.prototype.update.call(this); if (this._actor) { this.updateBitmap(); this.updateEffect(); this.updateStateSprite(); this.updateTargetPosition(); } }; DQM.Core.Sprite_Actor_updateVisibility = Sprite_Actor.prototype.updateVisibility; Sprite_Actor.prototype.updateVisibility = function() { if ($gameSystem.isSideView() || !this._actor || !this._actor.isAlive() || this.visible === false) { DQM.Core.Sprite_Actor_updateVisibility.call(this); } }; Sprite_Actor.prototype.stepForward = function() { this.startMove(-48, 0, 12); }; Sprite_Actor.prototype.stepBack = function() { this.startMove(0, 0, 12); }; DQM.Core.Sprite_Actor_retreat = Sprite_Actor.prototype.retreat; Sprite_Actor.prototype.retreat = function() { if (Yanfly && Yanfly._loaded_YEP_CoreEngine) { DQM.Core.Sprite_Actor_retreat.call(this); } else { this.startMove(300, 0, 30); } }; Sprite_Actor.prototype.stepBackward = function() { this.startMove(48, 0, 12); }; Sprite_Actor.prototype.updateTargetPosition = function() { if (this._actor.isSpriteVisible()) { if (this._actor.isInputting() || this._actor.isActing()) { this.stepForward(); } else if (this._actor.canMove() && BattleManager.isEscaped()) { this.retreat(); } else if (this._actor._motionType === 'damage') { this.stepBackward(); if (this._effectDuration === 0) { this._actor.clearMotion(); } } else if (!this.inHomePosition()) { this.stepBack(); } } }; Sprite_Actor.prototype.updateBitmap = function() { Sprite_Battler.prototype.updateBitmap.call(this); var name = this._actor.battlerName(); var hue = this._actor.battlerHue(); if (this._battlerName !== name || this._battlerHue !== hue) { this._battlerName = name; this._battlerHue = hue; this.loadBitmap(name, hue); this.initVisibility(); } }; Sprite_Actor.prototype.loadBitmap = function(name, hue) { if ($gameSystem.isSideView()) { this.bitmap = ImageManager.loadSvEnemy(name, hue); this.scale.x = -1; this.scale.y = 1; } else { this.bitmap = ImageManager.loadEnemy(name, hue); } }; Sprite_Actor.prototype.updateFrame = function() { Sprite_Battler.prototype.updateFrame.call(this); var frameHeight = this.bitmap.height; if (this._effectType === 'bossCollapse') { frameHeight = this._effectDuration; } this.setFrame(0, 0, this.bitmap.width, frameHeight); }; Sprite_Actor.prototype.updatePosition = function() { Sprite_Battler.prototype.updatePosition.call(this); this.x += this._shake; }; Sprite_Actor.prototype.updateStateSprite = function() { this._stateIconSprite.y = -Math.round((this.bitmap.height + 40) * 0.9); if (this._stateIconSprite.y < 20 - this.y) { this._stateIconSprite.y = 20 - this.y; } }; Sprite_Actor.prototype.initVisibility = function() { this._appeared = this._actor.isAlive(); if (!this._appeared) { this.opacity = 0; } }; Sprite_Actor.prototype.setupEffect = function() { if (this._appeared && this._actor.isEffectRequested()) { this.startEffect(this._actor.effectType()); this._actor.clearEffect(); } if (!this._appeared && this._actor.isAlive()) { this.startEffect('appear'); } else if (this._appeared && this._actor.isHidden()) { this.startEffect('disappear'); } }; Sprite_Actor.prototype.startEffect = function(effectType) { this._effectType = effectType; switch (this._effectType) { case 'appear': this.startAppear(); break; case 'disappear': this.startDisappear(); break; case 'whiten': this.startWhiten(); break; case 'blink': this.startBlink(); break; case 'collapse': this.startCollapse(); break; case 'instantCollapse': this.startInstantCollapse(); break; } this.revertToNormal(); }; Sprite_Actor.prototype.startAppear = function() { this._effectDuration = 16; this._appeared = true; }; Sprite_Actor.prototype.startDisappear = function() { this._effectDuration = 32; this._appeared = false; }; Sprite_Actor.prototype.startWhiten = function() { this._effectDuration = 16; }; Sprite_Actor.prototype.startBlink = function() { this._effectDuration = 20; }; Sprite_Actor.prototype.startCollapse = function() { this._effectDuration = 32; this._appeared = false; }; Sprite_Actor.prototype.startInstantCollapse = function() { this._effectDuration = 16; this._appeared = false; }; Sprite_Actor.prototype.updateEffect = function() { this.setupEffect(); if (this._effectDuration > 0) { this._effectDuration--; switch (this._effectType) { case 'whiten': this.updateWhiten(); break; case 'blink': this.updateBlink(); break; case 'appear': this.updateAppear(); break; case 'disappear': this.updateDisappear(); break; case 'collapse': this.updateCollapse(); break; case 'instantCollapse': this.updateInstantCollapse(); break; } if (this._effectDuration === 0) { this._effectType = null; } } }; Sprite_Actor.prototype.isEffecting = function() { return this._effectType !== null; }; Sprite_Actor.prototype.revertToNormal = function() { this._shake = 0; this.blendMode = 0; this.opacity = 255; this.setBlendColor([0, 0, 0, 0]); }; Sprite_Actor.prototype.updateWhiten = function() { var alpha = 128 - (16 - this._effectDuration) * 10; this.setBlendColor([255, 255, 255, alpha]); }; Sprite_Actor.prototype.updateBlink = function() { this.opacity = (this._effectDuration % 10 < 5) ? 255 : 0; }; Sprite_Actor.prototype.updateAppear = function() { this.opacity = (16 - this._effectDuration) * 16; }; Sprite_Actor.prototype.updateDisappear = function() { this.opacity = 256 - (32 - this._effectDuration) * 10; }; Sprite_Actor.prototype.updateCollapse = function() { this.blendMode = Graphics.BLEND_ADD; this.setBlendColor([255, 128, 128, 128]); this.opacity *= this._effectDuration / (this._effectDuration + 1); }; Sprite_Actor.prototype.updateInstantCollapse = function() { this.opacity = 0; }; Sprite_Actor.prototype.damageOffsetX = function() { return 0; }; Sprite_Actor.prototype.damageOffsetY = function() { return -8; }; //============================================================================= // Sprite_Enemy //============================================================================= DQM.Core.Sprite_Enemy_updateVisibility = Sprite_Enemy.prototype.updateVisibility; Sprite_Enemy.prototype.updateVisibility = function() { if ($gameSystem.isSideView() || !this._enemy || !this._enemy.isAlive() || this.visible === true) { DQM.Core.Sprite_Enemy_updateVisibility.call(this); } }; //============================================================================= // Sprite_Class //============================================================================= function Sprite_Class() { this.initialize.apply(this, arguments); } Sprite_Class.prototype = Object.create(Sprite_Base.prototype); Sprite_Class.prototype.constructor = Sprite_Class; Sprite_Class.prototype.initialize = function(classData) { Sprite_Base.prototype.initialize.call(this); this.initMembers(); this.setClass(classData); }; Sprite_Class.prototype.initMembers = function() { this.anchor.x = 0.5; this.anchor.y = 1; this._class = null; this._damages = []; this._maxWidth = 0; this._maxHeight = 0; this._homeX = 0; this._homeY = 0; this._offsetX = 0; this._offsetY = 0; this._targetOffsetX = NaN; this._targetOffsetY = NaN; this._movementDuration = 0; this._selectionEffectCount = 0; }; Sprite_Class.prototype.setClass = function(classData) { this._class = classData; }; Sprite_Class.prototype.setHome = function(x, y) { this._homeX = x; this._homeY = y; this.updatePosition(); }; Sprite_Class.prototype.update = function() { Sprite_Base.prototype.update.call(this); if (this._class) { this.updateMain(); } else { this.bitmap = null; } }; Sprite_Class.prototype.updateVisibility = function() { Sprite_Base.prototype.updateVisibility.call(this); if (!this._class) { this.visible = false; } }; Sprite_Class.prototype.updateMain = function() { this.updateBitmap(); this.updateFrame(); this.updateHomePosition(); this.updateMove(); this.updatePosition(); }; Sprite_Class.prototype.updateHomePosition = function() { var realWidth = this.width * (this._class._scaleX || 100) / 100; var realHeight = this.height * (this._class._scaleY || 100) / 100; var scaleMax = Math.min(this._maxHeight / realHeight, this._maxWidth / realWidth); scaleMax = Math.min(1, scaleMax); this.scale.x = scaleMax * (this._class._scaleX || 100) / 100; this.scale.y = scaleMax * (this._class._scaleY || 100) / 100; this.setHome(this._maxWidth / 2, this._maxHeight - 5); }; Sprite_Class.prototype.updateBitmap = function() { var name = this._class.battlerName; var hue = this._class.battlerHue; if (this._battlerName !== name || this._battlerHue !== hue) { this._battlerName = name; this._battlerHue = hue; if ($gameSystem.isSideView()) { this.bitmap = ImageManager.loadSvEnemy(name, hue); this.scale.x = -1; this.scale.y = 1; } else { this.bitmap = ImageManager.loadEnemy(name, hue); } } }; Sprite_Class.prototype.updateFrame = function() { var bitmap = this.bitmap; if (bitmap) { this.setFrame(0, 0, bitmap.width, bitmap.height); } }; Sprite_Class.prototype.updateMove = function() { if (this._movementDuration > 0) { var d = this._movementDuration; this._offsetX = (this._offsetX * (d - 1) + this._targetOffsetX) / d; this._offsetY = (this._offsetY * (d - 1) + this._targetOffsetY) / d; this._movementDuration--; if (this._movementDuration === 0) { this.onMoveEnd(); } } }; Sprite_Class.prototype.updatePosition = function() { this.x = this._homeX + this._offsetX; this.y = this._homeY + this._offsetY; }; Sprite_Class.prototype.damageOffsetX = function() { return 0; }; Sprite_Class.prototype.damageOffsetY = function() { return 0; }; Sprite_Class.prototype.startMove = function(x, y, duration) { if (this._targetOffsetX !== x || this._targetOffsetY !== y) { this._targetOffsetX = x; this._targetOffsetY = y; this._movementDuration = duration; if (duration === 0) { this._offsetX = x; this._offsetY = y; } } }; Sprite_Class.prototype.onMoveEnd = function() { }; Sprite_Class.prototype.isEffecting = function() { return false; }; Sprite_Class.prototype.isMoving = function() { return this._movementDuration > 0; }; Sprite_Class.prototype.inHomePosition = function() { return this._offsetX === 0 && this._offsetY === 0; }; Sprite_Class.prototype.defineNewHomePosition = function(maxWidth, maxHeight) { this._maxWidth = maxWidth; this._maxHeight = maxHeight; }; //============================================================================= // Sprite_StateIcon //============================================================================= //============================================================================= // Sprite_Button //============================================================================= //============================================================================= // Spriteset_Battle //============================================================================= Spriteset_Battle.prototype.createActors = function() { this._actorSprites = []; for (var i = 0; i < $gameParty.battleMembers().length; i++) { this._actorSprites[i] = new Sprite_Actor(); this._battleField.addChild(this._actorSprites[i]); } }; Spriteset_Battle.prototype.getWidthBattlers = function() { var WidthActor = this.getWidthActors(); var WidthEnemy = this.getWidthEnemies(); return $gameSystem.isSideView() ? WidthActor + WidthEnemy : Math.max(WidthActor, WidthEnemy); }; Spriteset_Battle.prototype.getWidthActors = function() { var dist = this.getDistanceWidth(true); return this._actorSprites.reduce(function(r, actor, index) { var scaleX = (actor._actor.currentClass()._scaleX || 100) / 100; return $gameSystem.isSideView() ? Math.max((actor.width * scaleX) - r + (dist * index), 0) + r : (index === 0 ? (actor.width * scaleX) + r : (actor.width * scaleX) + r + dist); }, 0); }; Spriteset_Battle.prototype.getWidthEnemies = function() { var dist = this.getDistanceWidth(true); return this._enemySprites.reduce(function(r, enemy, index) { var scaleX = ((enemy._enemy.currentClass()._scaleX || enemy._enemy.enemy()._scaleX) || 100) / 100; return $gameSystem.isSideView() ? Math.max((enemy.width * scaleX) - r + (dist * index), 0) + r : (index === 0 ? (enemy.width * scaleX) + r : (enemy.width * scaleX) + r + dist); }, 0); }; Spriteset_Battle.prototype.getDistanceWidth = function(withScale) { if ($gameSystem.isSideView()) { return withScale ? 32 : Math.min(32, Math.floor(Graphics.width / this._actorSprites.length)); } else { return withScale ? 32 : Math.min(32, Math.floor(Graphics.width / this._actorSprites.length)); } }; Spriteset_Battle.prototype.getHeightBattlers = function() { var WidthActor = this.getHeightActors(); var WidthEnemy = this.getHeightEnemies(); return Math.max(WidthActor, WidthEnemy); }; Spriteset_Battle.prototype.getHeightActors = function() { var dist = this.getDistanceHeight(true); return this._actorSprites.reduce(function(r, actor, index) { var scaleY = (actor._actor.currentClass()._scaleY || 100) / 100; return $gameSystem.isSideView() ? Math.max((actor.height * scaleY) - r + (dist * index), 0) + r : Math.max((actor.height * scaleY), r); }, 0); }; Spriteset_Battle.prototype.getHeightEnemies = function() { var dist = this.getDistanceHeight(true); return this._enemySprites.reduce(function(r, enemy, index) { var scaleY = ((enemy._enemy.currentClass()._scaleY || enemy._enemy.enemy()._scaleY) || 100) / 100; return $gameSystem.isSideView() ? Math.max((enemy.height * scaleY) - r + (dist * index), 0) + r : Math.max((enemy.height * scaleY), r); }, 0); }; Spriteset_Battle.prototype.getMaxHeightSideView = function() { var hActors = this._actorSprites.reduce(function(r, actor) { return Math.max(actor.height, r); }, 0); var hEnemies = this._enemySprites.reduce(function(r, enemy) { return Math.max(enemy.height, r); }, 0); return Math.max(hActors, hEnemies); }; Spriteset_Battle.prototype.getDistanceHeight = function(withScale) { if ($gameSystem.isSideView()) { return withScale ? 48 : Math.min(48, Math.floor(Graphics.height / this._actorSprites.length)); } else { return 0; } }; Spriteset_Battle.prototype.getWidthScale = function(width) { return Math.min(this.getMaxWidth() / width, 1); }; Spriteset_Battle.prototype.getHeightScale = function(height) { return Math.min(this.getMaxHeight() / height, 1); }; Spriteset_Battle.prototype.getScaleActors = function() { return $gameSystem.isSideView() ? this.getScaleBattlers() : Math.min(this.getWidthScale(this.getWidthActors()), this.getHeightScale(this.getHeightActors())); }; Spriteset_Battle.prototype.getScaleEnemies = function() { return $gameSystem.isSideView() ? this.getScaleBattlers() : Math.min(this.getWidthScale(this.getWidthEnemies()), this.getHeightScale(this.getHeightEnemies())); }; Spriteset_Battle.prototype.getScaleBattlers = function() { return Math.min(this.getWidthScale(this.getWidthBattlers()), this.getHeightScale(this.getHeightBattlers())); }; Spriteset_Battle.prototype.getMaxWidth = function() { return $gameSystem.isSideView() ? (Graphics.width - 16 - this.getDistanceWidth(true)) / 2 : (Graphics.width - 16); }; Spriteset_Battle.prototype.getMaxHeight = function() { return Graphics.height - 180; }; Spriteset_Battle.prototype.getXStartPositionAll = function() { return $gameSystem.isSideView() ? Graphics.width / 2 : 0; }; Spriteset_Battle.prototype.getYStartPositionAll = function() { return 0; }; Spriteset_Battle.prototype.getXStartPositionActors = function() { if ($gameSystem.isSideView()) { return this.getXStartPositionAll() + this.getDistanceWidth(true) + ((this.getMaxWidth() - (this.getWidthActors() * this.getScaleActors())) / 2); } else { return this.getXStartPositionAll() + ((this.getMaxWidth() - (this.getWidthActors() * this.getScaleActors())) / 2); } }; Spriteset_Battle.prototype.getXStartPositionEnemies = function() { if ($gameSystem.isSideView()) { return this.getXStartPositionAll() - this.getDistanceWidth(true) - ((this.getMaxWidth() - (this.getWidthEnemies() * this.getScaleEnemies())) / 2); } else { return this.getXStartPositionAll() + ((this.getMaxWidth() - (this.getWidthEnemies() * this.getScaleEnemies())) / 2); } }; Spriteset_Battle.prototype.getYStartPositionActors = function() { if ($gameSystem.isSideView()) { return this.getYStartPositionAll() + (this.getMaxHeight() - (Math.max(this.getHeightEnemies(), this.getHeightActors()) * this.getScaleActors())) / 2 + (this.getMaxHeightSideView() * this.getScaleActors()); } else { return this.getYStartPositionAll() + (this.getMaxHeight() - (this.getHeightActors() * this.getScaleActors())) / 4 * 3; } }; Spriteset_Battle.prototype.getYStartPositionEnemies = function() { if ($gameSystem.isSideView()) { return this.getYStartPositionAll() + (this.getMaxHeight() - (Math.max(this.getHeightEnemies(), this.getHeightActors()) * this.getScaleEnemies())) / 2 + (this.getMaxHeightSideView() * this.getScaleEnemies()); } else { return this.getYStartPositionAll() + (this.getMaxHeight() - (this.getHeightEnemies() * this.getScaleEnemies())) / 4 * 3; } }; Spriteset_Battle.prototype.setNewPositionHomeActor = function(index, x, yMax) { var scaleX = (this._actorSprites[index]._actor.currentClass()._scaleX || 100) / 100; var scaleY = (this._actorSprites[index]._actor.currentClass()._scaleY || 100) / 100; if ($gameSystem.isSideView()) { this._actorSprites[index].setHome((x + (this._actorSprites[index].width) * (this.getScaleActors() * scaleX / 2)), yMax); this._actorSprites[index].scale.x = -this.getScaleActors() * scaleX; } else { this._actorSprites[index].setHome((x + (this._actorSprites[index].width) * (this.getScaleActors() * scaleX / 2)), (yMax + (this.getHeightActors() * this.getScaleActors()))); this._actorSprites[index].scale.x = this.getScaleActors() * scaleX; } this._actorSprites[index].scale.y = this.getScaleActors() * scaleY; }; Spriteset_Battle.prototype.setNewPositionHomeEnemy = function(index, x, yMax) { var scaleX = ((this._enemySprites[index]._enemy.currentClass()._scaleX || this._enemySprites[index]._enemy.enemy()._scaleX) || 100) / 100; var scaleY = ((this._enemySprites[index]._enemy.currentClass()._scaleY || this._enemySprites[index]._enemy.enemy()._scaleY) || 100) / 100; if ($gameSystem.isSideView()) { this._enemySprites[index].setHome((x - (this._enemySprites[index].width) * (this.getScaleEnemies() * scaleX / 2)), yMax); } else { this._enemySprites[index].setHome((x + (this._enemySprites[index].width) * (this.getScaleEnemies() * scaleX / 2)), (yMax + (this.getHeightEnemies() * this.getScaleEnemies()))); } this._enemySprites[index].scale.x = this.getScaleEnemies() * scaleX; this._enemySprites[index].scale.y = this.getScaleEnemies() * scaleY; }; Spriteset_Battle.prototype.setNewPositionHome = function() { var xActor = this.getXStartPositionActors(); var yActor = this.getYStartPositionActors(); var xEnemy = this.getXStartPositionEnemies(); var yEnemy = this.getYStartPositionEnemies(); for (var k = 0; k < this._actorSprites.length; k++) { this.setNewPositionHomeActor(k, xActor, yActor); xActor = xActor + this.getDistanceWidth(false); if (!$gameSystem.isSideView()) { xActor = xActor + (this._actorSprites[k].width * this.getScaleActors() * (this._actorSprites[k]._actor.currentClass()._scaleX || 100) / 100); } else { yActor = yActor + this.getDistanceHeight(false); } } for (var k = 0; k < this._enemySprites.length; k++) { this.setNewPositionHomeEnemy(k, xEnemy, yEnemy); if (!$gameSystem.isSideView()) { xEnemy = xEnemy + this.getDistanceWidth(false); xEnemy = xEnemy + (this._enemySprites[k].width * this.getScaleEnemies() * ((this._enemySprites[k]._enemy.currentClass()._scaleX || this._enemySprites[k]._enemy.enemy()._scaleX) || 100) / 100); } else { xEnemy = xEnemy - this.getDistanceWidth(false); yEnemy = yEnemy + this.getDistanceHeight(false); } } }; DQM.Core.Spriteset_Battle_update = Spriteset_Battle.prototype.update; Spriteset_Battle.prototype.update = function() { DQM.Core.Spriteset_Battle_update.call(this); this.setNewPositionHome(); }; //============================================================================= // Spriteset_Synthesis //============================================================================= function Spriteset_Synthesis() { this.initialize.apply(this, arguments); } Spriteset_Synthesis.prototype = Object.create(Spriteset_Base.prototype); Spriteset_Synthesis.prototype.constructor = Spriteset_Synthesis; Spriteset_Synthesis.prototype.initialize = function(actor1, actor2, actorFinal) { this._actorLeft = actor1; this._actorRight = actor2; this._actorCenter = actorFinal; Spriteset_Base.prototype.initialize.call(this); this._synthesisbackLocated = false; }; Spriteset_Synthesis.prototype.createLowerLayer = function() { Spriteset_Base.prototype.createLowerLayer.call(this); this.createBackground(); this.createSynthesisField(); this.createSynthesisback(); this.createActors(); }; Spriteset_Synthesis.prototype.createBackground = function() { this._backgroundSprite = new Sprite(); this._backgroundSprite.bitmap = SceneManager.backgroundBitmap(); this._baseSprite.addChild(this._backgroundSprite); }; Spriteset_Synthesis.prototype.update = function() { Spriteset_Base.prototype.update.call(this); this.updateActors(); this.updateSynthesisback(); }; Spriteset_Synthesis.prototype.createSynthesisField = function() { var width = Graphics.boxWidth; var height = Graphics.boxHeight; var x = (Graphics.width - width) / 2; var y = (Graphics.height - height) / 2; this._synthesisField = new Sprite(); this._synthesisField.setFrame(x, y, width, height); this._synthesisField.x = x; this._synthesisField.y = y; this._baseSprite.addChild(this._synthesisField); }; Spriteset_Synthesis.prototype.createSynthesisback = function() { var margin = 32; var x = -this._synthesisField.x - margin; var y = -this._synthesisField.y - margin; var width = Graphics.width + margin * 2; var height = Graphics.height + margin * 2; this._back1Sprite = new TilingSprite(); this._back2Sprite = new TilingSprite(); this._back1Sprite.bitmap = this.synthesisback1Bitmap(); this._back2Sprite.bitmap = this.synthesisback2Bitmap(); this._back1Sprite.move(x, y, width, height); this._back2Sprite.move(x, y, width, height); this._synthesisField.addChild(this._back1Sprite); this._synthesisField.addChild(this._back2Sprite); }; Spriteset_Synthesis.prototype.updateSynthesisback = function() { if (!this._synthesisbackLocated) { this.locateSynthesisback(); this._synthesisbackLocated = true; } }; Spriteset_Synthesis.prototype.locateSynthesisback = function() { var width = this._synthesisField.width; var height = this._synthesisField.height; var sprite1 = this._back1Sprite; var sprite2 = this._back2Sprite; sprite1.origin.x = sprite1.x + (sprite1.bitmap.width - width); sprite2.origin.x = sprite1.y + (sprite2.bitmap.width - width); }; Spriteset_Synthesis.prototype.synthesisback1Bitmap = function() { return ImageManager.loadBattleback1(DQM.Param.SynthesisBackSprite1); }; Spriteset_Synthesis.prototype.synthesisback2Bitmap = function() { return ImageManager.loadBattleback2(DQM.Param.SynthesisBackSprite1); }; Spriteset_Synthesis.prototype.createActors = function() { this._actorSprites = []; for (var i = 0; i < 3; i++) { this._actorSprites[i] = new Sprite_Actor(); this._synthesisField.addChild(this._actorSprites[i]); } }; Spriteset_Synthesis.prototype.updateActors = function() { this._actorSprites[0].setBattler(this._actorLeft); this._actorSprites[1].setBattler(this._actorCenter); this._actorSprites[2].setBattler(this._actorRight); }; Spriteset_Synthesis.prototype.battlerSprites = function() { return this._actorSprites; }; Spriteset_Synthesis.prototype.isAnimationPlaying = function() { return this.battlerSprites().some(function(sprite) { return sprite.isAnimationPlaying(); }); }; Spriteset_Synthesis.prototype.isEffecting = function() { return this.battlerSprites().some(function(sprite) { return sprite.isEffecting(); }); }; Spriteset_Synthesis.prototype.isAnyoneMoving = function() { return this.battlerSprites().some(function(sprite) { return sprite.isMoving(); }); }; Spriteset_Synthesis.prototype.isBusy = function() { return this.isAnimationPlaying() || this.isAnyoneMoving(); }; Spriteset_Synthesis.prototype.getWidthBattlers = function() { return this.getWidthActors(); }; Spriteset_Synthesis.prototype.getWidthActors = function() { var dist = this.getDistanceWidth(true); return this._actorSprites.reduce(function(r, actor, index) { if (index === 1) { return r; } var scaleX = (actor._actor.currentClass()._scaleX || 100) / 100; return (index === 0 ? (actor.width * scaleX) + r : (actor.width * scaleX) + r + dist); }, 0); }; Spriteset_Synthesis.prototype.getDistanceWidth = function(withScale) { return withScale ? 32 : Math.min(32, Math.floor(Graphics.width / this._actorSprites.length)); }; Spriteset_Synthesis.prototype.getHeightBattlers = function() { return this.getHeightActors(); }; Spriteset_Synthesis.prototype.getHeightActors = function() { return this._actorSprites.reduce(function(r, actor, index) { var scaleY = (actor._actor.currentClass()._scaleY || 100) / 100; return Math.max((actor.height * scaleY), r); }, 0); }; Spriteset_Synthesis.prototype.getDistanceHeight = function(withScale) { return 0; }; Spriteset_Synthesis.prototype.getWidthScale = function(width) { return Math.min(this.getMaxWidth() / width, 1); }; Spriteset_Synthesis.prototype.getHeightScale = function(height) { return Math.min(this.getMaxHeight() / height, 1); }; Spriteset_Synthesis.prototype.getScaleActors = function(index) { if (index !== 1) { return Math.min(this.getWidthScale(this.getWidthActors()), this.getHeightScale(this.getHeightActors())); } else { var scaleX = (this._actorSprites[index]._actor.currentClass()._scaleX || 100) / 100; var scaleY = (this._actorSprites[index]._actor.currentClass()._scaleY || 100) / 100; return Math.min(this.getWidthScale(this._actorSprites[index].width * scaleX), this.getHeightScale(this._actorSprites[index].height * scaleY)); } }; Spriteset_Synthesis.prototype.getMaxWidth = function() { return Graphics.width - 16; }; Spriteset_Synthesis.prototype.getMaxHeight = function() { return Graphics.height - 20; }; Spriteset_Synthesis.prototype.getXStartPositionAll = function() { return 0; }; Spriteset_Synthesis.prototype.getYStartPositionAll = function() { return 0; }; Spriteset_Synthesis.prototype.getXStartPositionActors = function() { return 0; }; Spriteset_Synthesis.prototype.getYStartPositionActors = function() { return this.getYStartPositionAll() + (this.getMaxHeight() - (this.getHeightActors() * this.getScaleActors(0))) / 4 * 3; }; Spriteset_Synthesis.prototype.setNewPositionHomeActor = function(index, yMax) { var scaleX = (this._actorSprites[index]._actor.currentClass()._scaleX || 100) / 100; var scaleY = (this._actorSprites[index]._actor.currentClass()._scaleY || 100) / 100; var xStart; if (index === 0) { xStart = this.getMaxWidth() / 4; } else if (index === 1) { xStart = this.getMaxWidth() / 2; } else if (index === 2) { xStart = this.getMaxWidth() * 3 / 4; } this._actorSprites[index].setHome(xStart, (yMax + (this.getHeightActors() * this.getScaleActors()))); this._actorSprites[index].scale.x = this.getScaleActors(index) * scaleX; this._actorSprites[index].scale.y = this.getScaleActors(index) * scaleY; }; Spriteset_Synthesis.prototype.setNewPositionHome = function() { var yActor = this.getYStartPositionActors(); for (var k = 0; k < this._actorSprites.length; k++) { this.setNewPositionHomeActor(k, yActor); } }; //============================================================================= // Game_BattlerBase //============================================================================= Game_BattlerBase.ATTRIBUTE_DEALT_MORE_DAMAGE = 1; Game_BattlerBase.ATTRIBUTE_REDUCE_MP_CONSUMPTION = 2; Game_BattlerBase.ATTRIBUTE_CHANGE_PRIORITIZE = 3; Game_BattlerBase.ATTRIBUTE_ACTIVATE_SKILL_AUTOMATIC = 4; Game_BattlerBase.ATTRIBUTE_SUBSTITUTE_TARGET = 5; Game_BattlerBase.ATTRIBUTE_ADD_MORE_ACTIONS_PER_TURN = 6; Game_BattlerBase.ATTRIBUTE_REDUCE_RESISTANCE_ENEMY = 7; Game_BattlerBase.ATTRIBUTE_MODIFY_PARAM = 8; Game_BattlerBase.ATTRIBUTE_CANCEL_ATTRIBUTE_EFFECT = 9; Game_BattlerBase.ATTRIBUTE_GAIN_STATE_AT_BATTLE_START = 10; Game_BattlerBase.ATTRIBUTE_BONUS_AFTERMATH_UP = 11; Game_BattlerBase.ATTRIBUTE_RECRUIT_CHANCES_UP = 12; Game_BattlerBase.ATTRIBUTE_EQUIP_ANY_WEAPONS = 13; Game_BattlerBase.ATTRIBUTE_GAIN_SKILL_USABILITY = 14; Game_BattlerBase.ATTRIBUTE_INFLICT_STATE_WITH_ATTACK = 15; Game_BattlerBase.ATTRIBUTE_ENSURE_ESCAPE = 16; Game_BattlerBase.ATTRIBUTE_REPLACE_ATTRIBUTE = 17; Game_BattlerBase.ATTRIBUTE_MULTIPLY_HITS = 18; Game_BattlerBase.TRAIT_BLOCK_CLASSID_FOR_SYNTHESIS = 104; Game_BattlerBase.TRAIT_DEFINE_GENDER_FOR_SYNTHESIS = 105; Object.defineProperties(Game_BattlerBase.prototype, { // Physical Reflection Rate prf: { get: function() { return this.xparam(10); }, configurable: true }, }); DQM.Core.Game_BattlerBase_initMembers = Game_BattlerBase.prototype.initMembers; Game_BattlerBase.prototype.initMembers = function() { DQM.Core.Game_BattlerBase_initMembers.apply(this); this._traits = []; this._tension = 0; this._critical = false; this._attributes = []; this._screenHeight = 0; this._screenWidth = 0; this._tensionToReset = false; this._isSubject = false; this._isPhysical = false; }; Game_BattlerBase.prototype.attributes = function() { var attributeList = this._attributes.filter(function(attribute) { return !this.AttributeCancelAttribute().contains(attribute.attributeId) && !this.AttributeReplaceAttribute().contains(attribute.attributeId); }, this); return attributeList.map(function(attribute) { return $gameAttributes._data[attribute.attributeId]; }); }; Game_BattlerBase.prototype.attributeEffectsOnly = function() { var result = []; for (var k = 0; k < this.attributes().length; k++) { result = result.concat(this.attributes()[k].effect); } return result; }; Game_BattlerBase.prototype.attributeWithCode = function(code) { return this.attributeEffectsOnly().filter(function(attribute) { return attribute.code === code; }); }; Game_BattlerBase.prototype.attributeWithType = function(code, type) { return this.attributeWithCode(code).filter(function(attribute) { return (attribute.type === type || type === 0); }); }; Game_BattlerBase.prototype.attributeWithOccasion = function(code, type, occasion) { return this.attributeWithType(code, type).filter(function(attribute) { return (attribute.occasion === occasion || occasion === 0); }); }; Game_BattlerBase.prototype.attributeWithId = function(code, type, occasion, id) { return this.attributeWithOccasion(code, type, occasion).filter(function(attribute) { return (attribute.id === id); }); }; Game_BattlerBase.prototype.AttributeChangeDamageValue = function() { return this.attributeWithOccasion(Game_BattlerBase.ATTRIBUTE_DEALT_MORE_DAMAGE, 0, 0); }; Game_BattlerBase.prototype.AttributeChangeMPConsumption = function(type, id) { return this.attributeWithId(Game_BattlerBase.ATTRIBUTE_REDUCE_MP_CONSUMPTION, type, 0, id); }; Game_BattlerBase.prototype.AttributeChangePrioritize = function() { return this.attributeWithId(Game_BattlerBase.ATTRIBUTE_CHANGE_PRIORITIZE, 0, 0, 0); }; Game_BattlerBase.prototype.AttributeActivateSkill = function(occasion) { return this.attributeWithOccasion(Game_BattlerBase.ATTRIBUTE_ACTIVATE_SKILL_AUTOMATIC, 0, occasion); }; Game_BattlerBase.prototype.AttributeSubstituteTarget = function() { return this.attributeWithCode(Game_BattlerBase.ATTRIBUTE_SUBSTITUTE_TARGET); }; Game_BattlerBase.prototype.AttributeAddMoreActionPerTurn = function() { return this.attributeWithId(Game_BattlerBase.ATTRIBUTE_ADD_MORE_ACTIONS_PER_TURN, 0, 0, 0); }; Game_BattlerBase.prototype.AttributeReduceResistanceEnemy = function(type, id) { return this.attributeWithId(Game_BattlerBase.ATTRIBUTE_REDUCE_RESISTANCE_ENEMY, type, 0, id); }; Game_BattlerBase.prototype.AttributeModifyParam = function(type, id) { return this.attributeWithId(Game_BattlerBase.ATTRIBUTE_MODIFY_PARAM, type, 8, id); }; Game_BattlerBase.prototype.AttributeCancelAttribute = function() { var list = []; if ($gameParty.inBattle()) { this.opponentsUnit().aliveMembers().forEach(function(enemy) { enemy._attributes.forEach(function(attribute) { $gameAttributes._data[attribute.attributeId].effect.filter(function(effect) { return effect.code === Game_BattlerBase.ATTRIBUTE_CANCEL_ATTRIBUTE_EFFECT; }).forEach(function(effects) { list.push(effects.id); }); }); }); } return list; }; Game_BattlerBase.prototype.AttributeGainStateAtBattleStart = function() { return this.attributeWithOccasion(Game_BattlerBase.ATTRIBUTE_GAIN_STATE_AT_BATTLE_START, 0, 0); }; Game_BattlerBase.prototype.AttributeBonusAfterMath = function(type) { return this.attributeWithId(Game_BattlerBase.ATTRIBUTE_BONUS_AFTERMATH_UP, type, 0, 0); }; Game_BattlerBase.prototype.AttributeRecruitChanceUp = function() { return this.attributeWithOccasion(Game_BattlerBase.ATTRIBUTE_RECRUIT_CHANCES_UP, 0, 0); }; Game_BattlerBase.prototype.AttributeEquipAnyWeapons = function() { return this.attributeWithId(Game_BattlerBase.ATTRIBUTE_EQUIP_ANY_WEAPONS, 0, 0, 0); }; Game_BattlerBase.prototype.AttributeGainSkillUsability = function() { return this.attributeWithOccasion(Game_BattlerBase.ATTRIBUTE_GAIN_SKILL_USABILITY, 0, 0); }; Game_BattlerBase.prototype.AttributeInflictStateWithAttack = function() { return this.attributeWithOccasion(Game_BattlerBase.ATTRIBUTE_INFLICT_STATE_WITH_ATTACK, 0, 0); }; Game_BattlerBase.prototype.AttributeEnsureEscape = function() { return this.attributeWithOccasion(Game_BattlerBase.ATTRIBUTE_ENSURE_ESCAPE, 0, 0); }; Game_BattlerBase.prototype.AttributeReplaceAttribute = function() { var list = []; this._attributes.forEach(function(attribute) { $gameAttributes._data[attribute.attributeId].effect.filter(function(effect) { return effect.code === Game_BattlerBase.ATTRIBUTE_REPLACE_ATTRIBUTE; }).forEach(function(effects) { list.push(effects.id); }); }); return list; }; Game_BattlerBase.prototype.AttributeMultiplyHit = function() { return this.attributeWithOccasion(Game_BattlerBase.ATTRIBUTE_MULTIPLY_HITS, 0, 0).filter(function(effect) { return effect.id === this.currentClass().id || 0; }, this).reduce(function(r, effect) { return r + effect.value1; }, 1) || 1; }; DQM.Core.Game_BattlerBase_param = Game_BattlerBase.prototype.param; Game_BattlerBase.prototype.param = function(paramId) { var valueDefault = DQM.Core.Game_BattlerBase_param.call(this, paramId); var hitPlus = this.AttributeMultiplyHit() - 1; if ([2, 3, 4, 5].contains(paramId)) { var Formula = DQM.Param.TensionFormulaDamage.format(valueDefault, this._tension); valueDefault = eval(Formula); } var MultiplyBonus = this.AttributeModifyParam(1, paramId).reduce(function(r, attribute) { if (attribute.occasion === 0) { return r + attribute.value1; } else if (attribute.occasion === 8) { return r + attribute.value1 * hitPlus; } }, 100) || 100; var AddedBonus = this.AttributeModifyParam(1, paramId).reduce(function(r, attribute) { if (attribute.occasion === 0) { return r + attribute.value2; } else if (attribute.occasion === 8) { return r + attribute.value2 * hitPlus; } }, 0) || 0; valueDefault = valueDefault * MultiplyBonus / 100; valueDefault = valueDefault + AddedBonus; var maxValue = this.paramMax(paramId); var minValue = this.paramMin(paramId); if (this._critical) { valueDefault = valueDefault * DQM.Param.RateCriticalEffect / 100; } return Math.round(valueDefault.clamp(minValue, maxValue)); }; DQM.Core.Game_BattlerBase_xparam = Game_BattlerBase.prototype.xparam; Game_BattlerBase.prototype.xparam = function(xparamId) { var valueDefault = DQM.Core.Game_BattlerBase_xparam.call(this, xparamId); if (xparamId === 0) { valueDefault += DQM.Param.HitDefault; } else if ([1, 4].contains(xparamId)) { valueDefault += DQM.Param.EvasionDefault; } else if (xparamId === 2) { valueDefault += DQM.Param.CriticalDefault; } var MultiplyBonus = this.AttributeModifyParam(3, xparamId).reduce(function(r, attribute) { return r + attribute.value1; }, 100) || 100; var AddedBonus = this.AttributeModifyParam(2, xparamId).reduce(function(r, attribute) { return r + attribute.value2; }, 0) || 0; valueDefault = valueDefault * MultiplyBonus / 100; valueDefault = valueDefault + (AddedBonus / 100); if (this._critical) { valueDefault = valueDefault * DQM.Param.RateCriticalEffect / 100; } return valueDefault; }; DQM.Core.Game_BattlerBase_sparam = Game_BattlerBase.prototype.sparam; Game_BattlerBase.prototype.sparam = function(sparamId) { var valueDefault = DQM.Core.Game_BattlerBase_sparam.call(this, sparamId); var MultiplyBonus = this.AttributeModifyParam(3, sparamId).reduce(function(r, attribute) { return r + attribute.value1; }, 100) || 100; var AddedBonus = this.AttributeModifyParam(3, sparamId).reduce(function(r, attribute) { return r + attribute.value2; }, 0) || 0; valueDefault = valueDefault * MultiplyBonus / 100; valueDefault = valueDefault + (AddedBonus / 100); if ([6, 7].contains(sparamId) && $gameParty.inBattle()) { MultiplyBonus = 100; AddedBonus = 0; this.opponentsUnit().aliveMembers().forEach(function(battler) { MultiplyBonus = battler.AttributeReduceResistanceEnemy(2, sparamId - 5).reduce(function(r, attribute) { return r + attribute.value1; }, MultiplyBonus); AddedBonus = battler.AttributeReduceResistanceEnemy(2, sparamId - 5).reduce(function(r, attribute) { return r + attribute.value2; }, AddedBonus); }, this); valueDefault = valueDefault * MultiplyBonus / 100; valueDefault = valueDefault + (AddedBonus / 100); } if (this._critical) { valueDefault = valueDefault * DQM.Param.RateCriticalEffect / 100; } return valueDefault; }; DQM.Core.Game_BattlerBase_clearBuffs = Game_BattlerBase.prototype.clearBuffs; Game_BattlerBase.prototype.clearBuffs = function() { DQM.Core.Game_BattlerBase_clearBuffs.apply(this); this.TensionReset(); }; DQM.Core.Game_BattlerBase_attackStates = Game_BattlerBase.prototype.attackStates; Game_BattlerBase.prototype.attackStates = function() { var defaultList = DQM.Core.Game_BattlerBase_attackStates.call(this); return defaultList.concat(this.AttributeInflictStateWithAttack().map(function(effect) { return {"code":Game_BattlerBase.TRAIT_ATTACK_STATE, "dataId":effect.id, "value":effect.chance}; })); }; DQM.Core.Game_BattlerBase_attackStatesRate = Game_BattlerBase.prototype.attackStatesRate; Game_BattlerBase.prototype.attackStatesRate = function(stateId) { var defaultValue = DQM.Core.Game_BattlerBase_attackStatesRate.call(this, stateId); return defaultValue + this.AttributeInflictStateWithAttack().reduce(function(r, effect) { return effect.id === stateId ? r + (effect.chance / 100) : r; }, 0); }; Game_BattlerBase.prototype.getChangeTensionLevel = function(oldLevel) { var newIndex = DQM.Param.TensionListLevel.indexOf(String(Math.abs(this._tension))); if (Math.abs(this._tension) !== this._tension) { newIndex = -newIndex - 2; } var oldIndex = DQM.Param.TensionListLevel.indexOf(String(Math.abs(oldLevel))); if (Math.abs(oldLevel) !== oldLevel) { oldIndex = -oldIndex - 2; } return newIndex - oldIndex; }; Game_BattlerBase.prototype.TensionUp = function(levelBonus) { var oldIndex = DQM.Param.TensionListLevel.indexOf(String(Math.abs(this._tension))); if (Math.abs(this._tension) !== this._tension) { oldIndex = -oldIndex - 2; } if (oldIndex + levelBonus > -1) { this._tension = Number(DQM.Param.TensionListLevel[Math.min(oldIndex + levelBonus, DQM.Param.TensionListLevel.length - 1)]); } else if (oldIndex + levelBonus === -1) { this._tension = 0; } else { this._tension = -Number(DQM.Param.TensionListLevel[Math.min(- oldIndex - levelBonus - 2, DQM.Param.TensionListLevel.length - 1)]); } }; Game_BattlerBase.prototype.TensionReset = function() { this._tension = 0; }; Game_BattlerBase.prototype.canTension = function() { return this.AttributeGainSkillUsability().filter(function(attribute) { return attribute.id === DQM.Param.TensionId; }).length > 0; }; DQM.Core.Game_BattlerBase_allTraits = Game_BattlerBase.prototype.allTraits; Game_BattlerBase.prototype.allTraits = function() { var BaseTraits = DQM.Core.Game_BattlerBase_allTraits.apply(this); return BaseTraits.concat(this._traits); }; Game_BattlerBase.prototype.addNewTraitWithId = function(code, dataId, value) { this._traits.push({"code":code, "dataId":dataId, "value":value}); }; Game_BattlerBase.prototype.removeTraitWithId = function(code, dataId, value) { var index = 0; while (index < this._traits.length && (this._traits[index].code !== code || this._traits[index].dataId !== dataId || this._traits[index].value !== value)) { index++; } if (index < this._traits.length) { this._traits.splice(index, 1); } }; Game_BattlerBase.prototype.addNewTraitWithoutId = function(code, value) { this._traits.push({"code":code, "dataId":0, "value":value}); }; Game_BattlerBase.prototype.removeTraitWithoutId = function(code, value) { var index = 0; while (index < this._traits.length && (this._traits[index].code !== code || this._traits[index].dataId !== 0 || this._traits[index].value !== value)) { index++; } if (index < this._traits.length) { this._traits.splice(index, 1); } }; Game_BattlerBase.prototype.attackRecruitId = function() { return DQM.Param.RecruitId; }; Game_BattlerBase.prototype.tensionId = function() { return DQM.Param.TensionId; }; Game_BattlerBase.prototype.substrParam = function(paramId, value) { this._paramPlus[paramId] -= value; this.refresh(); }; DQM.Core.Game_BattlerBase_skillMpCost = Game_BattlerBase.prototype.skillMpCost; Game_BattlerBase.prototype.skillMpCost = function(skill, byAttribute) { if (byAttribute) { return 0; } var defaultValue = DQM.Core.Game_BattlerBase_skillMpCost.call(this, skill); var MultiplyBonus = 100; this.AttributeChangeMPConsumption(1, 0).forEach(function(attribute) { MultiplyBonus = MultiplyBonus + attribute.value1; }); this.AttributeChangeMPConsumption(1, skill.damage.elementId).forEach(function(attribute) { MultiplyBonus = MultiplyBonus + attribute.value1; }); this.AttributeChangeMPConsumption(2, skill.hitType).forEach(function(attribute) { MultiplyBonus = MultiplyBonus + attribute.value1; }); this.AttributeChangeMPConsumption(3, skill.damage.type).forEach(function(attribute) { MultiplyBonus = MultiplyBonus + attribute.value1; }); return Math.ceil(defaultValue * MultiplyBonus / 100); }; DQM.Core.Game_BattlerBase_skillTpCost = Game_BattlerBase.prototype.skillTpCost; Game_BattlerBase.prototype.skillTpCost = function(skill, byAttribute) { if (byAttribute) { return 0; } var defaultValue = DQM.Core.Game_BattlerBase_skillTpCost.call(this, skill); var MultiplyBonus = 100; this.AttributeChangeMPConsumption(1, 0).forEach(function(attribute) { MultiplyBonus = MultiplyBonus + attribute.value1; }); this.AttributeChangeMPConsumption(1, skill.damage.elementId).forEach(function(attribute) { MultiplyBonus = MultiplyBonus + attribute.value1; }); this.AttributeChangeMPConsumption(2, skill.hitType).forEach(function(attribute) { MultiplyBonus = MultiplyBonus + attribute.value1; }); this.AttributeChangeMPConsumption(3, skill.damage.type).forEach(function(attribute) { MultiplyBonus = MultiplyBonus + attribute.value1; }); return Math.ceil(defaultValue * MultiplyBonus / 100); }; Game_BattlerBase.prototype.paySkillCost = function(skill, byAttribute) { this._mp -= this.skillMpCost(skill, byAttribute); this._tp -= this.skillTpCost(skill, byAttribute); }; Game_BattlerBase.prototype.traitsPi = function(code, id) { return 1 + this.traitsWithId(code, id).reduce(function(r, trait) { return r + trait.value - 1; }, 0); }; DQM.Core.Game_BattlerBase_canEquip = Game_BattlerBase.prototype.canEquip; Game_BattlerBase.prototype.canEquip = function(item) { if (!item) { return false; } else if (DataManager.isWeapon(item) || DataManager.isArmor(item)) { if (this.AttributeEquipAnyWeapons().length > 0) { return true; } else if (DataManager.isWeapon(item) && item.wtypeId === DQM.Param.WeaponDefault) { return true; } else { return DQM.Core.Game_BattlerBase_canEquip.call(this, item); } } else { return false; } }; DQM.Core.Game_BattlerBase_debuffRate = Game_BattlerBase.prototype.debuffRate; Game_BattlerBase.prototype.debuffRate = function(paramId) { var DefaultValue = DQM.Core.Game_BattlerBase_debuffRate.call(this, paramId); if ($gameParty.inBattle()) { var MultiplyBonus = 100; var AddedBonus = 0; this.opponentsUnit().aliveMembers().forEach(function(battler) { MultiplyBonus = battler.AttributeReduceResistanceEnemy(4, paramId).reduce(function(r, attribute) { return r + attribute.value1; }, MultiplyBonus); AddedBonus = battler.AttributeReduceResistanceEnemy(4, paramId).reduce(function(r, attribute) { return r + attribute.value2; }, AddedBonus); }, this); DefaultValue = DefaultValue * MultiplyBonus / 100; DefaultValue = DefaultValue + (AddedBonus / 100); } return DefaultValue; }; DQM.Core.Game_BattlerBase_stateRate = Game_BattlerBase.prototype.stateRate; Game_BattlerBase.prototype.stateRate = function(stateId) { var DefaultValue = DQM.Core.Game_BattlerBase_stateRate.call(this, stateId); if ($gameParty.inBattle()) { var MultiplyBonus = 100; var AddedBonus = 0; this.opponentsUnit().aliveMembers().forEach(function(battler) { MultiplyBonus = battler.AttributeReduceResistanceEnemy(5, stateId).reduce(function(r, attribute) { return r + attribute.value1; }, MultiplyBonus); AddedBonus = battler.AttributeReduceResistanceEnemy(5, stateId).reduce(function(r, attribute) { return r + attribute.value2; }, AddedBonus); }, this); DefaultValue = DefaultValue * MultiplyBonus / 100; DefaultValue = DefaultValue + (AddedBonus / 100); } return DefaultValue; }; DQM.Core.Game_BattlerBase_resetStateCounts = Game_BattlerBase.prototype.resetStateCounts; Game_BattlerBase.prototype.resetStateCounts = function(stateId) { if (!this.isInfiniteState(stateId)) { DQM.Core.Game_BattlerBase_resetStateCounts.call(this, stateId); } }; Game_BattlerBase.prototype.isInfiniteState = function(stateId) { return this.AttributeGainStateAtBattleStart().some(function(attribute) { return attribute.id === stateId && attribute.value2 === 0; }); }; DQM.Core.Game_BattlerBase_elementRate = Game_BattlerBase.prototype.elementRate; Game_BattlerBase.prototype.elementRate = function(elementId) { if (this.getAbsorbElementValue(elementId) > 0) { var DefaultValue = 1; } else { var DefaultValue = DQM.Core.Game_BattlerBase_elementRate.call(this, elementId); if ($gameParty.inBattle()) { var MultiplyBonus = 100; var AddedBonus = 0; this.opponentsUnit().aliveMembers().forEach(function(battler) { MultiplyBonus = battler.AttributeReduceResistanceEnemy(1, elementId).reduce(function(r, attribute) { return r + attribute.value1; }, MultiplyBonus); AddedBonus = battler.AttributeReduceResistanceEnemy(1, elementId).reduce(function(r, attribute) { return r + attribute.value2; }, AddedBonus); }, this); DefaultValue = DefaultValue * MultiplyBonus / 100; DefaultValue = DefaultValue + (AddedBonus / 100); } } return DefaultValue; }; Game_BattlerBase.prototype.setScreenSize = function(width, height) { if (width !== 0) { this._screenWidth = width; } if (height !== 0) { this._screenHeight = height; } }; //============================================================================= // Game_Battler //============================================================================= Game_Battler.prototype.affectBuff = function(paramId, bonusValue, numTurns) { for (var k = 0; k < Math.max(bonusValue, -bonusValue); k++) { if (bonusValue < 0) { this.addDebuff(paramId, numTurns); } else if (bonusValue > 0) { this.addBuff(paramId, numTurns); } } }; Game_Battler.prototype.regenerate = function(paramId, bonusValue) { var value; switch (paramId) { case 1: value = Math.floor(this.mhp * bonusValue / 100); value = Math.max(value, -this.maxSlipDamage()); if (value !== 0) { this.gainHp(value); } break; case 2: value = Math.floor(this.mmp * bonusValue / 100); if (value !== 0) { this.gainMp(value); } break; default: break; } }; DQM.Core.Game_Battler_makeSpeed = Game_Battler.prototype.makeSpeed; Game_Battler.prototype.makeSpeed = function() { var actionsRemoved; var index = this._actions.indexOf(null); if (index > -1) { actionsRemoved = this._actions.splice(index, this._actions.length - index); } DQM.Core.Game_Battler_makeSpeed.call(this); if (index > -1) { this._actions = this._actions.concat(actionsRemoved); } }; DQM.Core.Game_Battler_isChanting = Game_Battler.prototype.isChanting; Game_Battler.prototype.isChanting = function() { var actionsRemoved; var index = this._actions.indexOf(null); if (index > -1) { actionsRemoved = this._actions.splice(index, this._actions.length - index); } var result = DQM.Core.Game_Battler_isChanting.call(this); if (index > -1) { this._actions = this._actions.concat(actionsRemoved); } return result; }; DQM.Core.Game_Battler_isGuardWaiting = Game_Battler.prototype.isGuardWaiting; Game_Battler.prototype.isGuardWaiting = function() { var actionsRemoved; var index = this._actions.indexOf(null); if (index > -1) { actionsRemoved = this._actions.splice(index, this._actions.length - index); } var result = DQM.Core.Game_Battler_isGuardWaiting.call(this); if (index > -1) { this._actions = this._actions.concat(actionsRemoved); } return result; }; DQM.Core.Game_Battler_removeBattleStates = Game_Battler.prototype.removeBattleStates; Game_Battler.prototype.removeBattleStates = function() { this.states().forEach(function(state) { if (this.isInfiniteState(state.id)) { this.removeState(state.id); } }, this); DQM.Core.Game_Battler_removeBattleStates.call(this); }; DQM.Core.Game_Battler_onBattleEnd = Game_Battler.prototype.onBattleEnd; Game_Battler.prototype.onBattleEnd = function() { this.TensionReset(); DQM.Core.Game_Battler_onBattleEnd.call(this); }; DQM.Core.Game_Battler_removeStatesByDamage = Game_Battler.prototype.removeStatesByDamage; Game_Battler.prototype.removeStatesByDamage = function() { var stateTokeep = []; for (var k = this._states.length; k > 0; k--) { if (this.isInfiniteState(this._states[k-1])) { stateTokeep = stateTokeep.concat(this._states.splice(k-1,1)); } } DQM.Core.Game_Battler_removeStatesByDamage.call(this); this._states = this._states.concat(stateTokeep); this.sortStates(); }; DQM.Core.Game_Battler_makeActionTimes = Game_Battler.prototype.makeActionTimes; Game_Battler.prototype.makeActionTimes = function(isAutomatic) { isAutomatic = isAutomatic || (this.isAutoBattle() || this.isConfused() || this.isEnemy()); var minValue = DQM.Core.Game_Battler_makeActionTimes.call(this); var bonusList = this.AttributeAddMoreActionPerTurn().filter(function(effect) { return effect.type === 1 || isAutomatic; }); var minBonus = bonusList.reduce(function(r, effect) { return r + effect.value1; }, 0) || 0; var maxBonus = bonusList.reduce(function(r, effect) { return r + effect.value2; }, 0) || 0; var randomInt = Math.randomInt(100); minValue = minValue + minBonus + Math.floor((randomInt * (maxBonus - minBonus + 1))/100); return minValue; }; Game_Battler.prototype.isFirstOrder = function() { return this._actionInputIndex === 0; }; DQM.Core.Game_Battler_onBattleStart = Game_Battler.prototype.onBattleStart; Game_Battler.prototype.onBattleStart = function() { DQM.Core.Game_Battler_onBattleStart.call(this) this._tensionToReset = false; }; DQM.Core.Game_Battler_onTurnEnd = Game_Battler.prototype.onTurnEnd; Game_Battler.prototype.onTurnEnd = function() { DQM.Core.Game_Battler_onTurnEnd.call(this); if (this._tensionToReset) { this.TensionReset(); } this._tensionToReset = false; }; DQM.Core.Game_Battler_startAnimation = Game_Battler.prototype.startAnimation; Game_Battler.prototype.startAnimation = function(animationId, mirror, delay) { if (BattleManager._logWindow) { BattleManager._logWindow.changePointOfView(this); } DQM.Core.Game_Battler_startAnimation.call(this, animationId, mirror, delay); }; Game_Battler.prototype.useItem = function(item, byAttribute) { if (DataManager.isSkill(item)) { this.paySkillCost(item, byAttribute); } else if (DataManager.isItem(item)) { this.consumeItem(item); } }; //============================================================================= // Game_Actor //============================================================================= Game_Actor.STRATEGY_DEFAULT = 0; Game_Actor.STRATEGY_BERSERKER = 1; Game_Actor.STRATEGY_HEALING_ALLIES = 2; Game_Actor.STRATEGY_STRENGTHENING_ALLIES = 3; Game_Actor.STRATEGY_REDUCE_ENEMY = 4; Game_Actor.STRATEGY_NO_USE_POINTS = 5; Game_Actor.prototype.screenX = function() { var index = $gameParty.members().filter(function(member) { return member.index() < this.index(); }, this).reduce(function(r, member) { return r + member.SizeClass(); }, 0) || 0; var size = this.SizeClass(); return 584 + Math.floor((index + (size/2)) * 32); }; Game_Actor.prototype.screenY = function() { var index = $gameParty.members().filter(function(member) { return member.index() < this.index(); }, this).reduce(function(r, member) { return r + member.SizeClass(); }, 0) || 0; var size = this.SizeClass(); return 256 + Math.floor((index + (size/2)) * 48); }; Game_Actor.prototype.canTension = function() { return this.isLearnedSkill(DQM.Param.TensionId) || Game_BattlerBase.prototype.canTension.call(this); }; DQM.Core.Game_Actor_initMembers = Game_Actor.prototype.initMembers; Game_Actor.prototype.initMembers = function() { DQM.Core.Game_Actor_initMembers.call(this); this._monster = null; this._skillsets = []; this._jobPoints = 0; this._strategy = 0; this._traits = []; this._synthesisHist = []; this._rankValueAdded = 0; this._gender = 0; this._teamIndex = -1; this._index = 0; }; DQM.Core.Game_Actor_setup = Game_Actor.prototype.setup; Game_Actor.prototype.setup = function(actorId, Actor1, Actor2) { var actor = $dataActors[actorId]; DQM.Core.Game_Actor_setup.call(this, actorId); this._monster = actor.monster; for (var k = 0; k < actor.Skillsets.length; k++) { this.AddSkillSet(actor.Skillsets[k][0], Math.min(actor.Skillsets[k][1],$gameSkillset._data[actor.Skillsets[k][0]].list.length - 1)); }; this._jobPoints = actor.JobPoints; this.defineGender(Actor1, Actor2); if (Actor1 && Actor2) { this._synthesisHist = this.getSynthesisHist(Actor1, Actor2); if (DQM.Param.RankValueAddable) { this._rankValueAdded = Actor1._rankValueAdded + Actor2._rankValueAdded + 1; } else { this._rankValueAdded = Math.max(Actor1._rankValueAdded, Actor2._rankValueAdded) + 1; } this.setupParamPlus(Actor1, Actor2); this.setResistUp(); } this.setupAttribute(Actor1, Actor2); $gameSystem.addToMonsterBook(this._classId, true); this.recoverAll(); this.refresh(); this.setProfile(this.currentClass().Profile); }; Game_Actor.prototype.getSynthesisHist = function(Actor1, Actor2) { return [this.getSynthesisHistByActor([Actor1._classId, Actor1._synthesisHist], 1),this.getSynthesisHistByActor([Actor2._classId, Actor2._synthesisHist], 1)]; }; Game_Actor.prototype.getSynthesisHistByActor = function(actor, level) { if (level === 5 || actor[1].length < 1) { return [actor[0], []]; } else { return [actor[0], [this.getSynthesisHistByActor(actor[1][0], level + 1), this.getSynthesisHistByActor(actor[1][1], level + 1)]]; } }; Game_Actor.prototype.setResistUp = function() { var traitsPlus = this.currentClass().resistSynthesisUp.filter(function(traitPlus) { return traitPlus.levelSynthesis <= this._rankValueAdded; }, this); for (var k = 0; k < traitsPlus.length; k++) { this.addNewTraitWithId(traitsPlus[k].code, traitsPlus[k].dataId, traitsPlus[k].value); } }; Game_Actor.prototype.setupParamPlus = function(Actor1, Actor2) { for (var k = 0; k < this._paramPlus.length; k++) { this.addParam(k, Math.floor((Actor1.param(k) + Actor2.param(k)) * DQM.Param.RateSynthesisParamPlus / 100)); } }; Game_Actor.prototype.hasEquipsEffectsKeepAfterSynthesis = function() { return this.traitsSet(Game_BattlerBase.TRAIT_BLOCK_CLASSID_FOR_SYNTHESIS).length > 0; }; Game_Actor.prototype.hasEquipsEffectsDefineGenderAfterSynthesis = function() { return this.traits(Game_BattlerBase.TRAIT_DEFINE_GENDER_FOR_SYNTHESIS).length > 0; }; Game_Actor.prototype.EffectsDefineGenderAfterSynthesis = function() { var list = this.traits(Game_BattlerBase.TRAIT_DEFINE_GENDER_FOR_SYNTHESIS).reduce(function(r, trait) { return r.concat(trait.value); }, []); var result = 0; if (list.contains(-1)) { result--; } if (list.contains(1)) { result++; } return result; }; Game_Actor.prototype.attributeEffectsOnly = function() { var result = Game_BattlerBase.prototype.attributeEffectsOnly.call(this); for (var k = 0; k < this.equips().length; k++) { if (this.equips()[k] && this.equips()[k]._attributeAddedEffect && this.equips()[k]._attributeAddedEffect.length > 0) { result = result.concat(this.equips()[k]._attributeAddedEffect); } } return result; }; Game_Actor.prototype.defineGender = function(Actor1, Actor2) { if (!Actor1 || !Actor2) { this.generateNewGender(); } else if (!Actor1.hasEquipsEffectsDefineGenderAfterSynthesis() && !Actor2.hasEquipsEffectsDefineGenderAfterSynthesis()) { this.generateNewGender(); } else if (Actor1.hasEquipsEffectsDefineGenderAfterSynthesis() && Actor2.hasEquipsEffectsDefineGenderAfterSynthesis()){ var gender1 = Actor1.EffectsDefineGenderAfterSynthesis(); var gender2 = Actor2.EffectsDefineGenderAfterSynthesis(); if (gender1 === 0 || gender2 === 0) { this._gender = 0; } else if (gender1 === gender2){ this._gender = gender1; } else { this._gender = 0; } } else if (Actor1.hasEquipsEffectsDefineGenderAfterSynthesis()) { this._gender = Actor1.EffectsDefineGenderAfterSynthesis(); } else { this._gender = Actor2.EffectsDefineGenderAfterSynthesis(); } }; Game_Actor.prototype.generateNewGender = function() { var random = Math.randomInt(100); if (random < 40) { this._gender = -1; } else if (random >= 60) { this._gender = 1; } else { this._gender = 0; } }; Game_Actor.prototype.setupAttribute = function(Actor1, Actor2) { var attributeList = this.currentClass().AttributeList.filter(function(attribute) { return attribute.levelSynthesis <= this._rankValueAdded && (attribute.particularConditions.length < 1 || (Actor1 && Actor2 && (this.canAddAttribute(attribute, Actor1) || this.canAddAttribute(attribute, Actor2)))); }, this); for (var k = 0; k < attributeList.length; k++) { this.addAttribute(attributeList[k].attributeId, false); } }; Game_Actor.prototype.canAddAttribute = function(attribute, Actor) { if (!Actor) { return false; } var testList = Actor._attributes.filter(function(oldAttribute) { return oldAttribute.attributeId === attribute.attributeId; }); if (testList.length < 1) { return false; } if (Actor._classId === this._classId) { return !testList[0].bySkillset; } else { for (var k = 0; k < attribute.particularConditions.length; k++) { if (attribute.particularConditions[k].ConditionsType === 1 && attribute.particularConditions[k].ValueId === Actor.GroupClassId()) { return true; } else if (attribute.particularConditions[k].ConditionsType === 2 && attribute.particularConditions[k].ValueId === Actor.SizeClass()) { return true; } else if (attribute.particularConditions[k].ConditionsType === 3 && attribute.particularConditions[k].ValueId === Actor.RankClassId()) { return true; } } return false; } }; Game_Actor.prototype.addAttribute = function(AttributeId, bySkillset) { if (this._attributes.filter(function(attribute) { return attribute.attributeId === AttributeId; }).length < 1) { this._attributes.push({"attributeId":AttributeId, "bySkillset":bySkillset}); } if (!bySkillset) { $gameSystem.addToAttributeBook(AttributeId, this._classId); } else { $gameSystem.addToAttributeBook(AttributeId); } }; Game_Actor.prototype.forgetAttribute = function(AttributeId) { var index = 0; while (index < this._attributes.length && this._attributes[index].attributeId !== AttributeId) { index++; } if (index < this._attributes.length) { this._attributes.splice(index, 1); } }; DQM.Core.Game_Actor_maxLevel = Game_Actor.prototype.maxLevel; Game_Actor.prototype.maxLevel = function() { if (this._monster) { var index = (DQM.Param.capChangeLevelMax.filter(function(value) { return Number(value) <= this._rankValueAdded; }, this).length || 1) - 1; return Number(DQM.Param.valueChangeLevelMax[index]); } else { return DQM.Core.Game_Actor_maxLevel.call(this); } }; Game_Actor.prototype.paramMax = function(paramId) { var listParamMax = this.currentClass().ParamMaxList.filter(function(list) { return list.synthesisLevel <= this._rankValueAdded; }, this); return listParamMax[listParamMax.length - 1].params[paramId]; }; Game_Actor.prototype.getAbsorbElementValue = function(elementId) { return this.currentClass().absorbElement[elementId]; }; Game_Actor.prototype.JobPointsUsable = function() { return this._jobPoints; }; Game_Actor.prototype.GainJobPoints = function(Points) { this._jobPoints = Math.min(this._jobPoints + Points, this.MaxJobPoints()); }; Game_Actor.prototype.UseJobPoints = function(Points) { this._jobPoints = this._jobPoints - Points; }; Game_Actor.prototype.GroupClassId = function() { return this.currentClass().GroupClassId; }; Game_Actor.prototype.GroupClass = function() { return DQM.Param.GroupClassList[this.GroupClassId()]; }; Game_Actor.prototype.SizeClass = function() { return this.currentClass().SizeClass; }; Game_Actor.prototype.SizeClassDescription = function() { return DQM.Param.SizeClassList[this.SizeClass()]; }; Game_Actor.prototype.SizeClassIcon = function() { return DQM.Param.SizeClassIcon[this.SizeClass()]; }; Game_Actor.prototype.RankClassId = function() { return this.currentClass().RankClassId; }; Game_Actor.prototype.RankClass = function() { return DQM.Param.RankClassList[this.RankClassId()]; }; Game_Actor.prototype.GenderId = function() { return this._gender; }; Game_Actor.prototype.Gender = function() { return DQM.Param.GenderActorList[this.GenderId() + 1]; }; Game_Actor.prototype.MaxSkillSetSlots = function() { return this.SizeClass() + 2; }; Game_Actor.prototype.MaxJobPoints = function() { return 999; }; Game_Actor.prototype.SkillSetSlotUsed = function() { return this._skillsets.length; }; Game_Actor.prototype.SkillSetSlotId = function(SlotId) { return this._skillsets[SlotId].id; }; Game_Actor.prototype.CurrentJobPoints = function(SlotId) { return this._skillsets[SlotId].jobPoints; }; Game_Actor.prototype.GetSkillSetData = function(SlotId) { return $gameSkillset._data[this.SkillSetSlotId(SlotId)]; }; Game_Actor.prototype.GetNameSlot = function(SlotId) { return this.GetSkillSetData(SlotId).name; }; Game_Actor.prototype.GetDescSlot = function(SlotId) { return this.GetSkillSetData(SlotId).desc; }; Game_Actor.prototype.GetListSlot = function(SlotId) { return this.GetSkillSetData(SlotId).list; }; Game_Actor.prototype.MaxJobPointsSlot = function(SlotId) { return this.GetListSlot(SlotId).length - 1; }; Game_Actor.prototype.MaxJobPointsUsableSlot = function(SlotId) { return Math.min(this.MaxJobPointsSlot(SlotId) - this.CurrentJobPoints(SlotId), this.JobPointsUsable()); }; Game_Actor.prototype.IsLearnedByLevel = function(SkillId) { var Bylevel = this.currentClass().learnings.filter(function(learning) { return learning.skillId === SkillId && learning.level <= this._level; }); if (Bylevel.length > 0) { return true; } return false; }; Game_Actor.prototype.IsLearnedBySkillSet = function(SlotId, SkillId) { var List = this.GetListSlot(SlotId); var BySkillSet = List.filter(function(skill) { return (skill.skillObtained.indexOf(SkillId) !== -1 && skill.level <= this.CurrentJobPoints(SlotId)); }, this); if (BySkillSet.length > 0) { return true; } return false; }; Game_Actor.prototype.IsLearnedByOtherSkillSet = function(SlotId, SkillId) { var res = false; for (var i = 0; i < this.SkillSetSlotUsed(); i++) { if (i !== SlotId) { res = res || this.IsLearnedBySkillSet(i, SkillId); } } return res; }; Game_Actor.prototype.IsLearnedInAnotherWay = function(SlotId, SkillId) { return this.IsLearnedByLevel(SkillId) || this.IsLearnedByOtherSkillSet(SlotId, SkillId); }; Game_Actor.prototype.AttributeLearnedByClass = function(AttributeId) { return this._attributes.filter(function(attribute) { return attribute.attributeId === AttributeId && attribute.bySkillset; }).length > 0; }; Game_Actor.prototype.AttributeIsLearnedBySkillset = function(SlotId, AttributeId) { var List = this.GetListSlot(SlotId); var BySkillSet = List.filter(function(skill) { return (skill.attributeObtained.indexOf(AttributeId) !== -1 && skill.level <= this.CurrentJobPoints(SlotId)); }, this); if (BySkillSet.length > 0) { return true; } return false; }; Game_Actor.prototype.AttributeIsLearnedByOtherSkillSet = function(SlotId, AttributeId) { var res = false; for (var i = 0; i < this.SkillSetSlotUsed(); i++) { if (i !== SlotId) { res = res || this.IsLearnedBySkillSet(i, AttributeId); } } return res; }; Game_Actor.prototype.AttributeIsLearnedInAnotherWay = function(SlotId, AttributeId) { return this.AttributeLearnedByClass(AttributeId) || this.AttributeIsLearnedByOtherSkillSet(SlotId, AttributeId); }; Game_Actor.prototype.AddJobPointsToSkillSet = function(SlotId, JobPoints) { var previousResult = this.CurrentJobPoints(SlotId); this._skillsets[SlotId].jobPoints = previousResult + JobPoints; var ListBonus = this.GetListSlot(SlotId).filter(function(List) { return List.level > previousResult && List.level <= previousResult + JobPoints; }); for (var l = 0; l < ListBonus.length; l++) { var BonusList = ListBonus[l]; for (var k = 0; k < BonusList.skillObtained.length; k++) { this.learnSkill(BonusList.skillObtained[k]); } for (var k = 0; k < BonusList.paramBonus.length; k++) { if (BonusList.paramBonus[k] > 0) { this.addParam(k, BonusList.paramBonus[k]); } } for (var k = 0; k < BonusList.stateResist.length; k++) { this.addNewTraitWithId(this.TRAIT_STATE_RATE, BonusList.stateResist[k].stateId, (100 - BonusList.stateResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.elementResist.length; k++) { this.addNewTraitWithId(this.TRAIT_ELEMENT_RATE, BonusList.elementResist[k].elementId, (100 - BonusList.elementResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.debuffResist.length; k++) { this.addNewTraitWithId(this.TRAIT_DEBUFF_RATE, BonusList.debuffResist[k].debuffId, (100 - BonusList.debuffResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.attributeObtained.length; k++) { this.addAttribute(BonusList.attributeObtained[k], true); }; }; if (!$gameSystem.isInSkillSetBook(this._skillsets[SlotId].id)) { $gameSystem.addToSkillsetBook(this._skillsets[SlotId].id); } $gameSystem.updateLevelMax(this._skillsets[SlotId].id, this._skillsets[SlotId].jobPoints); }; DQM.Core.Game_Actor_refresh = Game_Actor.prototype.refresh; Game_Actor.prototype.refresh = function() { DQM.Core.Game_Actor_refresh.call(this); if (this._teamIndex === $gameParty.stockageId()) { this.recoverAll(); } }; Game_Actor.prototype.AddSkillSet = function(SkillId, JobPoints) { var NewSlot = this.SkillSetSlotUsed(); this._skillsets[NewSlot] = {}; this._skillsets[NewSlot].id = SkillId; this._skillsets[NewSlot].jobPoints = 0; this.AddJobPointsToSkillSet(NewSlot, JobPoints); }; Game_Actor.prototype.RemoveSkillSet = function(SlotId) { var currentResult = this.CurrentJobPoints(SlotId); var ListBonus = this.GetListSlot(SlotId).filter(function(List) { return List.level <= currentResult; }); for (var l = 0; l < ListBonus.length; l++) { var BonusList = ListBonus[l]; for (var k = 0; k < BonusList.skillObtained.length; k++) { if (!this.IsLearnedInAnotherWay(SlotId, BonusList.skillObtained[k])) { this.forgetSkill(BonusList.skillObtained[k]); } }; for (var k = 0; k < BonusList.paramBonus.length; k++) { if (BonusList.paramBonus[k] > 0) { this.substrParam(k, BonusList.paramBonus[k]); } }; for (var k = 0; k < BonusList.stateResist.length; k++) { this.removeTraitWithId(this.TRAIT_STATE_RATE, BonusList.stateResist[k].stateId, (100 + BonusList.stateResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.elementResist.length; k++) { this.removeTraitWithId(this.TRAIT_ELEMENT_RATE, BonusList.elementResist[k].elementId, (100 + BonusList.elementResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.debuffResist.length; k++) { this.removeTraitWithId(this.TRAIT_DEBUFF_RATE, BonusList.debuffResist[k].debuffId, (100 + BonusList.debuffResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.attributeObtained.length; k++) { if (!this.AttributeIsLearnedInAnotherWay(SlotId, BonusList.attributeObtained[k])) { this.forgetAttribute(BonusList.attributeObtained[k]); } }; }; this._skillsets.splice(SlotId, 1); }; Game_Actor.prototype.isMonster = function() { return this._monster; }; Game_Actor.prototype.StrategyName = function() { return DQM.Param.StrategyList[this._strategy]; }; Game_Actor.prototype.setStrategy = function(strategyId) { this._strategy = strategyId; } DQM.Core.Game_Actor_skills = Game_Actor.prototype.skills; Game_Actor.prototype.skills = function() { var defaultList = DQM.Core.Game_Actor_skills.call(this); this.AttributeGainSkillUsability().forEach(function(attribute){ if (!defaultList.contains($dataSkills[attribute.id])) { defaultList.push($dataSkills[attribute.id]); } }); return defaultList; }; DQM.Core.Game_Actor_levelUp = Game_Actor.prototype.levelUp; Game_Actor.prototype.levelUp = function() { DQM.Core.Game_Actor_levelUp.call(this); var index = DQM.Param.LevelJobPoint.indexOf(String(this._level)); if (index > -1) { this.GainJobPoints(Number(DQM.Param.ValueJobPoint[index])); } $gameSystem.changeLevelReached(this._classId, this._level); }; Game_Actor.prototype.displayJobPointsUp = function(oldValue) { if (oldValue < this._jobPoints) { $gameMessage.add(DQM.Param.DisplayGainJobPoints.format(this._name, this._jobPoints - oldValue)); } }; Game_Actor.prototype.shouldDisplayLevelUp = function() { return this._teamIndex !== $gameParty.stockageId(); }; DQM.Core.Game_Actor_changeExp = Game_Actor.prototype.changeExp; Game_Actor.prototype.changeExp = function(exp, show) { var oldValue = this.JobPointsUsable(); DQM.Core.Game_Actor_changeExp.call(this, exp, show); if (show) { this.displayJobPointsUp(oldValue); } this.refresh(); }; Game_Actor.prototype.initImages = function() { var c = this.currentClass(); var actor = this.actor(); this._characterName = actor.characterName; this._characterIndex = actor.characterIndex; this._faceName = c.faceName; this._faceIndex = c.faceIndex; this._battlerName = c.battlerName; this._battlerHue = c.battlerHue; this.setScreenSize(); }; Game_Actor.prototype.battlerHue = function() { return this._battlerHue; }; DQM.Core.Game_Actor_performActionStart = Game_Actor.prototype.performActionStart; Game_Actor.prototype.performActionStart = function(action) { DQM.Core.Game_Actor_performActionStart.call(this, action); this.requestEffect('whiten'); }; DQM.Core.Game_Actor_performDamage = Game_Actor.prototype.performDamage; Game_Actor.prototype.performDamage = function() { DQM.Core.Game_Actor_performDamage.call(this); this.requestEffect('blink'); }; DQM.Core.Game_Actor_performCollapse = Game_Actor.prototype.performCollapse; Game_Actor.prototype.performCollapse = function() { DQM.Core.Game_Actor_performCollapse.call(this); switch (this.collapseType()) { case 0: this.requestEffect('collapse'); break; case 1: this.requestEffect('collapse'); break; case 2: this.requestEffect('instantCollapse'); break; } }; Game_Actor.prototype.canNowUse = function(skill, TpNow, MpNow) { if (skill.isSkill()) { return (this.tp - TpNow) >= this.skillTpCost(skill.item()) && (this.mp - MpNow) >= this.skillMpCost(skill.item()); } else { return true; } }; Game_Actor.prototype.makeUsableList = function(oldList, i) { var TpNow = 0; var MpNow = 0; for (var k = 0; k < Math.min(this.numActions(), i); k++) { if (this.action(k)) { TpNow = TpNow + this.skillTpCost(this.action(k).item()); MpNow = MpNow + this.skillMpCost(this.action(k).item()); } } return oldList.filter(function(skill) { return this.canNowUse(skill.action, TpNow, MpNow); }, this); }; Game_Actor.prototype.getActionResult = function(skill, target) { var result; switch (this._strategy) { case Game_Actor.STRATEGY_BERSERKER: result = {}; result.damageTotal = 0; result.damageMax = target.hp; break; case Game_Actor.STRATEGY_HEALING_ALLIES: result = {}; result.HpRecovered = 0; result.HpRecoveredMax = skill.isDrain() ? Math.min(target.hp, this.mhp - this.hp) : target.mhp - target.hp; result.MpRecovered = 0; result.MpRecoveredMax = skill.isDrain() ? Math.min(target.mp, this.mmp - this.mp) : target.mmp - target.mp; result.stateRemoved = $dataStates.slice(1).map(function(state) { return 0; }); result.debuffRemoved = target._paramPlus.map(function(param, id) { return {levelUp:0, levelCurrent:-Math.min(target.buff(id),0)}; }); result.tensionRemoved = 0; result.tensionCurrent = (target._tension < 0 ? -DQM.Param.TensionListLevel.indexOf(String(Math.abs(target._tension))) : 0); break; case Game_Actor.STRATEGY_STRENGTHENING_ALLIES: result = {}; result.stateAdded = $dataStates.slice(1).map(function(state) { return 0; }); result.buffAdded = target._paramPlus.map(function(param, id) { return {levelUp:0, levelCurrent:2 - target.buff(id)}; }); result.tensionAdded = 0; result.tensionCurrent = DQM.Param.TensionListLevel.length - 1 - (target._tension < 0 ? -DQM.Param.TensionListLevel.indexOf(String(Math.abs(target._tension))) - 2 : DQM.Param.TensionListLevel.indexOf(String(Math.abs(target._tension)))); break; case Game_Actor.STRATEGY_REDUCE_ENEMY: result = {}; result.damageTotal = 0; result.damageMax = target.mp; result.stateAdded = $dataStates.slice(1).map(function(state) { return 0; }); result.stateRemoved = $dataStates.slice(1).map(function(state) { return 0; }); result.debuffAdded = target._paramPlus.map(function(param, id) { return {levelUp:0, levelCurrent:-target.buff(id)}; }); result.tensionRemoved = 0; result.tensionCurrent = -DQM.Param.TensionListLevel.length - 1 - (target._tension < 0 ? -DQM.Param.TensionListLevel.indexOf(String(Math.abs(target._tension))) - 2 : DQM.Param.TensionListLevel.indexOf(String(Math.abs(target._tension)))); break; case Game_Actor.STRATEGY_NO_USE_POINTS: result = 0; break; case Game_Actor.STRATEGY_DEFAULT: result = 0; break; default: result = 0; break; } if ((skill.isAttack() && this._strategy !== Game_Actor.STRATEGY_BERSERKER) || [Game_Actor.STRATEGY_NO_USE_POINTS, Game_Actor.STRATEGY_DEFAULT].contains(this._strategy)) { return result; } var value; switch (this._strategy) { case Game_Actor.STRATEGY_BERSERKER: value = skill.makeDamageValue(target, false); value = value * skill.itemHit(target) * (1 - skill.itemEva(target)); result.damageTotal = Math.min(result.damageTotal + value, result.damageMax); break; case Game_Actor.STRATEGY_HEALING_ALLIES: value = skill.makeDamageValue(target, false); value = value * skill.itemHit(target) * (1 - skill.itemEva(target)); if (skill.isHpEffect()) { result.HpRecovered = Math.min(result.HpRecovered + value, result.HpRecoveredMax); } else if (skill.isMpEffect()) { result.MpRecovered = Math.min(result.MpRecovered + value, result.MpRecoveredMax); } skill.item().effects.forEach(function(effect) { if (effect.code === Game_Action.EFFECT_RECOVER_HP) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= (target.mhp * effect.value1 + effect.value2) * target.rec; result.HpRecovered = Math.min(result.HpRecovered + value, result.HpRecoveredMax); } else if (effect.code === Game_Action.EFFECT_RECOVER_MP) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= (target.mmp * effect.value1 + effect.value2) * target.rec;; result.MpRecovered = Math.min(result.MpRecovered + value, result.MpRecoveredMax); } else if (effect.code === Game_Action.EFFECT_REMOVE_STATE) { if (target.isStateAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= effect.value1; result.stateRemoved[effect.dataId] += value; } } else if (effect.code === Game_Action.EFFECT_REMOVE_DEBUFF) { if (target.isDebuffAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= result.debuffRemoved[effect.dataId].levelCurrent; result.debuffRemoved[effect.dataId].levelUp = Math.min(result.debuffRemoved[effect.dataId].levelUp + value, result.debuffRemoved[effect.dataId].levelCurrent); } } else if (effect.code === Game_Action.EFFECT_ADD_BUFF) { if (target.isDebuffAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= Math.min(result.debuffRemoved[effect.dataId].levelCurrent, effect.value1); result.debuffRemoved[effect.dataId].levelUp = Math.min(result.debuffRemoved[effect.dataId].levelUp + value, result.debuffRemoved[effect.dataId].levelCurrent); } } else if (effect.code === Game_Action.EFFECT_TENSION_CHANGE) { if (target._tension < 0 && effect.value1 > 0) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= Math.min(result.tensionCurrent, effect.value1); result.tensionRemoved = Math.min(result.tensionRemoved + value, result.tensionCurrent); } } }, this); break; case Game_Actor.STRATEGY_STRENGTHENING_ALLIES: skill.item().effects.forEach(function(effect) { if (effect.code === Game_Action.EFFECT_ADD_STATE) { if (effect.dataId === 0) { this.attackStates().forEach(function(stateId) { if (!target.isStateAffected(stateId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= effect.value1; value *= target.stateRate(stateId); value *= this.attackStatesRate(stateId); value *= this.lukEffectRate(stateId); result.stateAdded[stateId] += value; } }); } else if (!target.isStateAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= effect.value1; if (!skill.isCertainHit()) { value *= target.stateRate(effect.dataId); value *= this.lukEffectRate(effect.dataId); } result.stateAdded[effect.dataId] += value; } } else if (effect.code === Game_Action.EFFECT_ADD_BUFF) { if (!target.MaxBuffAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= Math.min(result.buffAdded[effect.dataId].levelCurrent, effect.value1); result.buffAdded[effect.dataId].levelUp = Math.min(result.buffAdded[effect.dataId].levelUp + value, result.buffAdded[effect.dataId].levelCurrent); } } else if (effect.code === Game_Action.EFFECT_TENSION_CHANGE) { if (target._tension < Number(DQM.Param.TensionListLevel[DQM.Param.TensionListLevel.length - 1]) && effect.value1 > 0) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= Math.min(result.tensionCurrent, effect.value1); result.tensionAdded = Math.min(result.tensionAdded + value, result.tensionCurrent); } } }, this); break; case Game_Actor.STRATEGY_REDUCE_ENEMY: if (skill.isMpEffect() && !skill.isRecover()) { value = skill.makeDamageValue(target, false); value = value * skill.itemHit(target) * (1 - skill.itemEva(target)); result.damageTotal = Math.min(result.damageTotal + value, result.damageMax); } skill.item().effects.forEach(function(effect) { if (effect.code === Game_Action.EFFECT_REMOVE_STATE) { if (target.isStateAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= effect.value1; result.stateRemoved[effect.dataId] += value; } } else if (effect.code === Game_Action.EFFECT_ADD_STATE) { if (effect.dataId === 0) { this.attackStates().forEach(function(stateId) { if (!target.isStateAffected(stateId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= effect.value1; value *= target.stateRate(stateId); value *= this.attackStatesRate(stateId); value *= this.lukEffectRate(stateId); result.stateAdded[stateId] += value; } }); } else if (!target.isStateAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= effect.value1; if (!skill.isCertainHit()) { value *= target.stateRate(effect.dataId); value *= this.lukEffectRate(effect.dataId); } result.stateAdded[effect.dataId] += value; } } else if (effect.code === Game_Action.EFFECT_ADD_DEBUFF) { if (!target.MaxDebuffAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= target.debuffRate(effect.dataId) * this.lukEffectRate(target); value *= Math.min(result.debuffAdded[effect.dataId].levelCurrent, effect.value1); result.debuffAdded[effect.dataId].levelUp = Math.min(result.debuffAdded[effect.dataId].levelUp + value, result.debuffAdded[effect.dataId].levelCurrent); } } else if (effect.code === Game_Action.EFFECT_REMOVE_BUFF) { if (target.isBuffAffected(effect.dataId)) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= Math.min(target.buff(effect.dataId), 0); result.debuffAdded[effect.dataId].levelUp = Math.min(result.debuffAdded[effect.dataId].levelUp + value, result.buffAdded[effect.dataId].levelCurrent); } } else if (effect.code === Game_Action.EFFECT_TENSION_CHANGE) { if (target._tension > -Number(DQM.Param.TensionListLevel[DQM.Param.TensionListLevel.length - 1]) && effect.value1 < 0) { value = skill.itemHit(target) * (1 - skill.itemEva(target)); value *= Math.min(result.tensionCurrent, -effect.value1); result.tensionRemoved = Math.min(result.tensionRemoved + value, result.tensionCurrent); } } }, this); break; } return result; }; Game_Actor.prototype.defineWeightList = function(actionList) { var weightList = actionList.map(function(action) { return this.defineWeight(action); }, this); var newList = []; while (weightList.length > 0) { var newElement = weightList[0]; if (newElement.action.isForOne()) { newList.push(newElement); } else { var index = 0; while (index < newList.length && newList[index].action.item() !== newElement.action.item()) { index++; } if (index >= newList.length) { newList.push(newElement); } else { if (newElement.action.isForAll()) { newList[index].target = null; newList[index].weight += newElement.weight; } else { newList[index].target = null; newList[index].weight += newElement.weight * newElement.action.numTargets() / newElement.action.itemTargetCandidates().length; } } } weightList = weightList.slice(1); } return newList; }; Game_Actor.prototype.defineWeight = function(action) { var result = 0; switch (this._strategy) { case Game_Actor.STRATEGY_BERSERKER: result = action.value.damageTotal; break; case Game_Actor.STRATEGY_HEALING_ALLIES: result = action.value.HpRecovered + action.value.MpRecovered; result += action.value.stateRemoved.reduce(function(r, stateValue) { return r + (stateValue * action.target.mhp / 5); }, 0); result += action.value.debuffRemoved.reduce(function(r, debuff) { return r + (debuff.levelUp * action.target.mhp / 5); }, 0); result += action.value.tensionRemoved * action.target.mhp / 5; break; case Game_Actor.STRATEGY_STRENGTHENING_ALLIES: result = action.value.stateAdded.reduce(function(r, stateValue) { return r + (stateValue * action.target.mhp / 5); }, 0); result += action.value.buffAdded.reduce(function(r, buff) { return r + (buff.levelUp * action.target.mhp / 5); }, 0); result += action.value.tensionAdded * action.target.mhp / 5; break; case Game_Actor.STRATEGY_REDUCE_ENEMY: result = action.value.damageTotal; result += action.value.stateRemoved.reduce(function(r, stateValue) { return r + (stateValue * action.target.mhp / 5); }, 0); result += action.value.stateAdded.reduce(function(r, stateValue) { return r + (stateValue * action.target.mhp / 5); }, 0); result += action.value.debuffAdded.reduce(function(r, debuff) { return r + (debuff.levelUp * action.target.mhp / 5); }, 0); result += action.value.tensionRemoved * action.target.mhp / 5; break; default: if (!action.action.isAttack()) { result = 1; } } return {action:action.action, target:action.target, weight:result}; }; Game_Actor.prototype.defineDefaultList = function(list) { var skill = list.filter(function(skill) { return skill.isSkill() && skill.isAttack(); }, this)[0]; return skill.itemTargetCandidates().map(function(target) { var result = this.getActionResult(skill, target); return {action:skill, target:target, value:result}; }, this); }; Game_Actor.prototype.defineStrategyList = function(list) { var listSkill = list.filter(function(skill) { return this.isAdaptedToStrategy(skill); }, this); return listSkill.reduce(function(r, skill) { return r.concat(skill.itemTargetCandidates().map(function(target) { return {action:skill, target:target}; })); }, []).map(function(action) { var result = this.getActionResult(action.action, action.target); return {action:action.action, target:action.target, value:result}; }, this); }; Game_Actor.prototype.isAdaptedToStrategy = function(skill) { if (skill.isSkill() && skill.isAttack()) { return false; } switch (this._strategy) { case Game_Actor.STRATEGY_BERSERKER: return skill.isForOpponent() && skill.isHpEffect() && !skill.isRecover(); break; case Game_Actor.STRATEGY_HEALING_ALLIES: return (skill.isForFriend() && (skill.isRecover() || skill.item().effects.some(function(effect) { return effect.code === Game_Action.EFFECT_RECOVER_HP || effect.code === Game_Action.EFFECT_RECOVER_MP || effect.code === Game_Action.EFFECT_REMOVE_DEBUFF || effect.code === Game_Action.EFFECT_REMOVE_STATE || effect.code === Game_Action.EFFECT_ADD_BUFF || effect.code === Game_Action.EFFECT_TENSION_CHANGE; }))) || (skill.isForOpponent() && skill.isDrain()); break; case Game_Actor.STRATEGY_STRENGTHENING_ALLIES: return skill.isForFriend() && skill.item().effects.some(function(effect) { return effect.code === Game_Action.EFFECT_ADD_STATE || effect.code === Game_Action.EFFECT_ADD_BUFF || effect.code === Game_Action.EFFECT_TENSION_CHANGE; }); break; case Game_Actor.STRATEGY_REDUCE_ENEMY: return skill.isForOpponent() && ((skill.isMpEffect() && !skill.isRecover()) || skill.item().effects.some(function(effect) { return effect.code === Game_Action.EFFECT_ADD_STATE || effect.code === Game_Action.EFFECT_REMOVE_STATE || effect.code === Game_Action.EFFECT_REMOVE_BUFF || effect.code === Game_Action.EFFECT_ADD_DEBUFF || effect.code === Game_Action.EFFECT_TENSION_CHANGE; })); break; case Game_Actor.STRATEGY_NO_USE_POINTS: return this.skillTpCost(skill.item()) <= 0 && this.skillMpCost(skill.item()) <= 0; break; default: return true; break; }; }; Game_Actor.prototype.makeListResult = function(list) { var defaultList = this.defineDefaultList(list); var strategyList = this.defineStrategyList(list); return strategyList.concat(defaultList); }; Game_Actor.prototype.sortList = function(list) { var newList = this.defineWeightList(list); return newList.sort(function(a, b) { if (a.weight !== b.weight) { return b.weight - a.weight; } else if (a.action.isAttack()) { return -1; } else if (b.action.isAttack()) { return 1; } else { return Math.randomInt(3) - 1; } }); }; Game_Actor.prototype.applyResultToAction = function(action, newAction) { switch (this._strategy) { case Game_Actor.STRATEGY_BERSERKER: action.value.damageMax = Math.max(0, action.value.damageMax - newAction.value.damageTotal); action.value.damageTotal = Math.min(action.value.damageTotal, action.value.damageMax); break; case Game_Actor.STRATEGY_HEALING_ALLIES: action.value.HpRecoveredMax = Math.max(0, action.value.HpRecoveredMax - newAction.value.HpRecovered); action.value.MpRecoveredMax = Math.max(0, action.value.MpRecoveredMax - newAction.value.MpRecovered); action.value.HpRecovered = Math.min(action.value.HpRecovered, action.value.HpRecoveredMax); action.value.MpRecovered = Math.min(action.value.MpRecovered, action.value.MpRecoveredMax); action.value.stateRemoved = action.value.stateRemoved.map(function(stateValue, index) { return Math.max(0, stateValue - newAction.value.stateRemoved[index]); }); action.value.debuffRemoved = action.value.debuffRemoved.map(function(debuff, index) { debuff.levelCurrent = Math.max(0, debuff.levelCurrent - newAction.value.debuffRemoved[index].levelUp); debuff.levelUp = Math.min(debuff.levelUp, debuff.levelCurrent); return debuff; }); action.value.tensionCurrent = Math.max(0, action.value.tensionCurrent - newAction.value.tensionRemoved); action.value.tensionRemoved = Math.min(action.value.tensionRemoved, action.value.tensionCurrent); break; case Game_Actor.STRATEGY_STRENGTHENING_ALLIES: action.value.stateAdded = action.value.stateAdded.map(function(stateValue, index) { return Math.max(0, stateValue - newAction.value.stateAdded[index]); }); action.value.buffAdded = action.value.buffAdded.map(function(buff, index) { buff.levelCurrent = Math.max(0, buff.levelCurrent - newAction.value.buffAdded[index].levelUp); buff.levelUp = Math.min(buff.levelUp, buff.levelCurrent); return buff; }); action.value.tensionCurrent = Math.max(0, action.value.tensionCurrent - newAction.value.tensionAdded); action.value.tensionAdded = Math.min(action.value.tensionAdded, action.value.tensionCurrent); break; case Game_Actor.STRATEGY_REDUCE_ENEMY: action.value.damageMax = Math.max(0, action.value.damageMax - newAction.value.damageTotal); action.value.damageTotal = Math.min(action.value.damageTotal, action.value.damageMax); action.value.stateRemoved = action.value.stateRemoved.map(function(stateValue, index) { return Math.max(0, stateValue - newAction.value.stateRemoved[index]); }); action.value.stateAdded = action.value.stateAdded.map(function(stateValue, index) { return Math.max(0, stateValue - newAction.value.stateAdded[index]); }); action.value.debuffAdded = action.value.debuffAdded.map(function(debuff, index) { debuff.levelCurrent = Math.max(0, debuff.levelCurrent - newAction.value.debuffAdded[index].levelUp); debuff.levelUp = Math.min(debuff.levelUp, debuff.levelCurrent); return debuff; }); action.value.tensionCurrent = Math.max(0, action.value.tensionCurrent - newAction.value.tensionRemoved); action.value.tensionRemoved = Math.min(action.value.tensionRemoved, action.value.tensionCurrent); break; } return action; }; Game_Actor.prototype.applyResultToList = function(list, newResult) { var listToApply = list.filter(function(action) { return action.action.item() === newResult.action.item() && (!action.action.isForOne() || action.target === newResult.target); }); return list.map(function(action) { for (var k = 0; k < listToApply.length; k++) { if (listToApply[k].target === action.target) { return this.applyResultToAction(action, listToApply[k]); } } return action; }, this); }; Game_Actor.prototype.makeAutoBattleActions = function() { var list = this.makeActionList(); list = this.makeListResult(list); for (var i = 0; i < this.numActions(); i++) { var list = this.makeUsableList(list, i); var bestList = this.sortList(list); var index = Math.randomInt(Math.pow(2, bestList.length) - 1) + 1; var newResult = bestList[bestList.length - 1 - Math.floor(Math.log(index))]; this.setAction(i, newResult.action); this._actionInputIndex++; if (newResult.target) { this.action(i).setTarget(newResult.target.index()); } this.applyResultToList(list, newResult); } this.setActionState('waiting'); }; Game_Actor.prototype.setScreenSize = function() { var bitmap; if ($gameSystem.isSideView()) { bitmap = ImageManager.loadEnemy(this.battlerName(), this.battlerHue()); } else { bitmap = ImageManager.loadSvEnemy(this.battlerName(), this.battlerHue()); } Game_BattlerBase.prototype.setScreenSize.call(this, bitmap.width, bitmap.height); }; DQM.Core.Game_Actor_setBattlerImage = Game_Actor.prototype.setBattlerImage; Game_Actor.prototype.setBattlerImage = function(battlerName) { if (battlerName !== this._battlerName) { DQM.Core.Game_Actor_setBattlerImage.call(this, battlerName); this.setScreenSize(); } }; //============================================================================= // Game_Player //============================================================================= Game_Player.prototype.refresh = function() { var actor = DQM.Param.playerSprite; var characterName = actor ? actor.characterName : ''; var characterIndex = actor ? actor.characterIndex : 0; this.setImage(characterName, characterIndex); this._followers.refresh(); }; Game_Player.prototype.executeEncounter = function() { if (!$gameMap.isEventRunning() && this._encounterCount <= 0) { this.makeEncounterCount(); var troopId = this.makeEncounterTroopId(); if ($dataTroops[troopId]) { if (troopId !== DQM.Param.RandomTroopId || $gameTroop.generateCompleteList().length > 0) { BattleManager.setup(troopId, true, false); BattleManager.onEncounter(); return true; } else { return false; } } else { return false; } } else { return false; } }; //============================================================================= // Game_Followers //============================================================================= Game_Follower.prototype.refresh = function() { var characterName = ''; var characterIndex = 0; this.setImage(characterName, characterIndex); }; //============================================================================= // Game_Enemy //============================================================================= DQM.Core.Game_Enemy_InitMembers = Game_Enemy.prototype.initMembers; Game_Enemy.prototype.initMembers = function() { DQM.Core.Game_Enemy_InitMembers.apply(this); this._skillsets = []; this._level; this._skills = []; this._traits = []; }; DQM.Core.Game_Enemy_setup = Game_Enemy.prototype.setup; Game_Enemy.prototype.setup = function(enemyId, x, y) { DQM.Core.Game_Enemy_setup.call(this, enemyId, x, y); this.setScreenSize(); $gameSystem.addToMonsterBook(this.enemy().ClassId, false); }; Game_Enemy.prototype.currentClass = function() { return $dataClasses[this.enemy().ClassId]; }; Game_Enemy.prototype.maxLevel = function() { return Number(DQM.Param.valueChangeLevelMax[DQM.Param.valueChangeLevelMax.length - 1]); }; Game_Enemy.prototype.learnSkill = function(skillId) { if (!this.isLearned(skillId)) { this.addSkill(skillId); } }; Game_Enemy.prototype.hasAClass = function() { return this.enemy().ClassId && 0 < this.enemy().ClassId && this.enemy().ClassId < $dataClasses.length; }; DQM.Core.Game_Enemy_paramMax = Game_Enemy.prototype.paramMax; Game_Enemy.prototype.paramMax = function(paramId) { if (!this._level || !this.hasAClass()) { return DQM.Core.Game_Enemy_paramMax.call(this, paramId); } else { return this.currentClass().ParamMaxList[this.currentClass().ParamMaxList.length - 1].params[paramId]; } }; DQM.Core.Game_Enemy_paramMin = Game_Enemy.prototype.paramMin; Game_Enemy.prototype.paramMin = function(paramId) { if (!this._level || !this.hasAClass()) { return DQM.Core.Game_Enemy_paramMin.call(this, paramId); } else { return this.currentClass().params[paramId][0]; } }; DQM.Core.Game_Enemy_paramBase = Game_Enemy.prototype.paramBase; Game_Enemy.prototype.paramBase = function(paramId) { if (!this._level || !this.hasAClass()) { return DQM.Core.Game_Enemy_paramBase.call(this, paramId); } else { var paramMax = this.paramMax(paramId); var paramMin = this.paramMin(paramId); var nbrLevel = this.maxLevel(); return paramMin + Math.min(Math.floor((paramMax - paramMin) / (nbrLevel * DQM.Param.RateLevelEnemy / 100) * this._level), paramMax - paramMin); } }; Game_Enemy.prototype.isLearned = function(skillId) { return this.actions().filter(function(action) { return action.skillId === skillId; }).length > 0; }; Game_Enemy.prototype.actions = function() { if (!this._level || !this.hasAClass()) { return this.enemy().actions; } else { var List1 = this._skills.concat({"conditionParam1":0,"conditionParam2":0,"conditionType":0,"rating":5,"skillId":this.attackSkillId()}); var List2 = this.AttributeGainSkillUsability().filter(function(action) { return List1.every(function(oldAction) { return oldAction.skillId !== action.id; }); }).map(function(action) { return {"conditionParam1":0,"conditionParam2":0,"conditionType":0,"rating":5,"skillId":action.id}; }); return List1.concat(List2); } }; Game_Enemy.prototype.makeActions = function() { Game_Battler.prototype.makeActions.call(this); if (this.numActions() > 0) { var actionList = this.actions().filter(function(a) { return this.isActionValid(a); }, this); if (actionList.length > 0) { this.selectAllActions(actionList); } } this.setActionState('waiting'); }; Game_Enemy.prototype.addSkill = function(skillId) { this._skills.push({"conditionParam1":0,"conditionParam2":0,"conditionType":0,"rating":5,"skillId":skillId}); }; Game_Enemy.prototype.getAbsorbElementValue = function(elementId) { if (!this.hasAClass()) { return 0; } return this.currentClass().absorbElement[elementId]; }; Game_Enemy.prototype.GroupClassId = function() { if (!this.hasAClass()) { return 0; } return this.currentClass().GroupClassId; }; Game_Enemy.prototype.GroupClass = function() { return DQM.Param.GroupClassList[this.GroupClassId()]; }; Game_Enemy.prototype.SizeClass = function() { if (!this.hasAClass()) { return 0; } return this.currentClass().SizeClass; }; Game_Enemy.prototype.SizeClassDescription = function() { return DQM.Param.SizeClassList[this.SizeClass()]; }; Game_Enemy.prototype.SizeClassIcon = function() { return DQM.Param.SizeClassIcon[this.SizeClass()]; }; Game_Enemy.prototype.RankClassId = function() { if (!this.hasAClass()) { return 0; } return this.currentClass().RankClassId; }; Game_Enemy.prototype.RankClass = function() { if (!this.hasAClass()) { return 0; } return DQM.Param.RankClassList[this.RankClassId()]; }; Game_Enemy.prototype.MaxSkillSetSlots = function() { return this.SizeClass() + 2; }; Game_Enemy.prototype.SkillSetSlotUsed = function() { return this._skillsets.length; }; Game_Enemy.prototype.SkillSetSlotId = function(SlotId) { return this._skillsets[SlotId].id; }; Game_Enemy.prototype.CurrentJobPoints = function(SlotId) { return this._skillsets[SlotId].jobPoints; }; Game_Enemy.prototype.GetSkillSetData = function(SlotId) { return $gameSkillset._data[this.SkillSetSlotId(SlotId)]; }; Game_Enemy.prototype.GetNameSlot = function(SlotId) { return this.GetSkillSetData(SlotId).name; }; Game_Enemy.prototype.GetDescSlot = function(SlotId) { return this.GetSkillSetData(SlotId).desc; }; Game_Enemy.prototype.GetListSlot = function(SlotId) { return this.GetSkillSetData(SlotId).list; }; Game_Enemy.prototype.MaxJobPointsSlot = function(SlotId) { return this.GetListSlot(SlotId).length - 1; }; DQM.Core.Game_Enemy_traitObject = Game_Enemy.prototype.traitObject; Game_Enemy.prototype.traitObject = function() { if (!this.hasAClass()) { return DQM.Core.Game_Enemy_traitObject.call(this); } return DQM.Core.Game_Enemy_traitObject.call(this).concat([this.currentClass()]); }; DQM.Core.Game_Enemy_exp = Game_Enemy.prototype.exp; Game_Enemy.prototype.exp = function() { var defaultValue = DQM.Core.Game_Enemy_exp.call(this); if ($gameParty.inBattle()) { if (this._level) { defaultValue = Math.floor(defaultValue * this.mhp / this.enemy().params[0]); } var MultiplyBonus = 100; var AddedBonus = 0; $gameParty.members().forEach(function(actor) { MultiplyBonus = actor.AttributeBonusAfterMath(2).reduce(function(r, attribute) { return r + attribute.value1; }, MultiplyBonus); AddedBonus = actor.AttributeBonusAfterMath(2).reduce(function(r, attribute) { return r + attribute.value2; }, AddedBonus); }); defaultValue = defaultValue * MultiplyBonus / 100; defaultValue = defaultValue + AddedBonus; } return Math.floor(defaultValue); }; DQM.Core.Game_Enemy_gold = Game_Enemy.prototype.gold; Game_Enemy.prototype.gold = function() { var defaultValue = DQM.Core.Game_Enemy_gold.call(this); if ($gameParty.inBattle()) { if (this._level) { defaultValue = Math.floor(defaultValue * this.mhp / this.enemy().params[0]); } var MultiplyBonus = 100; var AddedBonus = 0; $gameParty.members().forEach(function(actor) { MultiplyBonus = actor.AttributeBonusAfterMath(1).reduce(function(r, attribute) { return r + attribute.value1; }, MultiplyBonus); AddedBonus = actor.AttributeBonusAfterMath(1).reduce(function(r, attribute) { return r + attribute.value2; }, AddedBonus); }); defaultValue = defaultValue * MultiplyBonus / 100; defaultValue = defaultValue + AddedBonus; } return Math.floor(defaultValue); }; DQM.Core.Game_Enemy_dropItemRate = Game_Enemy.prototype.dropItemRate; Game_Enemy.prototype.dropItemRate = function() { var defaultValue = DQM.Core.Game_Enemy_dropItemRate.call(this); if ($gameParty.inBattle()) { if (this._level) { defaultValue = defaultValue * this.mhp / this.enemy().params[0]; } var MultiplyBonus = 100; var AddedBonus = 0; $gameParty.members().forEach(function(actor) { MultiplyBonus = actor.AttributeBonusAfterMath(3).reduce(function(r, attribute) { return r + attribute.value1; }, MultiplyBonus); AddedBonus = actor.AttributeBonusAfterMath(3).reduce(function(r, attribute) { return r + attribute.value2; }, AddedBonus); }); defaultValue = defaultValue * MultiplyBonus / 100; defaultValue = defaultValue + AddedBonus; } return Math.floor(defaultValue); }; Game_Enemy.prototype.setScreenSize = function() { if (this.battlerName() && this.battlerHue()) { var bitmap; if ($gameSystem.isSideView()) { bitmap = ImageManager.loadEnemy(this.battlerName(), this.battlerHue()); } else { bitmap = ImageManager.loadSvEnemy(this.battlerName(), this.battlerHue()); } Game_BattlerBase.prototype.setScreenSize.call(this, bitmap.width, bitmap.height); } }; Game_Enemy.prototype.getListTroopException = function() { var firstList = $gamePlayer.regionId() !== 0 ? ($dataMap.troopExceptions[$gamePlayer.regionId()] || []) : []; return firstList.concat($dataMap.troopExceptions[0]).map(function(troopId) { return Number(troopId); }); }; Game_Enemy.prototype.skillsetGeneratedRandomly = function() { return $dataMap.randomSkillset.some(function(regionId) { return [0,$gamePlayer.regionId()].contains(Number(regionId)); }); }; Game_Enemy.prototype.attributeGeneratedRandomly = function() { return $dataMap.randomAttributes.some(function(regionId) { return [0,$gamePlayer.regionId()].contains(Number(regionId)); }); }; Game_Enemy.prototype.setMapDatas = function() { if ($dataMap || !this.hasAClass()) { var listTroopException = this.getListTroopException(); if (!listTroopException.contains($gameTroop._troopId)) { this.setLevel(); if (this.skillsetGeneratedRandomly()) { this.generateSkillsets(); } else { this.setSkillsets(); } if (this.attributeGeneratedRandomly()) { this.generateAttributes(); } else { this.setAttributes(); } } else { this.setAttributesDefault(); } this.recoverAll(); } }; Game_Enemy.prototype.generateSkillsets = function() { var list = this.getNewSkillsetList(); var maxValue; var newValue; for (var k = 0; k < list.length; k++) { maxValue = $gameSkillset._data[list[k]].list.length - 1; newValue = Math.min(Math.floor(maxValue * this._level / (this.maxLevel() * DQM.Param.RateSkillsetsEnemy / 100)), maxValue); this.addSkillset(list[k], newValue); } }; Game_Enemy.prototype.generateAttributes = function() { this.setAttributesDefault(); this.setRandomAttributeSup(); }; Game_Enemy.prototype.skillsetDefaultIsAutomaticallyAdded = function() { if (!$dataMap) { return false; } return $dataMap.skillsetDefaultAutomatic.every(function(regionId) { return Number(regionId) !== $gamePlayer.regionId() && Number(regionId) !== 0; }); }; Game_Enemy.prototype.getSkillsetListExcluded = function() { var regionId = $gamePlayer.regionId(); var firstList = regionId !== 0 ? ($dataMap.skillsetExcluded[regionId] || []) : []; return firstList.concat($dataMap.skillsetExcluded[0]).map(function(skillsetId) { return Number(skillsetId); }); }; Game_Enemy.prototype.getNewSkillsetList = function() { var list = $gameSkillset.UsableList().map(function(skillset) { return skillset.id; }); if ($dataMap && this.getSkillsetListExcluded().length > 0) { list = list.filter(function(skillsetId) { return !this.getSkillsetListExcluded().contains(Number(skillsetId)); }, this); } var randomList = []; if (this.skillsetDefaultIsAutomaticallyAdded() && this.hasAClass()) { randomList.push(this.currentClass().SkillSetDefault); list = list.filter(function(skillsetId) { return skillsetId !== randomList[0]; }); } if (list.length + randomList.length <= this.MaxSkillSetSlots()) { return randomList.concat(list); } else { var k; while (randomList.length <= this.MaxSkillSetSlots()) { k = Math.randomInt(list.length); if (!randomList.contains(list[k])) { randomList.push(list[k]); } } return randomList; } }; Game_Enemy.prototype.getIndexById = function() { return $gameTroop._enemies.filter(function(enemyTest) { return enemyTest.originalName() === this.originalName(); }, this).indexOf(this); }; Game_Enemy.prototype.getLevelMin = function() { var firstList = $dataMap.levelMin.filter(function(detail) { return detail.regionSet.some(function(regionId) { return Number(regionId) === $gamePlayer.regionId(); }); }); if (firstList.length > 0) { return firstList[0].levelMin; } firstList = $dataMap.levelMin.filter(function(detail) { return detail.regionSet.length < 1; }); if (firstList.length > 0) { return firstList[0].levelMin; } }; Game_Enemy.prototype.setLevel = function() { var troopId = $gameTroop._troopId; var memberId = this.getIndexById(); var listLevel = this.getAdditionalDatas(troopId, memberId, 1); var levelMin = this.getLevelMin(); if (listLevel.length > 0 || levelMin) { this._level = listLevel.length > 0 ? Math.max(listLevel[0].value, levelMin || 1) : levelMin; if (this.hasAClass()) { this.currentClass().learnings.forEach(function(learning) { if (learning.level <= this._level) { this.learnSkill(learning.skillId); } }, this); } } }; Game_Enemy.prototype.setRandomResistancesSup = function() { var list = this.hasAClass() ? this.currentClass().resistSynthesisUp.sort(function(a,b) { return a.levelSynthesis - b.levelSynthesis; }) : []; for (var k = 0; k < Math.min(Math.floor(list.length * this._level / (this.maxLevel() * DQM.Param.RateResistancesEnemy / 100)), list.length); k++) { this.addNewTraitWithId(list[k].code, list[k].dataId, list[k].value); } }; Game_Enemy.prototype.getSkillsetMin = function() { for (var k = 0; k < $dataMap.skillsetMin.length; k++) { if ($dataMap.skillsetMin[k] && $dataMap.skillsetMin[k].length > 0 && $dataMap.skillsetMin[k].some(function(regionId) { return Number(regionId) !== 0 && Number(regionId) === $gamePlayer.regionId(); })) { return k; } } for (var k = 0; k < $dataMap.skillsetMin.length; k++) { if ($dataMap.skillsetMin[k] && $dataMap.skillsetMin[k].length > 0 && $dataMap.skillsetMin[k].some(function(regionId) { return Number(regionId) === 0; })) { return k; } } }; Game_Enemy.prototype.setSkillsets = function() { var troopId = $gameTroop._troopId; var memberId = this.getIndexById(); var listLevel = this.getAdditionalDatas(troopId, memberId, 2); var firstList = []; for (var k = 0; k < listLevel.length; k++) { if (firstList.length < 1 || firstList.every(function(detail) { return detail.idDetail !== listLevel[k].idDetail; })) { firstList.push(listLevel[k]); } } var skillsetMin = this.getSkillsetMin(); if ($dataMap && skillsetMin && firstList.length < skillsetMin) { var list = this.getNewSkillsetList(); var maxValue; var newValue; var k = 0; while (k < list.length && firstList.length < skillsetMin) { if (firstList.length < 1 || firstList.every(function(detail) { return detail.idDetail !== Number(list[k]); })) { maxValue = $gameSkillset._data[list[k]].list.length - 1; newValue = Math.min(Math.floor(maxValue * this._level / (this.maxLevel() * DQM.Param.RateSkillsetsEnemy / 100)), maxValue); firstList.push({"idDetail":list[k], "value":newValue}); } k++; } } for (var k = 0; k < firstList.length; k++) { this.addSkillset(firstList[k].idDetail, Math.min(firstList[k].value, $gameSkillset._data[firstList[k].idDetail].list.length - 1)); } }; Game_Enemy.prototype.setAttributes = function() { this.setAttributesDefault(); var troopId = $gameTroop._troopId; var memberId = this.getIndexById(); var listLevel = this.getAdditionalDatas(troopId, memberId, 3); for (var k = 0; k < listLevel; k++) { this.addAttribute(listLevel[k].idDetail, false); } }; Game_Enemy.prototype.setAttributesDefault = function() { var list = this.hasAClass() ? this.currentClass().AttributeList.filter(function(attribute) { return attribute.levelSynthesis === 0 && attribute.particularConditions.length < 1; }).sort(function(a,b) { if (a.particularConditions.length > 0 || b.particularConditions.length > 0) { return a.particularConditions.length - b.particularConditions.length; } else { return a.levelSynthesis - b.levelSynthesis; } }) : []; for (var k = 0; k < list.length; k++) { this.addAttribute(list[k].attributeId, false); } }; Game_Enemy.prototype.setRandomAttributeSup = function() { var list = this.hasAClass() ? this.currentClass().AttributeList.filter(function(attribute) { return !(attribute.levelSynthesis === 0 && attribute.particularConditions.length < 1); }) : []; for (var k = 0; k < Math.min(Math.floor(list.length * this._level / (this.maxLevel() * DQM.Param.RateAttributesEnemy / 100)), list.length); k++) { this.addAttribute(list[k].attributeId, false); } }; Game_Enemy.prototype.addSkillset = function(skillsetId, jobPoints) { var NewSlot = Math.min(this._skillsets.length, this.MaxSkillSetSlots()-1); if (NewSlot === this._skillsets.length) { this._skillsets[NewSlot] = {}; this._skillsets[NewSlot].id = skillsetId; this._skillsets[NewSlot].jobPoints = 0; this.AddJobPointsToSkillSet(NewSlot, jobPoints); } }; Game_Enemy.prototype.AddJobPointsToSkillSet = function(SlotId, JobPoints) { var previousResult = this.CurrentJobPoints(SlotId); this._skillsets[SlotId].jobPoints = previousResult + JobPoints; var ListBonus = this.GetListSlot(SlotId).filter(function(List) { return List.level > previousResult && List.level <= previousResult + JobPoints; }); for (var l = 0; l < ListBonus.length; l++) { var BonusList = ListBonus[l]; for (var k = 0; k < BonusList.skillObtained.length; k++) { this.learnSkill(BonusList.skillObtained[k]); } for (var k = 0; k < BonusList.paramBonus.length; k++) { if (BonusList.paramBonus[k] > 0) { this.addParam(k, BonusList.paramBonus[k]); } } for (var k = 0; k < BonusList.stateResist.length; k++) { this.addNewTraitWithId(this.TRAIT_STATE_RATE, BonusList.stateResist[k].stateId, (100 - BonusList.stateResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.elementResist.length; k++) { this.addNewTraitWithId(this.TRAIT_ELEMENT_RATE, BonusList.elementResist[k].elementId, (100 - BonusList.elementResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.debuffResist.length; k++) { this.addNewTraitWithId(this.TRAIT_DEBUFF_RATE, BonusList.debuffResist[k].debuffId, (100 - BonusList.debuffResist[k].BonusValue)/100); }; for (var k = 0; k < BonusList.attributeObtained.length; k++) { this.addAttribute(BonusList.attributeObtained[k], true); }; }; }; Game_Enemy.prototype.addAttribute = function(attributeId, isSkillset) { if (isSkillset || (this.hasAClass() && this.currentClass().AttributeList.some(function(attribute) { return attribute.attributeId === attributeId; }))) { if (this._attributes.every(function(attributeIdOld) { return attributeIdOld.attributeId !== attributeId; })) { this._attributes.push({"attributeId":attributeId, "bySkillset":isSkillset}); } } }; Game_Enemy.prototype.getAdditionalDatas = function(troopId, memberId, codeDetail) { var firstList = $dataMap.detailsMonster.filter(function(detail) { return (detail.enemyId === this._enemyId && detail.codeDetail === codeDetail && detail.troopId === troopId && detail.memberId === memberId && detail.regionSet.some(function(regionId) { return Number(regionId) === $gamePlayer.regionId(); })); }, this); var addList = $dataMap.detailsMonster.filter(function(detail) { return (detail.enemyId === this._enemyId && detail.codeDetail === codeDetail && detail.troopId === troopId && detail.memberId === 0 && detail.regionSet.some(function(regionId) { return Number(regionId) === $gamePlayer.regionId(); }) && firstList.every(function(detailOld) { return (detailOld.codeDetail !== detail.codeDetail || detailOld.idDetail !== detail.idDetail); })); }, this); firstList = firstList.concat(addList); addList = $dataMap.detailsMonster.filter(function(detail) { return (detail.enemyId === this._enemyId && detail.codeDetail === codeDetail && detail.troopId === 0 && detail.memberId === 0 && detail.regionSet.some(function(regionId) { return Number(regionId) === $gamePlayer.regionId(); }) && firstList.every(function(detailOld) { return (detailOld.codeDetail !== detail.codeDetail || detailOld.idDetail !== detail.idDetail); })); }, this); firstList = firstList.concat(addList); addList = $dataMap.detailsMonster.filter(function(detail) { return (detail.enemyId === 0 && detail.codeDetail === codeDetail && detail.troopId === troopId && detail.memberId === 0 && detail.regionSet.some(function(regionId) { return Number(regionId) === $gamePlayer.regionId(); }) && firstList.every(function(detailOld) { return (detailOld.codeDetail !== detail.codeDetail || detailOld.idDetail !== detail.idDetail); })); }, this); addList = $dataMap.detailsMonster.filter(function(detail) { return (detail.enemyId === this._enemyId && detail.codeDetail === codeDetail && detail.troopId === troopId && detail.memberId === memberId && detail.regionSet.length < 1 && firstList.every(function(detailOld) { return (detailOld.codeDetail !== detail.codeDetail || detailOld.idDetail !== detail.idDetail); })); }, this); firstList = firstList.concat(addList); addList = $dataMap.detailsMonster.filter(function(detail) { return (detail.enemyId === this._enemyId && detail.codeDetail === codeDetail && detail.troopId === troopId && detail.memberId === 0 && detail.regionSet.length < 1 && firstList.every(function(detailOld) { return (detailOld.codeDetail !== detail.codeDetail || detailOld.idDetail !== detail.idDetail); })); }, this); firstList = firstList.concat(addList); addList = $dataMap.detailsMonster.filter(function(detail) { return (detail.enemyId === this._enemyId && detail.codeDetail === codeDetail && detail.troopId === 0 && detail.memberId === 0 && detail.regionSet.length < 1 && firstList.every(function(detailOld) { return (detailOld.codeDetail !== detail.codeDetail || detailOld.idDetail !== detail.idDetail); })); }, this); firstList = firstList.concat(addList); addList = $dataMap.detailsMonster.filter(function(detail) { return (detail.enemyId === 0 && detail.codeDetail === codeDetail && detail.troopId === troopId && detail.memberId === 0 && detail.regionSet.length < 1 && firstList.every(function(detailOld) { return (detailOld.codeDetail !== detail.codeDetail || detailOld.idDetail !== detail.idDetail); })); }, this); return firstList.concat(addList); }; //============================================================================= // Game_Unit //============================================================================= Game_Unit.prototype.battleMembers = function() { return this.members(); }; Game_Unit.prototype.getWidthTeam = function() { if ($gameSystem.isSideView()) { return this.battleMembers().reduce(function(r, member, i) { return (Math.max(0, member._screenWidth - r + (32 * i))) + r; }, 0); } else { return this.battleMembers().reduce(function(r, member) { return r + member._screenWidth; }, 0); } }; Game_Unit.prototype.getHeightTeam = function() { if ($gameSystem.isSideView()) { return this.battleMembers().reduce(function(r, member, i) { return (Math.max(0, member._screenHeight - r + (24 * i))) + r; }, 0); } else { return this.battleMembers().reduce(function(r, member) { return Math.max(member._screenHeight, r); }, 0); } }; Game_Unit.prototype.getScaleMin = function() { var width = this.getWidthTeam(); var height = this.getHeightTeam(); var scaleW = Graphics.boxwidth / width; var scaleH = Graphics.boxheight / height; if ($gameSystem.isSideView()) { scaleW = scaleW / 2; } return Math.min(scaleW, Math.min(scaleH, 1)); }; //============================================================================= // Game_Party //============================================================================= DQM.Core.Game_Party_battleMembers = Game_Party.prototype.battleMembers; Game_Party.prototype.battleMembers = function() { var FirstList = DQM.Core.Game_Party_battleMembers.call(this); for (var n = 0; n < this.maxBattleMembers(); n++) { var CurrentSize = 0; for (var i = 0; i < FirstList.length; i++) { CurrentSize = CurrentSize + FirstList[i].SizeClass(); } if (CurrentSize > this.maxBattleMembers()) { FirstList.pop(); } } return FirstList; }; DQM.Core.Game_Party_maxBattleMembers = Game_Party.prototype.maxBattleMembers; Game_Party.prototype.maxBattleMembers = function() { return $gameSystem._maxSizeTeam; }; Game_Party.prototype.name = function() { return TextManager.partyName.format(this._namePlayer); }; Game_Party.prototype.SetEnemyAsActor = function(Enemy) { var newIndex = 1; while (newIndex < $dataActors.length && ($dataActors[newIndex] || $dataActors[newIndex] != undefined)) { newIndex++; } var Class = Enemy.currentClass(); var EnemyData = Enemy.enemy(); var skillsets = Enemy._skillsets.map(function(skillset) { return [skillset.id, 0]; }); var jobPoints = DQM.Param.ValueJobPoint.filter(function(value, id) { return Number(DQM.Param.LevelJobPoint[id]) <= Enemy._level; }).reduce(function(r, value) { return r + Number(value); }, 0); var realLevel = Class.params[0].filter(function(hp) { return hp <= Enemy.mhp; }).length; $dataActors[newIndex] = this.initActor(); $dataActors[newIndex].id = newIndex; $dataActors[newIndex].battlerName = Enemy.battlerName(); $dataActors[newIndex].characterName = Class.characterName; $dataActors[newIndex].characterIndex = Class.characterIndex; $dataActors[newIndex].faceName = Class.faceName; $dataActors[newIndex].faceIndex = Class.faceIndex; $dataActors[newIndex].classId = EnemyData.ClassId; $dataActors[newIndex].name = Enemy.originalName(); $dataActors[newIndex].nickname = Class.name; $dataActors[newIndex].profile = Class.Profile; $dataActors[newIndex].initialLevel = Math.min(realLevel, Number(DQM.Param.valueChangeLevelMax[0])); $dataActors[newIndex].Skillsets = skillsets; $dataActors[newIndex].JobPoints = jobPoints; $dataActors[newIndex].monster = true; New_Actor = Object.create(Game_Actor.prototype); New_Actor.initMembers(); New_Actor.setup(newIndex); $gameActors._data[newIndex] = New_Actor; $gameParty.addActor(newIndex); return newIndex; }; Game_Party.prototype.initActor = function() { return DQM.Param.ActorBasis; }; Game_Party.prototype.SetNewActorBySynthesis = function(classId, ActorId1, ActorId2, skillsets) { var newIndex = 1; while (newIndex < $dataActors.length && ($dataActors[newIndex] || $dataActors[newIndex] != undefined)) { newIndex++; } var Class = $dataClasses[classId]; var Actor1 = this.members()[ActorId1]; var Actor2 = this.members()[ActorId2]; $dataActors[newIndex] = this.initActor(); $dataActors[newIndex].id = newIndex; $dataActors[newIndex].battlerName = Class.name; $dataActors[newIndex].characterName = Class.characterName; $dataActors[newIndex].characterIndex = Class.characterIndex; $dataActors[newIndex].faceName = Class.faceName; $dataActors[newIndex].faceIndex = Class.faceIndex; $dataActors[newIndex].classId = classId; $dataActors[newIndex].initialLevel = 1; $dataActors[newIndex].name = Class.name; $dataActors[newIndex].nickname = Class.name; $dataActors[newIndex].profile = Class.Profile; $dataActors[newIndex].Skillsets = skillsets.map(function(skillset) { return [skillset.id, skillset.jobPoints]; }); $dataActors[newIndex].JobPoints = Math.floor((Actor1._jobPoints + Actor2._jobPoints) * DQM.Param.RateSynthesisJobPointsFree / 100); $dataActors[newIndex].monster = true; var New_Actor = Object.create(Game_Actor.prototype); New_Actor.initMembers(); New_Actor.setup(newIndex, Actor1, Actor2); $gameActors._data[newIndex] = New_Actor; return newIndex; }; Game_Party.prototype.suppressActor = function(actor) { var newIndex = $gameActors._data.indexOf(actor); actor.clearEquipments(); $gameParty.removeActor(newIndex); $gameActors._data[newIndex] = undefined; var realIndex = actor._actorId; $dataActors[realIndex] = undefined; }; Game_Party.prototype.canAddNewActor = function() { return this.sizeTeam(this.stockageId()) + 1 <= this.maxStockagePlace(); }; DQM.Core.Game_Party_addActor = Game_Party.prototype.addActor; Game_Party.prototype.addActor = function(actorId) { if (!this._actors.contains(actorId)) { DQM.Core.Game_Party_addActor.call(this, actorId); var actor = $gameActors.actor(actorId); var sizeActor = actor.SizeClass(); var k = 0; while ((this.sizeTeam(k) + sizeActor > this.maxBattleMembers()) && (k < this.stockageId())) { k++; } actor._index = (k === this.stockageId() ? this.maxStockagePlace() : this.maxBattleMembers()); actor._teamIndex = k; this.swapOrder(actor._teamIndex, actor._index, actor._teamIndex, this.sizeTeam(actor._teamIndex) - sizeActor); this.sortMembers(); $gamePlayer.refresh(); $gameMap.requestRefresh(); } }; DQM.Core.Game_Party_setupStartingMembers = Game_Party.prototype.setupStartingMembers; Game_Party.prototype.setupStartingMembers = function() { DQM.Core.Game_Party_setupStartingMembers.call(this); for (var l = 0; l < this._actors.length; l++) { var actor = $gameActors.actor(this._actors[l]); var sizeActor = actor.SizeClass(); var k = 0; while ((this.sizeTeam(k) + sizeActor > this.maxBattleMembers()) && (k < this.stockageId())) { k++; } actor._index = (k === this.stockageId() ? this.maxStockagePlace() : this.maxBattleMembers()); actor._teamIndex = k; this.swapOrder(actor._teamIndex, actor._index, actor._teamIndex, this.sizeTeam(actor._teamIndex) - sizeActor); } this.sortMembers(); $gamePlayer.refresh(); $gameMap.requestRefresh(); }; DQM.Core.Game_Party_removeActor = Game_Party.prototype.removeActor; Game_Party.prototype.removeActor = function(actorId) { if (this._actors.contains(actorId)) { DQM.Core.Game_Party_removeActor.call(this, actorId); var actor = $gameActors.actor(actorId); actor._teamIndex = -1; actor._index = 0; this.sortMembers(); $gamePlayer.refresh(); $gameMap.requestRefresh(); } }; Game_Party.prototype.sortMembers = function() { this._actors = this._actors.sort(function(a,b) { var actora = $gameActors.actor(a); var actorb = $gameActors.actor(b); if (actora._teamIndex !== actorb._teamIndex) { return actora._teamIndex - actorb._teamIndex; } else { return actora._index - actorb._index; } }); for (var k = 0; k < this.sizeTeam(this.stockageId()); k++) { this.team(this.stockageId())[k]._index = k; if ($gameSystem._maxSupplementaryTeam !== -1) { this.team(this.stockageId())[k].recoverAll(); } } }; Game_Party.prototype.members = function() { return this.inBattle() ? this.battleMembers() : (!$gameParty._allMembers ? this.allMapMembers() : this.allMembers()); }; Game_Party.prototype.allMembers = function() { var actorList = this._actors.filter(function(actorId) { return ($gameActors.actor(actorId)._teamIndex !== -1); }); return actorList.map(function(actorId) { return $gameActors.actor(actorId); }); }; Game_Party.prototype.allMapMembers = function() { if ($gameSystem._maxSupplementaryTeam === -1) { return this.allMembers(); } else { var list = []; for (var k = 0; k <= $gameSystem._maxSupplementaryTeam; k++) { list = list.concat(this.team(k)); } return list; } }; Game_Party.prototype.battleMembers = function() { return this.team(0).filter(function(actor) { return actor.isAppeared(); }); }; Game_Party.prototype.sizeTeam = function(id) { if (id !== this.stockageId()) { return this.team(id).reduce(function(r, actor) { return r + actor.SizeClass(); }, 0); } else { return this.team(id).length; } }; Game_Party.prototype.stockageId = function() { return Math.max(1, $gameSystem._maxSupplementaryTeam + 1); }; Game_Party.prototype.maxStockagePlace = function() { if ($gameSystem._maxBattlers !== 0) { return Math.min(this.sizeTeam(this.stockageId()) + 1, $gameSystem._maxBattlers); } else { return this.sizeTeam(this.stockageId()) + 1; } }; Game_Party.prototype.team = function(id) { var actorList = this._actors.filter(function(actorId) { return ($gameActors.actor(actorId)._teamIndex === id); }); return actorList.map(function(actorId) { return $gameActors.actor(actorId); }); }; Game_Party.prototype.swapOrder = function(teamIndex1, index1, teamIndex2, index2) { if (teamIndex1 !== teamIndex2 || index1 !== index2) { var actorList = this.allMembers().filter(function(actor) { return (actor._teamIndex === teamIndex1 && actor._index === index1) || (actor._teamIndex === teamIndex2 && actor._index === index2); }); if (actorList.length > 0) { if (actorList[0]._teamIndex === teamIndex2 && actorList[0]._index === index2 && actorList.length === 1) { this.swapOrder(teamIndex2, index2, teamIndex1, index1); } else { if (teamIndex1 === teamIndex2) { this.changeOrder(teamIndex1, index1, index2); } else if (teamIndex1 === this.stockageId()) { this.addInTeam(index1, teamIndex2, index2); } else if (teamIndex2 === this.stockageId()) { this.addInStockage(teamIndex1, index1, index2); } else { this.exchangeTeam(teamIndex1, index1, teamIndex2, index2); } this.sortMembers(); } } } }; Game_Party.prototype.changeOrder = function(teamIndex, index1, index2) { var actorToMove = this.team(teamIndex).filter(function(actor) { return actor._index === index1; })[0]; actorToMove._index = Math.min(index2, teamIndex === this.stockageId() ? index2 : this.maxBattleMembers() - actorToMove.SizeClass()); var actorList = this.team(teamIndex).filter(function(actor) { if (actor === actorToMove) { return false; } if (teamIndex === this.stockageId()) { return actor._index === actorToMove._index; } if (actor._index < actorToMove._index) { return actor._index + actor.SizeClass() > actorToMove._index; } if (actor._index >= actorToMove._index) { return actorToMove._index + actorToMove.SizeClass() > actor._index; } }, this).sort(function(a, b) { return b.SizeClass() - a.SizeClass(); }); var oldIndex = actorList.map(function(actor) { return actor._index; }); for (var k = 0; k < actorList.length; k++) { actorList[k]._index = -1; } for (var k = 0; k < actorList.length; k++) { if (teamIndex === this.stockageId()) { actorList[k]._index = index1; } else { var size = actorList[k].SizeClass(); for (var l = 0; l < this.maxBattleMembers() + 1 - size; l++) { if (this.team(teamIndex).every(function(actor) { return (actor._index > l + size - 1) || (actor._index + actor.SizeClass() - 1 < l || actor._index === -1); })) { actorList[k]._index = l; l = this.maxBattleMembers(); } } } } if (actorList.some(function(actor) { return actor._index === -1; })) { for (var k = 0; k < actorList.length; k++) { actorList[k]._index = oldIndex[k]; } actorToMove._index = index1; } }; Game_Party.prototype.addInTeam = function(indexStockage, teamIndex, index) { var actorToMove = this.team(this.stockageId()).filter(function(actor) { return actor._index === indexStockage; })[0]; actorToMove._teamIndex = teamIndex; actorToMove._index = Math.min(index, this.maxBattleMembers() - actorToMove.SizeClass()); var actorList = this.team(teamIndex).filter(function(actor) { if (actor === actorToMove) { return false; } if (actor._index < actorToMove._index) { return actor._index + actor.SizeClass() > actorToMove._index; } if (actor._index >= actorToMove._index) { return actorToMove._index + actorToMove.SizeClass() > actor._index; } }); for (var k = 0; k < actorList.length; k++) { for (var l = 0; l < this.maxStockagePlace(); l++) { if (this.team(this.stockageId()).filter(function(actor) { return actor._index === l; }).length < 1) { this.addInStockage(actorList[k]._teamIndex, actorList[k]._index, l); l = this.maxStockagePlace(); } } } }; Game_Party.prototype.addInStockage = function(teamIndex, index, indexStockage) { var actorToMove = this.team(teamIndex).filter(function(actor) { return actor._index === index; })[0]; var actorList = this.team(this.stockageId()).filter(function(actor) { if (actor === actorToMove) { return false; } return actor._index === indexStockage; }); for (var k = 0; k < actorList.length; k++) { this.addInTeam(actorList[k]._index, teamIndex, index); } actorToMove._teamIndex = this.stockageId(); actorToMove._index = indexStockage; }; Game_Party.prototype.exchangeTeam = function(teamIndex1, index1, teamIndex2, index2) { var actorToMove = this.team(teamIndex1).filter(function(actor) { return actor._index === index1; })[0]; actorToMove._teamIndex = teamIndex2; actorToMove._index = Math.min(index2, this.maxBattleMembers() - actorToMove.SizeClass()); var actorList = this.team(teamIndex2).filter(function(actor) { if (actor === actorToMove) { return false; } if (actor._index < actorToMove._index) { return actor._index + actor.SizeClass() > actorToMove._index; } if (actor._index >= actorToMove._index) { return actorToMove._index + actorToMove.SizeClass() > actor._index; } }); var sizeTot = actorList.reduce(function(r, actor) { return r + actor.SizeClass(); }, 0); if (sizeTot <= actorToMove.SizeClass()) { var realIndex = index1; for (var k = 0; k < actorList.length; k++) { actorList[k]._teamIndex = teamIndex1; actorList[k]._index = realIndex; realIndex = realIndex + actorList[k].SizeClass(); } } else { var newActorList = this.team(teamIndex1); var newIndexList = newActorList.map(function(actor) { return actor._index; }); var departIndex = this.maxBattleMembers() - this.sizeTeam(teamIndex1); for (var k = 0; k < newActorList.length; k++) { var actorMoved = newActorList[k]; actorMoved._index = departIndex; departIndex = departIndex + actorMoved.SizeClass(); } departIndex = this.maxBattleMembers() - this.sizeTeam(teamIndex1); if (sizeTot <= departIndex) { var realIndex = 0; for (var k = 0; k < actorList.length; k++) { actorList[k]._teamIndex = teamIndex1; actorList[k]._index = realIndex; realIndex = realIndex + actorList[k].SizeClass(); } } else { var actorToMoveList = []; var sizeMoved = 0; var isTried = false; while (sizeMoved + departIndex < sizeTot && !isTried) { var firstTry = this.team(teamIndex1).filter(function(actor) { return actor.SizeClass() === (sizeTot - sizeMoved - departIndex && !actorToMoveList.contains(actor)); }); if (firstTry.length > 0) { firstTry = firstTry.sort(function(a,b) { return Math.abs(a._index - index1) - Math.abs(b._index - index1); }); actorToMoveList.push(firstTry[0]); sizeMoved = sizeMoved + firstTry[0].SizeClass(); } else { var secondTry = this.team(teamIndex1).filter(function(actor) { return actor.SizeClass() < (sizeTot - sizeMoved - departIndex && !actorToMoveList.contains(actor)); }); if (secondTry.length > 0) { secondTry = secondTry.sort(function(a,b) { return Math.abs(a._index - index1) - Math.abs(b._index - index1); }); actorToMoveList.push(secondTry[0]); sizeMoved = sizeMoved + secondTry[0].SizeClass(); } else { isTried = true; } } } if (sizeMoved + actorToMove.SizeClass() < sizeTot) { actorToMove._teamIndex = teamIndex1; actorToMove._index = index1; for (var k = 0; k < newActorList.length; k++) { newActorList[k]._index = newIndexList[k]; } } else { for (var k = 0; k < actorToMoveList.length; k++) { var size = actorToMoveList[k].SizeClass(); for (var l = 0; l < this.maxBattleMembers() + 1 - size; l++) { if (this.team(teamIndex2).every(function(actor) { return (actor._index > l + size - 1) || (actor._index + actor.SizeClass() - 1 < l) || actorToMoveList.contains(actor); })) { actorToMoveList[k]._index = l; actorToMoveList[k]._teamIndex = teamIndex2; l = this.maxBattleMembers(); } } } for (var k = 0; k < actorList.length; k++) { var size = actorList[k].SizeClass(); for (var l = 0; l < this.maxBattleMembers() + 1 - size; l++) { if (this.team(teamIndex1).every(function(actor) { return (actor._index > l + size - 1) || (actor._index + actor.SizeClass() - 1 < l); })) { actorList[k]._index = l; actorList[k]._teamIndex = teamIndex1; l = this.maxBattleMembers(); } } } } } } }; //============================================================================= // Game_Troop //============================================================================= DQM.Core.Game_Troop_setup = Game_Troop.prototype.setup; Game_Troop.prototype.setup = function(troopId) { if (troopId === DQM.Param.RandomTroopId) { this.generateRandomTroop(); } DQM.Core.Game_Troop_setup.call(this, troopId); }; Game_Troop.prototype.getMaxMembers = function() { for (var k = 0; k < $dataMap.maxEnemies.length; k++) { if ($dataMap.maxEnemies[k] && $dataMap.maxEnemies[k].length > 0 && $dataMap.maxEnemies[k].some(function(regionId) { return Number(regionId) !== 0 && Number(regionId) === $gamePlayer.regionId(); })) { return k; } } for (var k = 0; k < $dataMap.maxEnemies.length; k++) { if ($dataMap.maxEnemies[k] && $dataMap.maxEnemies[k].length > 0 && $dataMap.maxEnemies[k].some(function(regionId) { return Number(regionId) === 0; })) { return k; } } }; Game_Troop.prototype.generateRandomTroop = function() { this.resetRandomTroop(); var sizeTroop = 0; var completeList = this.generateCompleteList(); var testList; var indexEnemy; var newId; var sizeTeam = $gameParty.maxBattleMembers(); var maxMembers = this.getMaxMembers() || sizeTeam; while (sizeTroop < sizeTeam && $dataTroops[DQM.Param.RandomTroopId].members.length < maxMembers) { testList = this.filterListMember(completeList, sizeTeam - sizeTroop); if (testList.length > 0) { indexEnemy = Math.randomInt(testList.length); newId = testList[indexEnemy].id; this.generateNewMember(newId); sizeTroop = sizeTroop + $dataClasses[testList[indexEnemy].ClassId].SizeClass; } else { sizeTroop = sizeTeam; } } }; Game_Troop.prototype.filterListMember = function(completeList, maxSize) { return completeList.filter(function(enemy) { return $dataClasses[enemy.ClassId].SizeClass <= maxSize; }); }; Game_Troop.prototype.generateNewMember = function(enemyId) { var newEnemy = {}; newEnemy.enemyId = enemyId; newEnemy.x = 0; newEnemy.y = 0; newEnemy.hidden = false; $dataTroops[DQM.Param.RandomTroopId].members.push(newEnemy); }; Game_Troop.prototype.getListEncounterRandomId = function() { var regionId = $gamePlayer.regionId(); var firstList = regionId !== 0 ? ($dataMap.encounterRandomConditions[regionId].idList || []) : []; var defaultList = $dataMap.encounterRandomConditions[0].idList || []; if (firstList.length < 1) { return defaultList; } else { return firstList.filter(function(id) { return defaultList.length < 1 || defaultList.some(function(idGeneral) { return Number(idGeneral) === Number(id); }); }); } }; Game_Troop.prototype.getListEncounterRandomGroup = function() { var regionId = $gamePlayer.regionId(); var firstList = regionId !== 0 ? ($dataMap.encounterRandomConditions[regionId].groupClass || []) : []; var defaultList = $dataMap.encounterRandomConditions[0].groupClass || []; if (firstList.length < 1) { return defaultList; } else { return firstList.filter(function(id) { return defaultList.length < 1 || defaultList.some(function(idGeneral) { return Number(idGeneral) === Number(id); }); }); } }; Game_Troop.prototype.getListEncounterRandomSize = function() { var regionId = $gamePlayer.regionId(); var firstList = regionId !== 0 ? ($dataMap.encounterRandomConditions[regionId].sizeClass || []) : []; var defaultList = $dataMap.encounterRandomConditions[0].sizeClass || []; if (firstList.length < 1) { return defaultList; } else { return firstList.filter(function(id) { return defaultList.length < 1 || defaultList.some(function(idGeneral) { return Number(idGeneral) === Number(id); }); }); } }; Game_Troop.prototype.getListEncounterRandomRank = function() { var regionId = $gamePlayer.regionId(); var firstList = regionId !== 0 ? ($dataMap.encounterRandomConditions[regionId].rankClass || []) : []; var defaultList = $dataMap.encounterRandomConditions[0].rankClass || []; if (firstList.length < 1) { return defaultList; } else { return firstList.filter(function(id) { return defaultList.length < 1 || defaultList.some(function(idGeneral) { return Number(idGeneral) === Number(id); }); }); } }; Game_Troop.prototype.getOnlyEncounteredConditions = function() { var regionId = $gamePlayer.regionId(); var firstSwitch = regionId !== 0 ? ($dataMap.encounterRandomConditions[regionId].onlyEncountered || false) : false; var defaultSwitch = $dataMap.encounterRandomConditions[0].onlyEncountered || false; return firstSwitch || defaultSwitch; }; Game_Troop.prototype.generateCompleteList = function() { var list = $dataEnemies.filter(function(enemy) { return enemy; }); var idList = this.getListEncounterRandomId(); var groupList = this.getListEncounterRandomGroup(); var sizeList = this.getListEncounterRandomSize(); var rankList = this.getListEncounterRandomRank(); var onlyEncountered = this.getOnlyEncounteredConditions(); if (idList.length > 0) { list = list.filter(function(enemy) { return idList.some(function(id) { return Number(id) === enemy.ClassId; }); }); } if (groupList.length > 0) { list = list.filter(function(enemy) { return groupList.some(function(groupId) { return Number(groupId) === $dataClasses[enemy.ClassId].GroupClassId; }); }); } if (sizeList.length > 0) { list = list.filter(function(enemy) { return sizeList.some(function(size) { return Number(size) === $dataClasses[enemy.ClassId].SizeClass; }); }); } if (rankList.length > 0) { list = list.filter(function(enemy) { return rankList.some(function(rankId) { return Number(rankId) === $dataClasses[enemy.ClassId].RankClassId; }); }); } if (onlyEncountered) { list = list.filter(function(enemy) { return $gameSystem.isInMonsterBook($dataClasses[enemy.ClassId]); }); } return list; }; Game_Troop.prototype.resetRandomTroop = function() { $dataTroops[DQM.Param.RandomTroopId].members = []; }; Game_Troop.prototype.battleMembers = function() { return this.members().filter(function(member) { return !member._hidden; }); }; Game_Troop.prototype.setMapDatas = function() { if ($dataMap) { this.members().forEach(function(member) { member.setMapDatas(); }); } }; //============================================================================= // Game_Map //============================================================================= //============================================================================= // Game_Action //============================================================================= Game_Action.EFFECT_TENSION_CHANGE = 101; Game_Action.EFFECT_RECRUIT = 102; Game_Action.EFFECT_JOB_POINTS_UP = 103; Game_Action.EFFECT_ADD_SKILLSET = 104; Game_Action.EFFECT_RISE_UP_DAMAGE_GROUP = 105; Game_Action.EFFECT_RISE_UP_DAMAGE_SIZE = 106; Game_Action.EFFECT_RISE_UP_DAMAGE_RANK = 107; Game_Action.EFFECT_RISE_UP_DAMAGE_ATTRIBUTE = 108; Game_Action.EFFECT_RESET_TENSION = 109; Game_Action.prototype.initialize = function(subject, forcing, byAttribute) { this._subjectActorId = 0; this._subjectEnemyIndex = -1; this._forcing = forcing || false; this.byAttribute = byAttribute || false; this.setSubject(subject); this.clear(); }; Game_Action.prototype.itemPrf = function(target) { if (this.isPhysical()) { return target.prf; } else { return 0; } }; Game_Action.prototype.setRecruit = function() { this.setSkill(this.subject().attackRecruitId()); }; Game_Action.prototype.setTension = function() { this.setSkill(this.subject().tensionId()); }; DQM.Core.Game_Action_numRepeats = Game_Action.prototype.numRepeats; Game_Action.prototype.numRepeats = function() { var defaultValue = DQM.Core.Game_Action_numRepeats.call(this); if (this.isSkill() && this.isPhysical()) { return defaultValue * this.subject().AttributeMultiplyHit(); } else { return defaultValue; } }; Game_Action.prototype.makeDamageValue = function(target, critical) { var item = this.item(); if (critical && DQM.Param.CriticalEffectApplication) { this.subject()._critical = true; } this.subject()._isSubject = true; this.subject()._isPhysical = this.isPhysical() && this.isSkill(); var baseValue = this.evalDamageFormula(target); var value = baseValue * this.calcElementRate(target); if (this.isPhysical()) { value *= target.pdr; } if (this.isMagical()) { value *= target.mdr; } if (baseValue < 0) { value *= target.rec; } value = this.applyVariance(value, item.damage.variance); value = this.applyGuard(value, target); if (!DQM.Param.CriticalEffectApplication && critical) { value = this.applyCritical(value); } value = Math.round(value); var subject = this.subject(); var ListBonusValue = subject.AttributeChangeDamageValue(); var Bonus; var MultiplyBonus = 100; var AddedBonus = 0; for (var k = 0; k < ListBonusValue.length; k++) { Bonus = ListBonusValue[k]; if (Bonus.type === 1 && target.GroupClassId() === Bonus.id) { MultiplyBonus = MultiplyBonus + Bonus.value1; AddedBonus = AddedBonus + Bonus.value2; } else if (Bonus.type === 2 && target.SizeClass() === Bonus.id) { MultiplyBonus = MultiplyBonus + Bonus.value1; AddedBonus = AddedBonus + Bonus.value2; } else if (Bonus.type === 3 && target.RankClassId() === Bonus.id) { MultiplyBonus = MultiplyBonus + Bonus.value1; AddedBonus = AddedBonus + Bonus.value2; } else if (Bonus.type === 4 && target.attributes().contains($gameAttributes[Bonus.id])) { MultiplyBonus = MultiplyBonus + Bonus.value1; AddedBonus = AddedBonus + Bonus.value2; } else if (Bonus.type === 5 && this.isSkill()) { if (this.item().damage.elementId === Bonus.id || Bonus.id === 0) { MultiplyBonus = MultiplyBonus + Bonus.value1; AddedBonus = AddedBonus + Bonus.value2; } } else if (Bonus.type === 6 && this.isSkill()) { if (this.item().hitType === Bonus.id) { MultiplyBonus = MultiplyBonus + Bonus.value1; AddedBonus = AddedBonus + Bonus.value2; } } else if (Bonus.type === 7 && this.isSkill()) { if (this.item().damage.type === Bonus.id) { MultiplyBonus = MultiplyBonus + Bonus.value1; AddedBonus = AddedBonus + Bonus.value2; } } else if (Bonus.type === 8 && false) { MultiplyBonus = MultiplyBonus + Bonus.value1; AddedBonus = AddedBonus + Bonus.value2; } } var effect; for (var k = 0; k < this.item().effects.length; k++) { effect = this.item().effects[k]; if (effect.code === Game_Action.EFFECT_RISE_UP_DAMAGE_GROUP && effect.dataId === target.GroupClassId()) { MultiplyBonus = MultiplyBonus + effect.value1; AddedBonus = AddedBonus + effect.value2; } else if (effect.code === Game_Action.EFFECT_RISE_UP_DAMAGE_SIZE && effect.dataId === target.SizeClass()) { MultiplyBonus = MultiplyBonus + effect.value1; AddedBonus = AddedBonus + effect.value2; } else if (effect.code === Game_Action.EFFECT_RISE_UP_DAMAGE_RANK && effect.dataId === target.RankClassId()) { MultiplyBonus = MultiplyBonus + effect.value1; AddedBonus = AddedBonus + effect.value2; } else if (effect.code === Game_Action.EFFECT_RISE_UP_DAMAGE_ATTRIBUTE && target.attributes().contains($gameAttributes[effect.dataId])) { MultiplyBonus = MultiplyBonus + effect.value1; AddedBonus = AddedBonus + effect.value2; } } value = value * MultiplyBonus / 100; value = value + AddedBonus; value = value * this.calcAbsorbRate(target); return Math.round(value); }; Game_Action.prototype.applyCritical = function(damage) { return damage * DQM.Param.RateCriticalEffect / 100; }; Game_Action.prototype.calcAbsorbRate = function(target) { if (this.item().damage.elementId < 0) { return this.AbsorbMaxRate(target, this.subject().attackElements()); } else { var value = target.getAbsorbElementValue(this.item().damage.elementId) / 100; if (value === 0) { return 1; } else { return -value; } } }; Game_Action.prototype.AbsorbMaxRate = function(target, elements) { if (elements.length > 0) { var result = Math.max.apply(null, elements.map(function(elementId) { return target.getAbsorbElementValue(elementId) / 100; }, this)); if (result > 0) { return -result; } else { return 1; } } else { return 1; } }; DQM.Core.Game_Action_applyItemEffect = Game_Action.prototype.applyItemEffect; Game_Action.prototype.applyItemEffect = function(target, effect) { switch (effect.code) { case Game_Action.EFFECT_TENSION_CHANGE: this.itemEffectTensionChange(target, effect); break; case Game_Action.EFFECT_RECRUIT: this.itemEffectRecruit(target, effect); break; case Game_Action.EFFECT_JOB_POINTS_UP: this.itemEffectAddJobPoints(target, effect); break; case Game_Action.EFFECT_ADD_SKILLSET: this.itemEffectAddNewSkillset(target, effect); break; case Game_Action.EFFECT_RESET_TENSION: this.itemEffectResetTension(target, effect); break; default: DQM.Core.Game_Action_applyItemEffect.call(this, target, effect); break; } }; DQM.Core.Game_Action_testItemEffect = Game_Action.prototype.testItemEffect; Game_Action.prototype.testItemEffect = function(target, effect) { switch (effect.code) { case Game_Action.EFFECT_TENSION_CHANGE: var valMax = Number(DQM.Param.TensionListLevel[DQM.Param.TensionListLevel.length - 1]); return (effect.value1 !== 0 && ((target._tension !== valMax && effect.value1 > 0) || (target._tension !== -valMax && effect.value1 < 0))); case Game_Action.EFFECT_JOB_POINTS_UP: return target.isActor() && (target.JobPointsUsable() < target.MaxJobPoints()); case Game_Action.EFFECT_ADD_SKILLSET: return target.isActor() && !target._skillsets.some(function(skillset) { return skillset.id === effect.dataId; }); case Game_Action.EFFECT_RESET_TENSION: return (target._tension * effect.value1) > 0; default: return DQM.Core.Game_Action_testItemEffect.call(this, target, effect); } }; Game_Action.prototype.itemEffectAddJobPoints = function(target, effect) { target.GainJobPoints(effect.value1); }; Game_Action.prototype.itemEffectAddNewSkillset = function(target, effect) { target.AddSkillSet(effect.dataId, 0); }; DQM.Core.Game_Action_apply = Game_Action.prototype.apply; Game_Action.prototype.apply = function(target) { DQM.Core.Game_Action_apply.call(this, target); if ((this.item().damage.type > 0) && (BattleManager._targets.length === 0)) { this.subject()._tensionToReset = true; } if (this.subject()._critical) { this.subject()._critical = false; } this.subject()._isSubject = false; this.subject()._isPhysical = false; }; Game_Action.prototype.itemEffectTensionChange = function(target, effect) { target.result()._TensionAffected = true; target._tensionToReset = false; var newLevel = effect.value1; const oldValue = target._tension; target.TensionUp(newLevel); target.result()._levelTensionChange = target.getChangeTensionLevel(oldValue); this.makeSuccess(target); }; Game_Action.prototype.itemEffectResetTension = function(target, effect) { if (target._tension * effect.value1 > 0) { target.TensionReset(); } }; Game_Action.prototype.itemEffectRecruit = function(target) { target.result().critical = (Math.random() < this.itemCri(target)); target.result()._recruitGaugeUp = this.makeDamageValue(target, target.result().critical); target.result()._recruitGaugeUp = target.result()._recruitGaugeUp / $gameSystem.getRecruitSuccessCount(target.enemy().ClassId); var MultiplyBonus = this.subject().AttributeRecruitChanceUp().reduce(function(r, attribute) { return r + attribute.value1; }, 100); var AddedBonus = this.subject().AttributeRecruitChanceUp().reduce(function(r, attribute) { return r + attribute.value2; }, 0); target.result()._recruitGaugeUp = target.result()._recruitGaugeUp * MultiplyBonus / 100; target.result()._recruitGaugeUp = target.result()._recruitGaugeUp + AddedBonus; target.result()._recruitGaugeUp = Math.floor(target.result()._recruitGaugeUp); this.makeSuccess(target); }; DQM.Core.Game_Action_checkItemScope = Game_Action.prototype.checkItemScope; Game_Action.prototype.checkItemScope = function(list) { if (this.isSkill() && this._item._itemId !== DQM.Param.RecruitId) { var BonusList = this.subject().AttributeSubstituteTarget(); var result = BonusList.some(function(attribute) { return attribute.type === this.item().hitType; }, this); if (result && [1, 3, 7, 9].contains(this.item().scope)) { if ([1, 3].contains(this.item().scope)) { return list.contains(2); } else if ([7, 9].contains(this.item().scope)) { return list.contains(8); } } else { return DQM.Core.Game_Action_checkItemScope.call(this, list); } } else { return DQM.Core.Game_Action_checkItemScope.call(this, list); } }; DQM.Core.Game_Action_calcElementRate = Game_Action.prototype.calcElementRate; Game_Action.prototype.calcElementRate = function(target) { var defaultValue = DQM.Core.Game_Action_calcElementRate.call(this, target); if (this.isSkill() && (this.calcAbsorbRate(target) >= 0)) { var MultiplyBonus = 100; this.friendsUnit().aliveMembers().forEach(function(battler) { MultiplyBonus = battler.AttributeReduceResistanceEnemy(1, 0).reduce(function(r, attribute) { return r + MultiplyBonus; }, MultiplyBonus); if (this.item().damage.elementId !== 0) { MultiplyBonus = battler.AttributeReduceResistanceEnemy(1, this.item().damage.elementId).reduce(function(r, attribute) { return r + MultiplyBonus; }, MultiplyBonus); } }, this); defaultValue = defaultValue * MultiplyBonus / 100; } return defaultValue; }; DQM.Core.Game_Action_makeTargets = Game_Action.prototype.makeTargets; Game_Action.prototype.makeTargets = function() { var targets = []; if (!this._forcing && this.subject().isConfused() && this.isForOpponent() && this.isForAll()) { targets = this.targetsForOpponents(); } else { targets = DQM.Core.Game_Action_makeTargets.call(this); } return this.repeatTargets(targets); }; //============================================================================= // Game_ActionResult //============================================================================= DQM.Core.Game_ActionResult_clear = Game_ActionResult.prototype.clear; Game_ActionResult.prototype.clear = function() { DQM.Core.Game_ActionResult_clear.call(this); this._TensionAffected = false; this._levelTensionChange = 0; this._recruitGaugeUp = 0; }; Game_ActionResult.prototype.isTensionAffected = function() { return this._TensionAffected; }; //============================================================================= // Game_Character //============================================================================= //============================================================================= // Game_System //============================================================================= DQM.Core.Game_System_initialize = Game_System.prototype.initialize; Game_System.prototype.initialize = function() { DQM.Core.Game_System_initialize.call(this); this.clearAttributeBook(); this.clearMonsterBook(); this.clearSkillSetBook(); }; Game_System.prototype.addToSkillsetBook = function(SkillSetId) { if (!this._skillSetBookFlags) { this.clearSkillSetBook(); } if (!this.isInSkillSetBook($gameSkillset._data[SkillSetId])) { this._skillSetBookFlags[SkillSetId] = this._skillSetBookFlags[SkillSetId] || {}; this._skillSetBookFlags[SkillSetId].isDiscovered = true; this._skillSetBookFlags[SkillSetId].LevelMax = 0; } }; Game_System.prototype.removeFromSkillsetBook = function(SkillSetId) { if (!this._skillSetBookFlags) { this.clearSkillSetBook(); } if (this.isInSkillSetBook($gameSkillset._data[SkillSetId])) { this._skillSetBookFlags[SkillSetId] = this._skillSetBookFlags[SkillSetId] || {}; this._skillSetBookFlags[SkillSetId].isDiscovered = false; this._skillSetBookFlags[SkillSetId].LevelMax = 0; } }; Game_System.prototype.updateLevelMax = function(SkillSetId, NewLevel) { if (this.isInSkillSetBook($gameSkillset._data[SkillSetId])) { if (this._skillSetBookFlags[SkillSetId].LevelMax <= NewLevel) { this._skillSetBookFlags[SkillSetId].LevelMax = NewLevel.clamp(0, $gameSkillset._data[SkillSetId].list[$gameSkillset._data[SkillSetId].list.length-1].level); } } }; Game_System.prototype.completeSkillSetBook = function() { if (!this._skillSetBookFlags) { this.clearSkillSetBook(); } for (var i = 1; i < $gameSkillset._data.length; i++) { this._skillSetBookFlags[i] = this._skillSetBookFlags[i] || {}; this._skillSetBookFlags[i].isDiscovered = true; this._skillSetBookFlags[i].LevelMax = $gameSkillset._data[i].list[$gameSkillset._data[i].list.length-1].level; } }; Game_System.prototype.clearSkillSetBook = function() { this._skillSetBookFlags = []; for (var i = 1; i < $gameSkillset._data.length; i++) { this._skillSetBookFlags[i] = this._skillSetBookFlags[i] || {}; this._skillSetBookFlags[i].isDiscovered = false; this._skillSetBookFlags[i].LevelMax = 0; } }; Game_System.prototype.isInSkillSetBook = function(SkillSet) { if (this._skillSetBookFlags && SkillSet && this._skillSetBookFlags[SkillSet.id]) { return !!this._skillSetBookFlags[SkillSet.id].isDiscovered; } else { return false; } }; Game_System.prototype.addToAttributeBook = function(AttributeId, ClassId) { if (!this._attributeBookFlags) { this.clearAttributeBook(); } if (!this.isInAttributeBook($gameAttributes._data[AttributeId])) { this._attributeBookFlags[AttributeId] = this._attributeBookFlags[AttributeId] || {"isDiscovered":false, "DiscoveredList":[]}; this._attributeBookFlags[AttributeId].isDiscovered = true; } if (ClassId) { this.addToAttributeDiscoveredList(AttributeId, ClassId); } }; Game_System.prototype.addToAttributeDiscoveredList = function(AttributeId, ClassId) { if (!this._attributeBookFlags) { this.clearAttributeBook(); } if (!this.isInAttributeBook($gameAttributes._data[AttributeId])) { this._attributeBookFlags[AttributeId] = this._attributeBookFlags[AttributeId] || {"isDiscovered":false, "DiscoveredList":[]}; } if (!this.ClassIsAddedToAttributeDiscoveredList($gameAttributes._data[AttributeId], $dataClasses[ClassId])) { this._attributeBookFlags[AttributeId].DiscoveredList.push(ClassId); } }; Game_System.prototype.ClassIsAddedToAttributeDiscoveredList = function(Attribute, Class) { if (this.isInAttributeBook(Attribute) && Class) { return this._attributeBookFlags[Attribute.id].DiscoveredList.contains(Class.id); } else { return false; } }; Game_System.prototype.removeFromAttributeBook = function(AttributeId) { if (!this._attributeBookFlags) { this.clearAttributeBook(); } if (this.isInAttributeBook($gameAttributes._data[AttributeId])) { this._attributeBookFlags[AttributeId] = this._attributeBookFlags[AttributeId] || {"isDiscovered":false, "DiscoveredList":[]}; this._attributeBookFlags[AttributeId].isDiscovered = false; } }; Game_System.prototype.completeAttributeBook = function() { if (!this._attributeBookFlags) { this.clearAttributeBook(); } for (var i = 1; i < $gameAttributes._data.length; i++) { this._attributeBookFlags[i] = this._attributeBookFlags[i] || {"isDiscovered":false, "DiscoveredList":[]}; this._attributeBookFlags[i].isDiscovered = true; this._attributeBookFlags[i].DiscoveredList = $dataClasses.filter(function(classData) { if (!classData || !classData.AttributeList || (classData.AttributeList.length < 1)) { return false; } else { return classData.AttributeList.map(function(attribute) { return attribute.AttributeId; }).contains(i); } }).map(function(classData) { return classData.id; }); } }; Game_System.prototype.clearAttributeBook = function() { this._attributeBookFlags = []; for (var i = 1; i < $gameAttributes._data.length; i++) { this._attributeBookFlags[i] = this._attributeBookFlags[i] || {"isDiscovered":false, "DiscoveredList":[]}; this._attributeBookFlags[i].isDiscovered = false; this._attributeBookFlags[i].DiscoveredList = []; } }; Game_System.prototype.isInAttributeBook = function(Attribute) { if (this._attributeBookFlags && Attribute && this._attributeBookFlags[Attribute.id]) { return !!this._attributeBookFlags[Attribute.id].isDiscovered; } else { return false; } }; Game_System.prototype.addToMonsterBook = function(ClassId, isAsActor, levelReached) { if (!this._monsterBookFlags) { this.clearMonsterBook(); } if (!this.isInMonsterBook($dataClasses[ClassId])) { this._monsterBookFlags[ClassId] = this._monsterBookFlags[ClassId] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; this._monsterBookFlags[ClassId].isDiscovered = true; } if (!this._monsterBookFlags[ClassId].isAsActor) { this._monsterBookFlags[ClassId].isAsActor = isAsActor; } if (levelReached && levelReached > this._monsterBookFlags[ClassId].levelReached) { this._monsterBookFlags[ClassId].levelReached = levelReached; } }; Game_System.prototype.removeFromMonsterBook = function(ClassId) { if (!this._monsterBookFlags) { this.clearMonsterBook(); } if (this.isInMonsterBook($dataClasses[ClassId])) { this._monsterBookFlags[ClassId] = this._monsterBookFlags[ClassId] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; this._monsterBookFlags[ClassId].isDiscovered = false; } }; Game_System.prototype.completeMonsterBook = function() { if (!this._monsterBookFlags) { this.clearMonsterBook(); } for (var i = 1; i < $dataClasses.length; i++) { this._monsterBookFlags[i] = this._monsterBookFlags[i] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; this._monsterBookFlags[i].isDiscovered = true; this._monsterBookFlags[i].isAsActor = true; this._monsterBookFlags[i].levelReached = Number(DQM.Param.valueChangeLevelMax[DQM.Param.valueChangeLevelMax.length - 1]); for (var k = 0; k < $dataClasses[i].AttributeList.length; k++) { this.addToAttributeBook($dataClasses[i].AttributeList[k].attributeId, i); } } /*this.completeLocationInfos();*/ this.completeSynthesisInfos(); }; /* Game_System.prototype.completeLocationInfos = function() { var noteA = /<(?:MONSTER)[ ]([0-9]+)[ ](?:IN THIS ZONE HAS LEVEL)[ ]([0-9]+)(?:[ ](?:IN TROOP)[ ]([0-9]+)(?:[ ](?:FOR MEMBER)[ ]([0-9]+))?)?>/i; var noteD = /<(?:CAN GENERATE RANDOM TROOP IN THIS ZONE)>/i; var noteE = /<(?:ALL MONSTERS IN THIS ZONE HAS MINIMUM LEVEL)[ ]([0-9]+)>/i; var noteG = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST HAVE THE ID)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteH = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST HAVE THE RANK)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteI = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST HAVE THE SIZE)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteJ = /<(?:MONSTERS SELECTED IN RANDOM TROOP MUST BE IN THE GROUP)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteK = /<(?:DON'T APPLY LEVEL AND SKILLSET GENERATION FOR TROOP)[ ]([0-9]+)>/i; var noteO = /<(?:ALL MONSTERS OF TROOP)[ ]([0-9]+)[ ](?:IN THIS ZONE HAS MINIMUM LEVEL)[ ]([0-9]+)>/i; var noteQ = /<(?:MONSTER)[ ]([0-9]+)[ ](?:IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS LEVEL)[ ]([0-9]+)(?:[ ](?:IN TROOP)[ ]([0-9]+)(?:[ ](?:FOR MEMBER)[ ]([0-9]+))?)?>/i; var noteT = /<(?:CAN GENERATE RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteU = /<(?:ALL MONSTERS IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS MINIMUM LEVEL)[ ]([0-9]+)>/i; var noteW = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST HAVE THE ID)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteX = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST HAVE THE RANK)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteY = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST HAVE THE SIZE)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteZ = /<(?:MONSTERS SELECTED IN RANDOM TROOP IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:MUST BE IN THE GROUP)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))>/i; var noteAA = /<(?:DON'T APPLY LEVEL AND SKILLSET GENERATION IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:FOR TROOP)[ ]([0-9]+)>/i; var noteAE = /<(?:ALL MONSTERS OF TROOP)[ ]([0-9]+)[ ](?:IN REGIONS)[ ]((?:(?:[0-9]+)[,])*(?:[0-9]+))[ ](?:HAS MINIMUM LEVEL)[ ]([0-9]+)>/i; var $dataMapTemp = null; for (var k = 1; k < $dataMapInfos.length; k++) { if ($dataMapInfos[k].id > 0) { var filename = 'Map%1.json'.format($dataMapInfos[k].id.padZero(3)); DataManager.loadDataFile('$dataMapTemp', filename); } else { DataManager.makeEmptyMap(); } var nameDisplayed = $dataMapTemp.displayName; var obj = $dataMapTemp; $dataMapTemp.detailsMonster = []; $dataMapTemp.troopExceptions = []; $dataMapTemp.levelMin = []; $dataMapTemp.encounterRandomConditions = [{"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}]; var notedata = obj.note.split(/[\r\n]+/); for (var i = 0; i < notedata.length; i++){ var line = notedata[i]; if (line.match(noteA)) { var newLine = {"enemyId":Number(RegExp.$1), "codeDetail":1, "idDetail":0, "value":Number(RegExp.$2), "troopId":Number(RegExp.$3 || 0), "memberId":Number(RegExp.$4 || 0), "regionSet":[]}; if ($dataMapTemp.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMapTemp.detailsMonster.push(newLine); } } else if (line.match(noteD)) { if ($dataMapTemp.encounterList.every(function(troop) { return troop.troopId !== DQM.Param.RandomTroopId || troop.regionSet.length < 1; })) { $dataMapTemp.encounterList.push({"troopId":DQM.Param.RandomTroopId, "weight":5, "regionSet":[]}); } } else if (line.match(noteE)) { var newLine = {"levelMin":Number(RegExp.$1), "regionSet":[]}; if ($dataMapTemp.levelMin.every( function(detail) { return detail.levelMin !== newLine.levelMin || detail.regionSet !== newLine.regionSet; })) { $dataMapTemp.levelMin.push(newLine); } } else if (line.match(noteG)) { $dataMapTemp.encounterRandomConditions[0].idList = String(RegExp.$1).split(','); } else if (line.match(noteH)) { $dataMapTemp.encounterRandomConditions[0].rankClass = String(RegExp.$1).split(','); } else if (line.match(noteI)) { $dataMapTemp.encounterRandomConditions[0].sizeClass = String(RegExp.$1).split(','); } else if (line.match(noteJ)) { $dataMapTemp.encounterRandomConditions[0].groupClass = String(RegExp.$1).split(','); } else if (line.match(noteK)) { $dataMapTemp.troopExceptions[0] = $dataMapTemp.troopExceptions[0] || []; $dataMapTemp.troopExceptions[0].push(Number(RegExp.$1)); } else if (line.match(noteO)) { var newLine = {"enemyId":0, "codeDetail":1, "idDetail":0, "value":Number(RegExp.$2), "troopId":Number(RegExp.$1), "memberId":0, "regionSet":[]}; if ($dataMapTemp.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMapTemp.detailsMonster.push(newLine); } } else if (line.match(noteQ)) { var newLine = {"enemyId":Number(RegExp.$1), "codeDetail":1, "idDetail":0, "value":Number(RegExp.$3), "troopId":Number(RegExp.$4 || 0), "memberId":Number(RegExp.$5 || 0), "regionSet":String(RegExp.$2).split(',')}; if ($dataMapTemp.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMapTemp.detailsMonster.push(newLine); } } else if (line.match(noteT)) { if ($dataMapTemp.encounterList.every(function(troop) { return troop.troopId !== DQM.Param.RandomTroopId; })) { $dataMapTemp.encounterList.push({"troopId":DQM.Param.RandomTroopId, "weight":5, "regionSet":String(RegExp.$1).split(',')}); } } else if (line.match(noteU)) { var newLine = {"levelMin":Number(RegExp.$2), "regionSet":String(RegExp.$1).split(',')}; if ($dataMapTemp.levelMin.every( function(detail) { return detail.levelMin !== newLine.levelMin || detail.regionSet !== newLine.regionSet; })) { $dataMapTemp.levelMin.push(newLine); } } else if (line.match(noteW)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])] = $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])].idList = result.detail; } } else if (line.match(noteX)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])] = $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])].rankClass = result.detail; } } else if (line.match(noteY)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])] = $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])].sizeClass = result.detail; } } else if (line.match(noteZ)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":String(RegExp.$2).split(',')}; for (var k = 0; k < result.regionList.length; k++) { $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])] = $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMapTemp.encounterRandomConditions[Number(result.regionList[k])].groupClass = result.detail; } } else if (line.match(noteAA)) { var result = {"regionList":String(RegExp.$1).split(','), "detail":Number(RegExp.$2)}; for (var k = 0; k < result.regionList.length; k++) { $dataMapTemp.troopExceptions[Number(result.regionList[k])] = $dataMapTemp.troopExceptions[Number(result.regionList[k])] || []; $dataMapTemp.troopExceptions[Number(result.regionList[k])].push(Number(RegExp.$1)); } } else if (line.match(noteAE)) { var newLine = {"enemyId":0, "codeDetail":1, "idDetail":0, "value":Number(RegExp.$3), "troopId":Number(RegExp.$1), "memberId":0, "regionSet":String(RegExp.$2).split(',')}; if ($dataMapTemp.detailsMonster.every( function(detail) { return (detail.enemyId !== newLine.enemyId || detail.codeDetail !== newLine.codeDetail || detail.idDetail !== newLine.idDetail || detail.troopId !== newLine.troopId || detail.memberId !== newLine.memberId || detail.regionSet !== newLine.regionSet); })) { $dataMapTemp.detailsMonster.push(newLine); } } } var listTroopRecruitable = $dataMapTemp.events.slice(1).reduce(function(r, event) { for (var k = 0; k < event.pages.length; k++) { var page = event.pages[k]; for (var l = 0; l < page.list.length; l++) { if (page.list[l].code === 201) { } } } }, []); } }; */ Game_System.prototype.completeSynthesisInfos = function() { for (var k = 0; k < DQM.Param.SynthesisFormula.length; k++) { var classId = Number(DQM.Param.SynthesisFormula[k][0]); var listFormulaElements = []; var listFormulaIndex = []; for (var l = 0; l < DQM.Param.SynthesisFormula[k][1].length; l++) { listFormulaElements[l] = $dataClasses.slice(1).filter(function(classData) { return DQM.Param.SynthesisFormula[k][1][l].some(function(conditionOne) { return conditionOne.every(function(conditionEach) { return conditionEach[1].some(function(conditionId) { return (conditionEach[0] === 'N' && Number(conditionId) === classData.id) || (conditionEach[0] === 'R' && Number(conditionId) === classData.RankClassId) || (conditionEach[0] === 'G' && Number(conditionId) === classData.GroupClassId) || (conditionEach[0] === 'S' && Number(conditionId) === classData.SizeClass); }); }); }); }).map(function(classData) { return classData.id; }) || []; listFormulaIndex[l] = 0; } if (listFormulaElements.every(function(listId) { return listId.length > 0; })) { var allChecked = false; while (!allChecked) { var newFormula = listFormulaElements.map(function(elementId, index) { return elementId[listFormulaIndex[index]]; }).sort(function(a,b) { return a - b; }); this.addSynthesisFormula(classId, newFormula); var index = listFormulaIndex.length - 1; while (index >= 0 && (listFormulaIndex[index] + 1) >= listFormulaElements[index].length - 1) { index = index - 1; } if (index < 0) { allChecked = true; } else { listFormulaIndex[index] = listFormulaIndex[index] + 1; for (var m = index + 1; m < listFormulaIndex.length; m++) { listFormulaIndex[m] = 0; } } } } } }; Game_System.prototype.clearMonsterBook = function() { this._monsterBookFlags = []; for (var i = 1; i < $dataClasses.length; i++) { this._monsterBookFlags[i] = this._monsterBookFlags[i] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; this._monsterBookFlags[i].isDiscovered = false; this._monsterBookFlags[i].isAsActor = false; this._monsterBookFlags[i].levelReached = 1; } }; Game_System.prototype.getLevelMaxReached = function(classId) { return this._monsterBookFlags[classId].levelReached; }; Game_System.prototype.changeLevelReached = function(ClassId, levelReached) { if (!this._monsterBookFlags) { this.clearMonsterBook(); } if (!this.isInMonsterBook($dataClasses[ClassId])) { this._monsterBookFlags[ClassId] = this._monsterBookFlags[ClassId] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; } if ((!this._monsterBookFlags[ClassId].levelReached || this._monsterBookFlags[ClassId].levelReached < levelReached) && levelReached) { this._monsterBookFlags[ClassId].locationList = levelReached; } }; Game_System.prototype.addLocationInfo = function(ClassId, MapName) { if (!this._monsterBookFlags) { this.clearMonsterBook(); } if (!this.isInMonsterBook($dataClasses[ClassId])) { this._monsterBookFlags[ClassId] = this._monsterBookFlags[ClassId] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; } if (!this._monsterBookFlags[ClassId].locationList) { this._monsterBookFlags[ClassId].locationList = []; } var test = this._monsterBookFlags[ClassId].locationList.filter(function(mapInfo) { return mapInfo === MapName; }); if (test.length < 1) { this._monsterBookFlags[ClassId].locationList.push(MapName); } }; Game_System.prototype.addSynthesisFormula = function(ClassId, newFormula) { if (!this._monsterBookFlags) { this.clearMonsterBook(); } if (!this.isInMonsterBook($dataClasses[ClassId])) { this._monsterBookFlags[ClassId] = this._monsterBookFlags[ClassId] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; } if (!this._monsterBookFlags[ClassId].synthesisList) { this._monsterBookFlags[ClassId].synthesisList = []; } var test = this._monsterBookFlags[ClassId].synthesisList.filter(function(oldFormula) { var result = (oldFormula.length === newFormula.length); if (result) { for (var k = 0; k < oldFormula.length; k++) { if (oldFormula[k] !== newFormula[k]) { result = false; } } } return result; }); if (test.length < 1) { this._monsterBookFlags[ClassId].synthesisList.push(newFormula); } }; Game_System.prototype.countRecruitSuccess = function(ClassId) { if (!this._monsterBookFlags) { this.clearMonsterBook(); } if (!this.isInMonsterBook($dataClasses[ClassId])) { this._monsterBookFlags[ClassId] = this._monsterBookFlags[ClassId] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; } this._monsterBookFlags[ClassId].recruitSuccess = (this._monsterBookFlags[ClassId].recruitSuccess + 1) || 1; }; Game_System.prototype.resetRecruitSuccess = function() { if (!this._monsterBookFlags) { this.clearMonsterBook(); } for (var k = 1; k < $dataClasses.length; k++) { if (!this.isInMonsterBook($dataClasses[k])) { this._monsterBookFlags[k] = this._monsterBookFlags[k] || {"isDiscovered":false, "isAsActor":false, "levelReached":1, "recruitSuccess":0, "locationList":[], "synthesisList":[]}; } this._monsterBookFlags[k].recruitSuccess = 0; } }; DQM.Core.Game_System_onBattleWin = Game_System.prototype.onBattleWin; Game_System.prototype.onBattleWin = function() { DQM.Core.Game_System_onBattleWin.call(this); if (Math.floor(this._winCount / DQM.Param.FightNumberToResetMalusRecruit) === (this._winCount / DQM.Param.FightNumberToResetMalusRecruit)) { this.resetRecruitSuccess(); } }; Game_System.prototype.isInMonsterBook = function(Class) { if (this._monsterBookFlags && Class && this._monsterBookFlags[Class.id]) { return !!this._monsterBookFlags[Class.id].isDiscovered; } else { return false; } }; Game_System.prototype.getRecruitSuccessCount = function(ClassId) { if (!this._monsterBookFlags || !this._monsterBookFlags[ClassId]) { return 1; } else { var MalusRecruit = (this._monsterBookFlags[ClassId].recruitSuccess || 0) * DQM.Param.RateMalusRecruitSameMonster / 100; return Math.min(1 + MalusRecruit, DQM.Param.RateMaxMalusRecruitSameMonster / 100); } }; Game_System.prototype.isSpecialSynthesisExclusive = function() { return DQM.Param.specialSynthesisOnly; }; Game_System.prototype.getMaxMonstersExisting = function() { return $dataClasses.length - 1; }; Game_System.prototype.getMaxSkillsetsExisting = function() { return $gameSkillset._data.length - 1; }; Game_System.prototype.getMaxAttributesExisting = function() { return $gameAttributes._data.length - 1; }; Game_System.prototype.getMaxMonstersEncountered = function() { return this._monsterBookFlags.filter(function(monster, index) { return monster && this.isInMonsterBook($dataClasses[index]) && index !== 0; }, this).length; }; Game_System.prototype.getMaxMonstersRecruited = function() { return this._monsterBookFlags.filter(function(monster, index) { return monster && this.isInMonsterBook($dataClasses[index]) && monster.isAsActor && index !== 0; }, this).length; }; Game_System.prototype.getMaxSkillsetDiscovered = function() { return this._skillSetBookFlags.filter(function(skillset, index) { return skillset && this.isInSkillSetBook($gameSkillset._data[index]) && index !== 0; }, this).length; }; Game_System.prototype.getMaxSkillsetMastered = function() { return this._skillSetBookFlags.filter(function(skillset, index) { return skillset && this.isInSkillSetBook($gameSkillset._data[index]) && index !== 0 && $gameSkillset._data[index].list[$gameSkillset._data[index].list.length - 1].level === skillset.LevelMax; }, this).length; }; Game_System.prototype.getMaxAttributeDiscovered = function() { return this._attributeBookFlags.filter(function(attribute, index) { return attribute && this.isInAttributeBook($gameAttributes._data[index]) && index !== 0; }, this).length; }; Game_System.prototype.getPercentMonsterEncountered = function() { return Math.floor(this.getMaxMonstersEncountered() / this.getMaxMonstersExisting() * 1000) / 10; }; Game_System.prototype.getPercentMonsterRecruited = function() { return Math.floor(this.getMaxMonstersRecruited() / this.getMaxMonstersExisting() * 1000) / 10; }; Game_System.prototype.getPercentSkillsetDiscovered = function() { return Math.floor(this.getMaxSkillsetDiscovered() / this.getMaxSkillsetsExisting() * 1000) / 10; }; Game_System.prototype.getPercentSkillsetMastered = function() { return Math.floor(this.getMaxSkillsetMastered() / this.getMaxSkillsetsExisting() * 1000) / 10; }; Game_System.prototype.getPercentAttributeDiscovered = function() { return Math.floor(this.getMaxAttributeDiscovered() / this.getMaxAttributesExisting() * 1000) / 10; }; //============================================================================= // Game_Event //============================================================================= //============================================================================= // Game_Interpreter //============================================================================= Game_Interpreter.prototype.command301 = function() { if (!$gameParty.inBattle()) { var troopId; if (this._params[0] === 0) { // Direct designation troopId = this._params[1]; } else if (this._params[0] === 1) { // Designation with a variable troopId = $gameVariables.value(this._params[1]); } else { // Same as Random Encounter troopId = DQM.Param.RandomTroopId; } if ($dataTroops[troopId]) { if (troopId !== DQM.Param.RandomTroopId || $gameTroop.generateCompleteList().length > 0) { BattleManager.setup(troopId, this._params[2], this._params[3]); BattleManager.setEventCallback(function(n) { this._branch[this._indent] = n; }.bind(this)); $gamePlayer.makeEncounterCount(); SceneManager.push(Scene_Battle); } } } return true; }; // Open Menu Screen Game_Interpreter.prototype.command351 = function() { if (!$gameParty.inBattle()) { SceneManager.push(Scene_Menu); Window_MenuCommand.initCommandPosition(); SceneManager._nextScene.setAllMembers(); } return true; }; DQM.Core.Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function(command, args) { DQM.Core.Game_Interpreter_pluginCommand.call(this, command, args); if (command === 'setMapMinLevel') { this.setMapMinLevel(String(args[0]), args[1]); } else if (command === 'setMapMaxMembers') { this.setMapMaxMembers(String(args[0]), args[1]); } else if (command === 'addNewActor') { this.addNewActor(String(args[0]), String(args[1]), args[2]); } else if (command === 'setMapListId') { this.setMapListId(String(args[0]), args[1]); } else if (command === 'setMapListGroup') { this.setMapListGroup(String(args[0]), args[1]); } else if (command === 'setMapListRank') { this.setMapListRank(String(args[0]), args[1]); } else if (command === 'setMapListSize') { this.setMapListSize(String(args[0]), args[1]); } else if (command === 'setMapSwitchOnlyEncountered') { this.setMapSwitchOnlyEncountered(String(args[0]), args[1]); } else if (command === 'setMapSkillsetMin') { this.setMapSkillsetMin(String(args[0]), args[1]); } else if (command === 'setMapSkillsetExcluded') { this.setMapSkillsetExcluded(String(args[0]), args[1]); } else if (command === 'setMapTroopExceptions') { this.setMapTroopExceptions(String(args[0]), args[1]); } else if (command === 'setMapskillsetDefaultAutomatic') { this.setMapskillsetDefaultAutomatic(String(args[0]), args[1]); } else if (command === 'setFormationMenu') { this.setFormationMenu(); } else if (command === 'setSynthesisMenu') { this.setSynthesisMenu(); } else if (command === 'setBookMenu') { this.setBookMenu(); } else if (command === 'setJobInputMenu') { this.setJobInputMenu(); } else if (command === 'setRenameMenu') { this.setRenameMenu(); } else if (command === 'setRenamePlayerScreen') { this.setRenamePlayerScreen(args[0]); } else if (command === 'addSizeTeam') { this.addSizeTeam(args[0]); } else if (command === 'addSupplementaryTeam') { this.addSupplementaryTeam(args[0]); } else if (command === 'addMaxBattlers') { this.addMaxBattlers(args[0]); } }; Game_Interpreter.prototype.translatePluginParam = function(oldString, valueType) { if (valueType === 'number') { if (oldString.startsWith('V')) { return $gameVariables.value(Number(oldString.slice(1))); } else { return Number(oldString); } } else if (valueType === 'switch') { if (oldString.startsWith('S')) { return $gameSwitches.value(Number(oldString.slice(1))); } else { return oldString === 'true'; } } }; // Create a new actor Game_Interpreter.prototype.addNewActor = function(classId, level, skillsets) { var realClassId = this.translatePluginParam(classId, 'number'); var Class = $dataClasses[realClassId]; var realLevel = this.translatePluginParam(level, 'number'); var realSkillsets = skillsets ? skillsets.split(';').sort(function(a,b) { if (a.startsWith('SD') && !b.startsWith('SD')) { return -1; } else if (a.startsWith('SR') && !b.startsWith('SR')) { return 1; } else { return 0; } }) : []; for (var k = 0; k < realSkillsets.length; k++) { realSkillsets[k] = realSkillsets[k].split(','); if (realSkillsets[k].length < 2) { realSkillsets[k][1] = 0; } else { realSkillsets[k][1] = this.translatePluginParam(realSkillsets[k][1], 'number'); } if (realSkillsets[k][0] === 'SD') { realSkillsets[k][0] = Class.SkillSetDefault; } else if (realSkillsets[k][0] === 'SR') { do { realSkillsets[k][0] = Math.randomInt($gameSkillset._data.length - 1) + 1; } while (realSkillsets.some(function(skillset, id) { return id < k && realSkillsets[k][0] === skillset[0]; })); } else { realSkillsets[k][0] = this.translatePluginParam(realSkillsets[k][0], 'number'); } } var newIndex = 1; while (newIndex < $dataActors.length && ($dataActors[newIndex] || $dataActors[newIndex] != undefined)) { newIndex++; } var EnemyData = $dataEnemies.filter(function(enemy) { return enemy && Number(enemy.ClassId) === realClassId; })[0]; var jobPoints = DQM.Param.ValueJobPoint.filter(function(value, id) { return Number(DQM.Param.LevelJobPoint[id]) <= realLevel; }).reduce(function(r, value) { return r + Number(value); }, 0); $dataActors[newIndex] = $gameParty.initActor(); $dataActors[newIndex].id = newIndex; $dataActors[newIndex].battlerName = EnemyData.battlerName; $dataActors[newIndex].characterName = Class.characterName; $dataActors[newIndex].characterIndex = Class.characterIndex; $dataActors[newIndex].faceName = Class.faceName; $dataActors[newIndex].faceIndex = Class.faceIndex; $dataActors[newIndex].classId = EnemyData.ClassId; $dataActors[newIndex].name = EnemyData.name; $dataActors[newIndex].nickname = Class.name; $dataActors[newIndex].profile = Class.Profile; $dataActors[newIndex].initialLevel = realLevel.clamp(1, Number(DQM.Param.valueChangeLevelMax[0])); $dataActors[newIndex].Skillsets = realSkillsets; $dataActors[newIndex].JobPoints = jobPoints; $dataActors[newIndex].monster = true; New_Actor = Object.create(Game_Actor.prototype); New_Actor.initMembers(); New_Actor.setup(newIndex); $gameActors._data[newIndex] = New_Actor; $gameParty.addActor(newIndex); $gameMessage.add(DQM.Param.MessageGetNewActor.format(EnemyData.name)); SceneManager.push(Scene_Name); SceneManager._nextScene.initialize(); SceneManager._nextScene.prepare(newIndex, DQM.Param.LengthNameActor); return true; }; // Change the minimum level in this map. Game_Interpreter.prototype.setMapMinLevel = function(levelMin, regionSet) { if ($dataMap) { var regionList = regionSet ? String(regionSet).split(',') || [] : []; for (var k = 0; k < regionList.length; k++) { regionList[k] = this.translatePluginParam(regionList[k], 'number'); } var levelMinReal = this.translatePluginParam(levelMin, 'number'); var newLine = {"levelMin":levelMinReal, "regionSet":regionList}; if ($dataMap.levelMin.every( function(detail) { return detail.levelMin !== newLine.levelMin || detail.regionSet !== newLine.regionSet; })) { $dataMap.levelMin.push(newLine); } } return true; }; // Change the maximum members of random troop in this map. Game_Interpreter.prototype.setMapMaxMembers = function(maxNumber, regionSet) { if ($dataMap) { var regionList = regionSet ? String(regionSet).split(',') || [] : []; var index = this.translatePluginParam(maxNumber, 'number'); if (regionList.length < 1) { regionList = ["0"]; } for (var k = 0; k < regionList.length; k++) { regionList[k] = this.translatePluginParam(regionList[k], 'number'); } $dataMap.maxEnemies[index] = ($dataMap.maxEnemies[index] || []).concat(regionList); } return true; }; // Change the id list of all monsters for random encounters in this map. Game_Interpreter.prototype.setMapListId = function(list, regionSet) { if ($dataMap) { var regionIdList = regionSet ? String(regionSet).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } var idList = String(list).split(','); for (var k = 0; k < idList.length; k++) { idList[k] = this.translatePluginParam(idList[k], 'number'); } for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); $dataMap.encounterRandomConditions[regionIdList[k]] = $dataMap.encounterRandomConditions[regionIdList[k]] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[regionIdList[k]].idList = idList; } } return true; }; // Change the group list of all monsters for random encounters in this map. Game_Interpreter.prototype.setMapListGroup = function(list, regionSet) { if ($dataMap) { var regionIdList = regionSet ? String(regionSet).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } var groupList = String(list).split(','); for (var k = 0; k < groupList.length; k++) { groupList[k] = this.translatePluginParam(groupList[k], 'number'); } for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); $dataMap.encounterRandomConditions[regionIdList[k]] = $dataMap.encounterRandomConditions[regionIdList[k]] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[regionIdList[k]].groupClass = groupList; } } return true; }; // Change the rank list of all monsters for random encounters in this map. Game_Interpreter.prototype.setMapListRank = function(list, regionSet) { if ($dataMap) { var regionIdList = regionSet ? String(regionSet).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } var rankList = String(list).split(','); for (var k = 0; k < rankList.length; k++) { rankList[k] = this.translatePluginParam(rankList[k], 'number'); } for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); $dataMap.encounterRandomConditions[regionIdList[k]] = $dataMap.encounterRandomConditions[regionIdList[k]] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[regionIdList[k]].rankClass = rankList; } } return true; }; // Change the size list of all monsters for random encounters in this map. Game_Interpreter.prototype.setMapListSize = function(list, regionSet) { if ($dataMap) { var regionIdList = regionSet ? String(regionSet).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } var sizeList = String(list).split(','); for (var k = 0; k < sizeList.length; k++) { sizeList[k] = this.translatePluginParam(sizeList[k], 'number'); } for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); $dataMap.encounterRandomConditions[regionIdList[k]] = $dataMap.encounterRandomConditions[regionIdList[k]] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[regionIdList[k]].sizeClass = sizeList; } } return true; }; // Change the switch for random encounters indicating if monsters is already encountered in this map. Game_Interpreter.prototype.setMapSwitchOnlyEncountered = function(bool, regionSet) { if ($dataMap) { var regionIdList = regionSet ? String(regionSet).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } var onlyEncountered = this.translatePluginParam(bool, 'switch'); for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); $dataMap.encounterRandomConditions[regionIdList[k]] = $dataMap.encounterRandomConditions[regionIdList[k]] || {"idList":[], "rankClass":[], "groupClass":[], "sizeClass":[], "onlyEncountered":false}; $dataMap.encounterRandomConditions[regionIdList[k]].onlyEncountered = onlyEncountered; } } return true; }; // Change the minimum of skillsets assigned to enemies for encounters in this map. Game_Interpreter.prototype.setMapSkillsetMin = function(newNumber, listRegionId) { if ($dataMap) { var regionIdList = listRegionId ? String(listRegionId).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); } var skillsetMin = this.translatePluginParam(newNumber, 'number'); $dataMap.skillsetMin[skillsetMin] = ($dataMap.skillsetMin[skillsetMin] || []).concat(regionIdList); } return true; }; // Change the id list of skillsets excluded for enemies in this map. Game_Interpreter.prototype.setMapSkillsetExcluded = function(list, listRegionId) { if ($dataMap) { var listReal = String(list).split(','); for (var l = 0; l < listReal.length; l++) { listReal[l] = this.translatePluginParam(listReal[l], 'number'); } var regionIdList = listRegionId ? String(listRegionId).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); $dataMap.skillsetExcluded[regionIdList[k]] = listReal; } } return true; }; // Change the id list of troop exceptions for level/skillsets/special attributes settings in this map. Game_Interpreter.prototype.setMapTroopExceptions = function(listTroopId, listRegionId) { if ($dataMap) { var listTroopIdReal = String(listTroopId).split(','); var regionIdList = listRegionId ? String(listRegionId).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } for (var l = 0; l < listTroopIdReal.length; l++) { listTroopIdReal[l] = this.translatePluginParam(listTroopIdReal[l], 'number'); } for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); $dataMap.troopExceptions[regionIdList[k]] = listTroopIdReal; } } return true; }; // Change the id list of all monsters for random encounters in this map. Game_Interpreter.prototype.setMapskillsetDefaultAutomatic = function(bool, listRegionId) { if ($dataMap) { var regionIdList = listRegionId ? String(listRegionId).split(',') || [] : []; if (regionIdList.length < 1) { regionIdList = ["0"]; } for (var k = 0; k < regionIdList.length; k++) { regionIdList[k] = this.translatePluginParam(regionIdList[k], 'number'); } var instruction = this.translatePluginParam(bool, 'switch'); if (instruction) { $dataMap.skillsetDefaultAutomatic = $dataMap.skillsetDefaultAutomatic.filter(function(regionId) { return !regionIdList.contains(regionId); }); } else { $dataMap.skillsetDefaultAutomatic = $dataMap.skillsetDefaultAutomatic.concat(regionIdList); } } return true; }; // Open Formation Screen Game_Interpreter.prototype.setFormationMenu = function() { if (!$gameParty.inBattle()) { $gameParty._allMembers = true; SceneManager.push(Scene_Formation); } return true; }; // Open Synthesis Screen Game_Interpreter.prototype.setSynthesisMenu = function() { if (!$gameParty.inBattle()) { $gameParty._allMembers = true; SceneManager.push(Scene_SynthesisActor); } return true; }; // Open Book Screen Game_Interpreter.prototype.setBookMenu = function() { if (!$gameParty.inBattle()) { SceneManager.push(Scene_BookList); } return true; }; // Open Job points Gestion Screen Game_Interpreter.prototype.setJobInputMenu = function() { if (!$gameParty.inBattle()) { $gameParty._allMembers = true; SceneManager.push(Scene_SkillListActor_Independant); } return true; }; // Open Rename Actor Screen Game_Interpreter.prototype.setRenameMenu = function() { if (!$gameParty.inBattle()) { $gameParty._allMembers = true; SceneManager.push(Scene_Rename_Independant); } return true; }; // Open Rename Player Screen Game_Interpreter.prototype.setRenamePlayerScreen = function(maxLength) { if (!$gameParty.inBattle()) { SceneManager.push(Scene_Name); SceneManager._nextScene.initialize(); SceneManager._nextScene.prepare(0, maxLength ? this.translatePluginParam(String(maxLength), 'number') || DQM.Param.LengthNameActor : DQM.Param.LengthNameActor); } return true; }; // Rise up Max Battlers Game_Interpreter.prototype.addMaxBattlers = function(addNumber) { if ($gameSystem._maxBattlers !== 0) { $gameSystem._maxBattlers = $gameSystem._maxBattlers + (addNumber ? this.translatePluginParam(String(addNumber), 'number') || 1 : 1); } return true; }; // Rise up Supplementary Team Game_Interpreter.prototype.addSupplementaryTeam = function(addNumber) { if ($gameSystem._maxSupplementaryTeam !== -1) { var bonus = addNumber ? this.translatePluginParam(String(addNumber), 'number') || 1 : 1; var stockageTeam = $gameParty.team($gameParty.stockageId()); for (var k = 0; k < stockageTeam.length; k++) { stockageTeam[k]._teamIndex = stockageTeam[k]._teamIndex + bonus; } $gameSystem._maxSupplementaryTeam = $gameSystem._maxSupplementaryTeam + bonus; } return true; }; // Rise up Max Battlers Game_Interpreter.prototype.addSizeTeam = function(addNumber) { $gameSystem._maxSizeTeam = $gameSystem._maxSizeTeam + (addNumber ? this.translatePluginParam(String(addNumber), 'number') || 1 : 1); return true; }; //============================================================================= // Game_Skillset // // The game object class for Skillset datas. //============================================================================= function Game_Skillset() { this.initialize.apply(this, arguments); }; Game_Skillset.prototype.initialize = function() { this._data = []; for (var k = 0; k < DQM.Param.SkillsetData.length; k++) { this.AddDatas(k); } for (var l = 1; l < this._data.length; l++) { this._data[l] = this._data[l] || {"id":l, "name":"", "desc":"", "list":[]}; for (var m = 0; m < this._data[l].list.length; m++) { this._data[l].list[m] = this._data[l].list[m] || {"level":m, "skillObtained":[], "paramBonus":[], "stateResist":[], "elementResist":[], "debuffResist":[], "attributeObtained":[]}; } } }; Game_Skillset.prototype.AddDatas = function(n) { var NewData = DQM.Param.SkillsetData[n]; var OldData = this._data[NewData[0]] || {"id":NewData[0], "name":"", "desc":"", "list":[]}; switch (NewData[1]) { case 0: OldData.name = NewData[2]; break; case 1: OldData.desc = NewData[2]; break; case 2: OldData.list = OldData.list || []; OldData.list[NewData[2]] = OldData.list[NewData[2]] || {"level":NewData[2], "skillObtained":[], "paramBonus":[], "stateResist":[], "elementResist":[], "debuffResist":[], "attributeObtained":[]}; OldData.list[NewData[2]].skillObtained.push(NewData[3]); OldData.list[NewData[2]].skillObtained.sort(function(a, b) { return a - b; }); break; case 3: OldData.list = OldData.list || []; OldData.list[NewData[2]] = OldData.list[NewData[2]] || {"level":NewData[2], "skillObtained":[], "paramBonus":[], "stateResist":[], "elementResist":[], "debuffResist":[], "attributeObtained":[]}; if (OldData.list[NewData[2]].paramBonus.length < 1) { OldData.list[NewData[2]].paramBonus = [0,0,0,0,0,0,0,0]; } var StringTest = NewData[4]; var ParamId = ''; if (StringTest === 'MHP') { ParamId = 0; } else if (StringTest === 'MMP') { ParamId = 1; } else if (StringTest === 'ATK') { ParamId = 2; } else if (StringTest === 'DEF') { ParamId = 3; } else if (StringTest === 'MAT') { ParamId = 4; } else if (StringTest === 'MDF') { ParamId = 5; } else if (StringTest === 'AGI') { ParamId = 6; } else if (StringTest === 'LUK') { ParamId = 7; } OldData.list[NewData[2]].paramBonus[ParamId] = OldData.list[NewData[2]].paramBonus[ParamId] + NewData[3]; break; case 4: OldData.list = OldData.list || []; OldData.list[NewData[2]] = OldData.list[NewData[2]] || {"level":NewData[2], "skillObtained":[], "paramBonus":[], "stateResist":[], "elementResist":[], "debuffResist":[], "attributeObtained":[]}; if (NewData[4] === 'ELEMENT') { OldData.list[NewData[2]].elementResist.push({"elementId":NewData[3], "BonusValue":NewData[5]}); } else if (NewData[4] === 'STATE') { OldData.list[NewData[2]].stateResist.push({"stateId":NewData[3], "BonusValue":NewData[5]}); } else if (NewData[4] === 'DEBUFF') { OldData.list[NewData[2]].debuffResist.push({"debuffId":NewData[3], "BonusValue":NewData[5]}); } break; case 5: OldData.list = OldData.list || []; OldData.list[NewData[2]] = OldData.list[NewData[2]] || {"level":NewData[2], "skillObtained":[], "paramBonus":[], "stateResist":[], "elementResist":[], "debuffResist":[], "attributeObtained":[]}; OldData.list[NewData[2]].attributeObtained.push(NewData[3]); OldData.list[NewData[2]].attributeObtained.sort(function(a, b) { return a - b; }); break; } this._data[NewData[0]] = OldData; }; Game_Skillset.prototype.UsableList = function() { return this._data.filter(function(skillset) { return (skillset.name.length > 0 && skillset.desc.length > 0 && skillset.list.length > 0); }); }; //============================================================================= // Game_Attribute // // The game object class for Attributes datas. //============================================================================= function Game_Attribute() { this.initialize.apply(this, arguments); }; Game_Attribute.prototype.initialize = function() { this._data = []; for (var k = 0; k < DQM.Param.AttributeData.length; k++) { this.AddDatas(k); } for (var l = 1; l < this._data.length; l++) { this._data[l] = this._data[l] || {"id":l, "name":"", "desc":"", "effect":[]}; } }; Game_Attribute.prototype.AddDatas = function(n) { var NewData = DQM.Param.AttributeData[n]; var OldData = this._data[NewData[0]] || {"id":NewData[0], "name":"", "desc":"", "effect":[]}; var idskill; var occasion; var value1; var value2; var type; var target; switch (NewData[1]) { case 0: OldData.name = NewData[2]; break; case 1: OldData.desc = NewData[2]; break; case 2: OldData.effect.push({"code":1, "type":1, "id":NewData[4], "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 3: OldData.effect.push({"code":1, "type":2, "id":NewData[4], "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 4: OldData.effect.push({"code":1, "type":3, "id":NewData[4], "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 5: OldData.effect.push({"code":1, "type":4, "id":NewData[4], "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 6: OldData.effect.push({"code":1, "type":5, "id":NewData[4], "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 7: OldData.effect.push({"code":1, "type":6, "id":NewData[4], "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 8: OldData.effect.push({"code":1, "type":7, "id":NewData[4], "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 9: OldData.effect.push({"code":1, "type":8, "id":NewData[4], "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 10: OldData.effect.push({"code":2, "type":1, "id":NewData[3], "value1":-NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 11: OldData.effect.push({"code":2, "type":2, "id":NewData[3], "value1":-NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 12: OldData.effect.push({"code":2, "type":3, "id":NewData[3], "value1":-NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 13: OldData.effect.push({"code":2, "type":4, "id":NewData[3], "value1":-NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 14: OldData.effect.push({"code":3, "type":0, "id":0, "value1":0, "value2":NewData[2], "chance":1, "occasion":0, "target":0}); break; case 15: if (NewData[2] === 'TENSION') { idskill = DQM.Param.TensionId; } else { idskill = Number(NewData[2]); } if (NewData[3] === 'BEGIN') { occasion = 1; } else if (NewData[3] === 'END') { occasion = 4; } if (NewData[4] === 'TURN') { null; } else if (NewData[4] === 'BATTLE') { occasion = occasion + 1; } else if (NewData[4] === 'ACTION') { occasion = occasion + 2; } OldData.effect.push({"code":4, "type":1, "id":idskill, "value1":1, "value2":0, "chance":NewData[5]/100, "occasion":occasion, "target":0}); break; case 16: OldData.effect.push({"code":5, "type":1, "id":0, "value1":0, "value2":0, "chance":1, "occasion":0, "target":0}); break; case 17: if (NewData[4] === 'WITH') { type = 1; } else if (NewData[4] === 'WITHOUT') { type = 2; } OldData.effect.push({"code":6, "type":type, "id":0, "value1":NewData[2], "value2":NewData[3], "chance":1, "occasion":0, "target":0}); break; case 18: OldData.effect.push({"code":7, "type":1, "id":NewData[3], "value1":NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 19: OldData.effect.push({"code":7, "type":2, "id":NewData[3], "value1":NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 20: OldData.effect.push({"code":7, "type":3, "id":NewData[3], "value1":NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 21: OldData.effect.push({"code":7, "type":4, "id":NewData[3], "value1":NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 22: OldData.effect.push({"code":7, "type":5, "id":NewData[3], "value1":NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 23: if (NewData[3] === 'PARAM') { type = 1; } else if (NewData[3] === 'XPARAM') { type = 2; } else if (NewData[3] === 'SPARAM') { type = 3; } OldData.effect.push({"code":8, "type":type, "id":NewData[4], "value1":0, "value2":NewData[2], "chance":1, "occasion":0, "target":0}); break; case 24: OldData.effect.push({"code":9, "type":0, "id":NewData[2], "value1":0, "value2":0, "chance":1, "occasion":0}); break; case 25: OldData.effect.push({"code":10, "type":0, "id":NewData[2], "value1":0, "value2":NewData[3], "chance":1, "occasion":2, "target":0}); break; case 26: if (NewData[2] === 'GOLD') { type = 1; } else if (NewData[2] === 'EXP') { type = 2; } else if (NewData[2] === 'ITEM') { type = 3; } OldData.effect.push({"code":11, "type":type, "id":0, "value1":NewData[3], "value2":0, "chance":1, "occasion":4, "target":0}); break; case 27: if (NewData[3] === 'ADDITION') { OldData.effect.push({"code":12, "type":0, "id":0, "value1":0, "value2":NewData[2], "chance":1, "occasion":0, "target":0}); } else if (NewData[3] === 'MULTIPLICATION') { OldData.effect.push({"code":12, "type":0, "id":0, "value1":NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); } break; case 28: if (NewData[3] === 'PARAM') { type = 1; } else if (NewData[3] === 'XPARAM') { type = 2; } else if (NewData[3] === 'SPARAM') { type = 3; } OldData.effect.push({"code":8, "type":type, "id":NewData[4], "value1":NewData[2], "value2":0, "chance":1, "occasion":0, "target":0}); break; case 29: OldData.effect.push({"code":13, "type":0, "id":0, "value1":0, "value2":0, "chance":1, "occasion":0, "target":0}); break; case 30: if (NewData[2] === 'TENSION') { idskill = DQM.Param.TensionId; } else { idskill = Number(NewData[2]); } OldData.effect.push({"code":14, "type":0, "id":idskill, "value1":0, "value2":0, "chance":1, "occasion":0, "target":0}); break; case 31: if (NewData[3] === 'TENSION') { idskill = DQM.Param.TensionId; } else { idskill = Number(NewData[3]); } OldData.effect.push({"code":4, "type":1, "id":idskill, "value1":NewData[2], "value2":NewData[4], "chance":1, "occasion":7, "target":0}); break; case 32: if (NewData[2] === 'DEBUFF') { NewData[4] = -NewData[4]; } else if (NewData[2] === 'BUFF') { null; } if (NewData[5] === 'USER') { target = 0; } else if (NewData[5] === 'ALL ALLIES') { target = 1; } else if (NewData[5] === 'ALL ENEMIES') { target = 2; } OldData.effect.push({"code":4, "type":2, "id":NewData[3], "value1":NewData[4], "value2":NewData[6], "chance":1, "occasion":2, "target":target}); break; case 33: OldData.effect.push({"code":4, "type":3, "id":NewData[2], "value1":1, "value2":NewData[3], "chance":NewData[4]/100, "occasion":2, "target":0}); break; case 34: if (NewData[3] === 'HP') { type = 1; } else if (NewData[3] === 'MP') { type = 2; } if (NewData[4] === 'USER') { target = 0; } else if (NewData[4] === 'ALL ALLIES') { target = 1; } OldData.effect.push({"code":4, "type":4, "id":type, "value1":NewData[2], "value2":0, "chance":1, "occasion":4, "target":target}); break; case 35: OldData.effect.push({"code":15, "type":0, "id":NewData[3], "value1":0, "value2":0, "chance":NewData[2], "occasion":0, "target":0}); break; case 36: OldData.effect.push({"code":16, "type":0, "id":0, "value1":0, "value2":0, "chance":0, "occasion":0, "target":0}); break; case 37: OldData.effect.push({"code":17, "type":0, "id":NewData[2], "value1":0, "value2":0, "chance":0, "occasion":0, "target":0}); break; case 38: if (NewData[3] === '%') { value1 = - NewData[2]; value2 = 0; } else if (NewData[3] === ' POINTS') { value1 = 0; value2 = - NewData[2]; } OldData.effect.push({"code":8, "type":1, "id":2, "value1":value1, "value2":value2, "chance":0, "occasion":8, "target":0}); OldData.effect.push({"code":8, "type":1, "id":3, "value1":value1, "value2":value2, "chance":0, "occasion":8, "target":0}); OldData.effect.push({"code":8, "type":1, "id":4, "value1":value1, "value2":value2, "chance":0, "occasion":8, "target":0}); OldData.effect.push({"code":8, "type":1, "id":5, "value1":value1, "value2":value2, "chance":0, "occasion":8, "target":0}); break; case 39: var list = NewData[2].split(','); for (var k = 0; k < list.length; k++) { OldData.effect.push({"code":19, "type":0, "id":Number(list[k]), "value1":NewData[3], "value2":0, "chance":0, "occasion":0, "target":0}); } break; case 40: break; case 41: break; case 42: break; case 43: break; case 44: break; case 45: break; case 46: break; case 47: break; case 48: break; } this._data[NewData[0]] = OldData; }; Game_Attribute.prototype.UsableList = function() { return this._data.filter(function(attribute) { return (attribute.name.length > 0 && attribute.desc.length > 0 && attribute.effect.length > 0); }); }; Game_Attribute.prototype.getClassList = function(attribute) { var list = $dataClasses.slice(1).filter(function(classdata) { return classdata.AttributeList.filter(function(attributeTest) { return attributeTest.attributeId === attribute.id; }).length > 0; }); return list.map(function(classdata) { var attributeIndex = 0; while (attributeIndex < classdata.AttributeList.length && classdata.AttributeList[attributeIndex].attributeId !== attribute.id) { attributeIndex++; } var particularConditions = classdata.AttributeList[attributeIndex].particularConditions; if (particularConditions.length > 0) { return {"classId":classdata.id, "levelSynthesis":classdata.AttributeList[attributeIndex].levelSynthesis, "conditionsType":particularConditions[0].ConditionsType, "valueId":particularConditions[0].ValueId}; } else { return {"classId":classdata.id, "levelSynthesis":classdata.AttributeList[attributeIndex].levelSynthesis, "conditionsType":0, "valueId":0}; } }).sort(function(a, b) { if (a.conditionsType !== b.conditionsType) { return a.conditionsType - b.conditionsType; } else if (a.valueId !== b.valueId) { return a.valueId - b.valueId; } else if (a.levelSynthesis !== b.levelSynthesis) { return a.levelSynthesis - b.levelSynthesis; } else { return a.classId - b.classId; } }) || []; }; Game_Attribute.prototype.getSkillsetList = function(attribute) { var list = $gameSkillset._data.filter(function(skillset) { return skillset.list.filter(function(bonusList) { return bonusList.attributeObtained.contains(attribute.id); }).length > 0; }); return list.map(function(skillset) { var bonusList = skillset.list.filter(function(bonusList) { return bonusList.attributeObtained.contains(attribute.id); }); return {"skillsetId":skillset.id, "levelSkillset":bonusList[0].level}; }).sort(function(a,b) { return a.skillsetId - b.skillsetId; }) || []; }; //============================================================================= // Game_Synthesis // // The game object class for Synthesis datas. //============================================================================= function Game_Synthesis() { this.initialize.apply(this, arguments); }; Game_Synthesis.prototype.initialize = function() { this._classicData = []; this._specialData = []; this._skillsetList = []; }; Game_Synthesis.prototype.setup = function(ActorId1,ActorId2) { this.checkAllSynthesis(ActorId1, ActorId2); this.createSynthesisClassic(ActorId1, ActorId2); this.obtainSkillsetList(ActorId1, ActorId2); }; Game_Synthesis.prototype.update = function(ActorId1,ActorId2) { this.initialize(); this.setup(ActorId1,ActorId2); }; Game_Synthesis.prototype.createSynthesisClassic = function(ActorId1,ActorId2) { if ((this._specialData.length < 1 || !DQM.Param.specialSynthesisOnly) && (!$gameParty.members()[ActorId1].hasEquipsEffectsKeepAfterSynthesis() && !$gameParty.members()[ActorId2].hasEquipsEffectsKeepAfterSynthesis())) { var ClassId1 = $gameParty.members()[ActorId1]._classId; var ClassId2 = $gameParty.members()[ActorId2]._classId; this._classicData = this._classicData || []; if (this.verifyGroupIdValid(ClassId1,ClassId2)) { this.GetClassicResult1(ClassId1,ClassId2); if ($dataClasses[ClassId1].GroupClassId !== $dataClasses[ClassId2].GroupClassId) { this.GetClassicResult1(ClassId2,ClassId1); this.GetClassicResult2(ClassId1,ClassId2); } } } }; Game_Synthesis.prototype.GetClassicResult1 = function(ClassId1,ClassId2) { var indexNew = Math.max(ClassId1,ClassId2)+1; var GroupId = $dataClasses[ClassId1].GroupClassId; this.CalculateNextClass(GroupId,indexNew); }; Game_Synthesis.prototype.GetClassicResult2 = function(ClassId1,ClassId2) { var indexNew = Math.min(ClassId1,ClassId2)+1; var newClass = this.CalculateNewGroup(ClassId1,ClassId2); this.CalculateNextClass(newClass,indexNew); }; Game_Synthesis.prototype.CalculateNextClass = function(GroupId,IndexStart) { if (this.GetGroup(GroupId).length > 0) { if (IndexStart < this.GetLastSyntheticGroup(GroupId)) { while(GroupId !== $dataClasses[IndexStart].GroupClassId || !$dataClasses[IndexStart].IsClassicSynthesys) { IndexStart++; if (IndexStart >= $dataClasses.length-1) { break; } } if (GroupId !== $dataClasses[IndexStart].GroupClassId || !$dataClasses[IndexStart].IsClassicSynthesys) { if (!this.isAlreadySelected(this.GetLastSyntheticGroup(GroupId))) { this._classicData.push(this.GetLastSyntheticGroup(GroupId)); } } else { if (!this.isAlreadySelected(IndexStart)) { this._classicData.push(IndexStart); } } } else { if (!this.isAlreadySelected(this.GetLastSyntheticGroup(GroupId))) { this._classicData.push(this.GetLastSyntheticGroup(GroupId)); } } } }; Game_Synthesis.prototype.isAlreadySelected = function(classId) { return this._specialData.filter(function(result) { return result.idResult === classId; }).length > 0; }; Game_Synthesis.prototype.CalculateNewGroup = function(ClassId1,ClassId2) { var GroupId1 = $dataClasses[ClassId1].GroupClassId; var GroupId2 = $dataClasses[ClassId2].GroupClassId; var result = []; if (DQM.Param.ThirdClassicResultDefinable) { result = DQM.Param.ThirdClassicResultDefinition.filter(function(formula) { return (formula[0] === GroupId1 && formula[1] === GroupId2) || (formula[1] === GroupId1 && formula[0] === GroupId2); }).sort(function(a,b) { if (a[0] === GroupId1 && a[1] === GroupId2) { return -1; } else if (b[0] === GroupId1 && b[1] === GroupId2) { return 1; } else { return 0; } }); } if (result.length > 0) { return result[0][2]; } else { result = 1 + (GroupId1+GroupId2-1)%(DQM.Param.GroupClassList.length-1); if (result === (DQM.Param.GroupClassList.length-1) || result === 0) { result = (result + 1)%(DQM.Param.GroupClassList.length-1); } while (DQM.Param.GroupClassList.length > 4 && [GroupId1,GroupId2,DQM.Param.GroupClassList.length - 1].contains(result)) { result = (result+1)%(DQM.Param.GroupClassList.length-1); if (result === (DQM.Param.GroupClassList.length-1) || result === 0) { result++; } } return result; } }; Game_Synthesis.prototype.GetGroup = function(GroupClassId) { var ArrayEpured = $dataClasses.filter(function(classes){ return classes; }); return ArrayEpured.filter(function(classes) { return classes.GroupClassId === GroupClassId; }); }; Game_Synthesis.prototype.GetGroupSynthetic = function(GroupClassId) { return this.GetGroup(GroupClassId).filter(function(classes) { return classes.IsClassicSynthesys; }); }; Game_Synthesis.prototype.GetLastSyntheticGroup = function(GroupClassId) { var ArrayNew = this.GetGroupSynthetic(GroupClassId); return ArrayNew[ArrayNew.length-1].id; }; Game_Synthesis.prototype.verifyGroupIdValid = function(ClassId1,ClassId2) { return ($dataClasses[ClassId1].GroupClassId !== DQM.Param.GroupClassList.length-1 || $dataClasses[ClassId2].GroupClassId !== DQM.Param.GroupClassList.length-1); }; Game_Synthesis.prototype.checkAllSynthesis = function(ActorId1, ActorId2) { this._specialData = this._specialData || []; this.verifyEquipsSynthesis(ActorId1, ActorId2); if (this._specialData.length < 1) { var List1 = [$gameParty.members()[ActorId1]._classId,$gameParty.members()[ActorId1]._synthesisHist]; var List2 = [$gameParty.members()[ActorId2]._classId,$gameParty.members()[ActorId2]._synthesisHist]; var LevelMax = this.SelectMaxHist(List1) + this.SelectMaxHist(List2); for (var k = 2; k <= LevelMax; k++) { var ListSynthesisLevel = DQM.Param.SynthesisFormula.filter(function(Formula) { return Formula[1].length === k; }); if (ListSynthesisLevel.length > 0) { this.checkAllSynthesisByLevel(List1, List2, k); } } } }; Game_Synthesis.prototype.verifyEquipsSynthesis = function(ActorId1, ActorId2) { var actor1 = $gameParty.members()[ActorId1]; var actor2 = $gameParty.members()[ActorId2]; var ResultList = []; if (actor1.hasEquipsEffectsKeepAfterSynthesis()) { ResultList.push(actor1._classId); } if (actor2.hasEquipsEffectsKeepAfterSynthesis()) { ResultList.push(actor2._classId); } if (ResultList.length === 1 || (ResultList.length === 2 && ResultList[0] === ResultList[1])) { this._specialData.push({"idResult":ResultList[0], "formulaUsed":[]}); } }; Game_Synthesis.prototype.SelectMaxHist = function(List) { if (List[1].length !== 2) { return 1; } else { var sum = 0; for (var k = 0; k < List[1].length; k++) { sum = sum + this.SelectMaxHist(List[1][k]); } return sum; } }; Game_Synthesis.prototype.checkAllSynthesisByLevel = function(List1, List2, level) { var ListGroup = this.createAllGroups(List1, List2, level); var ListSynthesisLevel = DQM.Param.SynthesisFormula.filter(function(Formula) { return Formula[1].length === level; }); if (ListGroup.length > 0 && ListSynthesisLevel.length > 0) { for (var k = 0; k < ListGroup.length; k++) { for (var l = 0; l < ListSynthesisLevel.length; l++) { if (!this.isAlreadySelected(ListSynthesisLevel[l][0])) { if (this.checkConditionsOnGroup(ListGroup[k], ListSynthesisLevel[l][1])) { this._specialData.push({"idResult":ListSynthesisLevel[l][0], "formulaUsed":this._formulaUsed}); } } } } } }; Game_Synthesis.prototype.createAllGroups = function(List1, List2, level) { var StructureGroup = this.GetStructure(level); var ListGroup = this.createGroups(List1, List2, StructureGroup); ListGroup = ListGroup.concat(this.createGroups(List2, List1, StructureGroup)); ListGroup = ListGroup.filter(function(Group) { return (Group.length === level); }); return ListGroup; }; Game_Synthesis.prototype.createGroups = function(List1, List2, StructureGroup) { var ListFinal = []; var Group = []; var ManyGroups = []; Group = Group.concat(this.SelectHist(List1, StructureGroup[0])); if (StructureGroup[1].length > 1 && List2[1].length > 1) { ManyGroups = this.createGroups(List2[1][0], List2[1][1], StructureGroup[1]); ManyGroups = ManyGroups.concat(this.createGroups(List2[1][1], List2[1][0], StructureGroup[1])); for (var k = 0; k < ManyGroups.length; k++) { ListFinal[ListFinal.length] = Group.concat(ManyGroups[k]); } } else { Group = Group.concat(this.SelectHist(List2, StructureGroup[1][0])); ListFinal[ListFinal.length] = Group; } return ListFinal; }; Game_Synthesis.prototype.SelectHist = function(List, level) { var Hist = []; if (level === 0) { Hist = Hist.concat(List[0]); } else if (List[1].length !== 2) { Hist = []; } else { for (var k = 0; k < List[1].length; k++) { Hist = Hist.concat(this.SelectHist(List[1][k], level-1)); } } return Hist; }; Game_Synthesis.prototype.GetStructure = function(level) { if (level === 1) { return [0]; } var memberNumber = 1; var NumberLayer = 0; while (memberNumber * 2 <= level) { memberNumber = memberNumber*2; NumberLayer++; } if (memberNumber === level) { return [NumberLayer - 1,[NumberLayer - 1]]; } else { return [NumberLayer,this.GetStructure(level - memberNumber)]; } }; Game_Synthesis.prototype.checkConditionsOnGroup = function(ClassIdArray, Conditions) { var Result = !(ClassIdArray.length === Conditions.length); var ArrayTemp = []; ArrayTemp = ClassIdArray.slice(0); var ArraySorted = ArrayTemp.sort(function(a,b) { return a - b; }); var indexFixed = 0; var ArrayFixed = []; var ArrayFixedTemp = []; var ArrayFixedSorted = []; var indexReversed = 0; var ValueReversed = 0; if (!Result) { Result = Result || this.checkConditionsOnFormation(ArraySorted, Conditions); while (!Result) { indexFixed = ClassIdArray.length - 1; ArrayFixed = ArraySorted.slice(indexFixed); ArrayFixedTemp = ArrayFixed.slice(0); ArrayFixedSorted = ArrayFixedTemp.sort(function(a,b) { return b - a; }); while (ArrayFixed[0] >= ArrayFixedSorted[0]) { indexFixed--; if (indexFixed < 0) { break; } ArrayFixed = ArraySorted.slice(indexFixed); ArrayFixedTemp = ArrayFixed.slice(0); ArrayFixedSorted = ArrayFixedTemp.sort(function(a,b) { return b - a; }); } if (indexFixed < 0) { break; } ArrayFixed = ArraySorted.slice(indexFixed + 1).filter(function(value) { return value > ArraySorted[indexFixed]; }); ArrayFixedTemp = ArrayFixed.slice(0); ArrayFixedSorted = ArrayFixedTemp.sort(function(a,b) { return a - b; }); ValueReversed = ArrayFixedSorted[0]; indexReversed = ArraySorted.lastIndexOf(ValueReversed); ArraySorted[indexReversed] = ArraySorted[indexFixed]; ArraySorted[indexFixed] = ValueReversed; ArrayFixed = ArraySorted.slice(indexFixed + 1); ArrayFixedTemp = ArrayFixed.slice(0); ArrayFixedSorted = ArrayFixedTemp.sort(function(a,b) { return a - b; }); ArraySorted = ArraySorted.slice(0,indexFixed+1).concat(ArrayFixedSorted); Result = Result || this.checkConditionsOnFormation(ArraySorted, Conditions); } if (Result) { this._formulaUsed = ArraySorted; } } return Result; }; Game_Synthesis.prototype.checkConditionsOnFormation = function(ClassIdArray, Conditions) { var Result = (ClassIdArray.length === Conditions.length); if (Result) { for (var k = 0; k < Conditions.length; k++) { Result = Result && this.checkAllConditionsOnOne(ClassIdArray[k],Conditions[k]); if (!Result) { break; } } } return Result; }; Game_Synthesis.prototype.checkAllConditionsOnOne = function(ClassId, Conditions) { var Result = false; for (var k = 0; k < Conditions.length; k++) { Result = Result || this.checkConditionsOnOne(ClassId, Conditions[k]); if (Result) { break; } } return Result; }; Game_Synthesis.prototype.checkConditionsOnOne = function(ClassId, Conditions) { var Result = true; for (var k = 0; k < Conditions.length; k++) { Result = Result && this.checkSeveralConditions(ClassId, Conditions[k]); if (!Result) { break; } } return Result; }; Game_Synthesis.prototype.checkSeveralConditions = function(ClassId, Conditions) { var Result = false; for (var k = 0; k < Conditions[1].length; k++) { if (Conditions[0] === 'N') { Result = Result || this.checkNumberCondition(ClassId, Conditions[1][k]); } else if (Conditions[0] === 'S') { Result = Result || this.checkSizeCondition(ClassId, Conditions[1][k]); } else if (Conditions[0] === 'R') { Result = Result || this.checkRankCondition(ClassId, Conditions[1][k]); } else if (Conditions[0] === 'G') { Result = Result || this.checkGroupCondition(ClassId, Conditions[1][k]); } if (Result) { break; } } return Result; }; Game_Synthesis.prototype.checkNumberCondition = function(ClassId, value) { return ClassId === Number(value); }; Game_Synthesis.prototype.checkSizeCondition = function(ClassId, value) { return $dataClasses[ClassId].SizeClass === Number(value); }; Game_Synthesis.prototype.checkGroupCondition = function(ClassId, value) { return $dataClasses[ClassId].GroupClassId === Number(value); }; Game_Synthesis.prototype.checkRankCondition = function(ClassId, value) { return $dataClasses[ClassId].RankClassId === Number(value); }; Game_Synthesis.prototype.obtainSkillsetList = function(ActorId1, ActorId2) { var FirstList = []; var actor1 = $gameParty.members()[ActorId1]; var actor2 = $gameParty.members()[ActorId2]; for (var k = 0; k < actor1._skillsets.length; k++) { FirstList[FirstList.length] = {"id":actor1.SkillSetSlotId(k), "jobPoints":actor1.CurrentJobPoints(k)}; } for (var k = 0; k < actor2._skillsets.length; k++) { FirstList[FirstList.length] = {"id":actor2.SkillSetSlotId(k), "jobPoints":actor2.CurrentJobPoints(k)}; } FirstList = FirstList.sort(function(a, b) { return a.id - b.id; }); for (var k = 0; k < FirstList.length; k++) { if (this._skillsetList.length < 1) { this._skillsetList[this._skillsetList.length] = FirstList[k]; } else if (this._skillsetList[this._skillsetList.length - 1].id === FirstList[k].id) { this._skillsetList[this._skillsetList.length - 1].jobPoints += FirstList[k].jobPoints; } else { this._skillsetList[this._skillsetList.length] = FirstList[k]; } } for (var k = 0; k < this._skillsetList.length; k++) { this._skillsetList[k].jobPoints = Math.floor(Math.min(this._skillsetList[k].jobPoints * DQM.Param.RateSynthesisJobPointsAssigned / 100, $gameSkillset._data[this._skillsetList[k].id].list[$gameSkillset._data[this._skillsetList[k].id].list.length - 1].level)); } this.addSpecialSkillset(ActorId1, ActorId2); }; Game_Synthesis.prototype.addSpecialSkillset = function(actorId1, actorId2) { var actor1 = $gameParty.members()[actorId1]; var actor2 = $gameParty.members()[actorId2]; var FirstList = []; var id; var maxValueSkillset; for (var k = 0; k < actor1._skillsets.length; k++) { id = actor1.SkillSetSlotId(k); maxValueSkillset = actor1.GetSkillSetData(k).list[actor1.GetSkillSetData(k).list.length-1].level; if (maxValueSkillset === actor1.CurrentJobPoints(k)) { FirstList.push(id); } } for (var k = 0; k < actor2._skillsets.length; k++) { id = actor2.SkillSetSlotId(k); maxValueSkillset = actor2.GetSkillSetData(k).list[actor2.GetSkillSetData(k).list.length-1].level; if (maxValueSkillset === actor2.CurrentJobPoints(k)) { FirstList.push(id); } } FirstList = FirstList.sort(function(a, b) { return a - b; }); if (FirstList.length > 0) { for (var k = 0; k < DQM.Param.SkillsetSynthesisData.length; k++) { if (this.skillsetIsObtainable(DQM.Param.SkillsetSynthesisData[k], FirstList)) { this._skillsetList.push({"id":DQM.Param.SkillsetSynthesisData[k].id, "jobPoints":0}); } } } }; Game_Synthesis.prototype.skillsetIsObtainable = function(listComponent, FirstList) { var firstVerif = this._skillsetList.some(function(skillset) { return skillset.id === listComponent.id; }); if (firstVerif) { return false; } for (var k = 0; k < listComponent.required.length; k++) { firstVerif = FirstList.some(function(id) { return Number(listComponent.required[k]) === Number(id); }); if (!firstVerif) { return false; } } return true; }; //============================================================================= // Window_Base //============================================================================= Window_Base.prototype.drawActorJobPointsStatus = function(actor, x, y, width) { var lineHeight = this.lineHeight(); var x2 = x + 180; var width2 = Math.min(200, width - 180 - this.textPadding()); this.drawActorName(actor, x, y); this.drawActorLevel(actor, x, y + lineHeight * 1); this.drawActorIcons(actor, x, y + lineHeight * 2); this.drawActorClass(actor, x2, y); this.drawActorJobPoints(actor, x2, y + lineHeight * 1, width2); }; Window_Base.prototype.drawFace = function(faceName, faceIndex, x, y, width, height, faceHue) { faceHue = faceHue || 0; width = width || Window_Base._faceWidth; height = height || Window_Base._faceHeight; var bitmap = ImageManager.loadFace(faceName, faceHue); var pw = Window_Base._faceWidth; var ph = Window_Base._faceHeight; var sw = Math.min(width, pw); var sh = Math.min(height, ph); var dx = Math.floor(x + Math.max(width - pw, 0) / 2); var dy = Math.floor(y + Math.max(height - ph, 0) / 2); var sx = faceIndex % 4 * pw + (pw - sw) / 2; var sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2; this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy); }; Window_Base.prototype.drawActorFace = function(actor, x, y, width, height) { this.drawFace(actor.faceName(), actor.faceIndex(), x, y, width, height, actor.battlerHue()); }; Window_Base.prototype.drawActorJobPoints = function(actor, x, y) { this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.JobPointIcon, x, y, 48); this.resetTextColor(); this.drawText(actor._jobPoints, x + 84, y, 36, 'right'); }; Window_Base.prototype.drawBlockText = function(text, x, y, width, align) { var currentText = text; var newLine = null; var index = null; var yCurrent = y; var numberLine = 0; while (currentText.length > 0) { if (this.textWidth(currentText) <= width) { numberLine++; currentText = ''; } else { index = currentText.substr(1, width).lastIndexOf(' '); if (index === -1) { index = width-1; newLine = currentText.substr(0, index-1).concat('-'); } else { newLine = currentText.substr(0, index-1); } numberLine++; currentText = currentText.substr(index); } } currentText = text; yCurrent = yCurrent - ((numberLine) * this.lineHeight() /2); while (currentText.length > 0) { if (this.textWidth(currentText) <= width) { this.drawText(currentText, x, yCurrent, width, align); currentText = ''; } else { index = currentText.substr(1, width).lastIndexOf(' '); if (index === -1) { index = width-1; newLine = currentText.substr(0, index-1).concat('-'); } else { newLine = currentText.substr(0, index-1); } this.drawText(newLine, x, yCurrent, width, align); currentText = currentText.substr(index); yCurrent = yCurrent + this.lineHeight(); } } }; Window_Base.prototype.drawClassFace = function(classes, x, y, width, height) { this.drawFace(classes.faceName, classes.faceIndex, x, y, width, height, classes.battlerHue); }; Window_Base.prototype.drawVertLine = function(x, y, length) { this.contents.paintOpacity = 48; this.contents.fillRect(x, y, 2, length, this.lineColor()); this.contents.paintOpacity = 255; }; Window_Base.prototype.drawVertLineMax = function(x, y) { var length = this.contentsHeight() - y; this.drawVertLine(x, y, length); }; Window_Base.prototype.drawVertLineCenterMax = function(y) { var x = this.contentsWidth() / 2; this.drawVertLineMax(x, y); }; Window_Base.prototype.lineColor = function() { return this.normalColor(); }; //============================================================================= // Window_Command //============================================================================= //============================================================================= // Window_MenuCommand //============================================================================= DQM.Core.Window_MenuCommand_addOriginalCommands = Window_MenuCommand.prototype.addOriginalCommands; Window_MenuCommand.prototype.addOriginalCommands = function() { DQM.Core.Window_MenuCommand_addOriginalCommands.call(this); if (DQM.Param.BookListAccessMainMenu || ($gameParty._allMembers && DQM.Param.BookListAccessMainMenuEvent)) { this.addCommand(DQM.Param.BookListNameCommand, 'SkillsetBook', true); } this.addCommand(DQM.Param.JobPointName, 'JobPoints', true); if (DQM.Param.SynthesisAccessMainMenu || ($gameParty._allMembers && DQM.Param.SynthesisAccessMainMenuEvent)) { this.addCommand(DQM.Param.SynthesisName, 'SynthesisActor', true); } if (DQM.Param.RenameAccessMainMenu || ($gameParty._allMembers && DQM.Param.RenameAccessMainMenuEvent)) { this.addCommand(DQM.Param.RenameMainMenuName, 'Rename', true); } this.addCommand(DQM.Param.StrategyName, 'Strategy', true); }; //============================================================================= // Window_BookList //============================================================================= function Window_BookList() { this.initialize.apply(this, arguments); } Window_BookList.prototype = Object.create(Window_Command.prototype); Window_BookList.prototype.constructor = Window_BookList; Window_BookList.prototype.initialize = function(x, y) { Window_Command.prototype.initialize.call(this, x, y); this.selectLast(); }; Window_BookList._lastCommandSymbol = null; Window_BookList.initCommandPosition = function() { this._lastCommandSymbol = null; }; Window_BookList.prototype.windowWidth = function() { return 240; }; Window_BookList.prototype.numVisibleRows = function() { return this.maxItems(); }; Window_BookList.prototype.makeCommandList = function() { if ($gameSystem.getMaxSkillsetsExisting() > 0) { this.addCommand(DQM.Param.SkillsetBookNameCommand, 'SkillsetList', true); } if ($gameSystem.getMaxMonstersExisting() > 0) { this.addCommand(DQM.Param.MonsterBookNameCommand, 'MonsterList', true); } if ($gameSystem.getMaxAttributesExisting() > 0) { this.addCommand(DQM.Param.AttributeBookNameCommand, 'AttributeList', true); } }; Window_BookList.prototype.processOk = function() { Window_BookList._lastCommandSymbol = this.currentSymbol(); Window_Command.prototype.processOk.call(this); }; Window_BookList.prototype.selectLast = function() { this.selectSymbol(Window_BookList._lastCommandSymbol); }; //============================================================================= // Window_SkillsetList //============================================================================= function Window_SkillsetList() { this.initialize.apply(this, arguments); } Window_SkillsetList.prototype = Object.create(Window_Command.prototype); Window_SkillsetList.prototype.constructor = Window_SkillsetList; Window_SkillsetList.prototype.initialize = function(x, y) { Window_Command.prototype.initialize.call(this, x, y); this._actor = null; }; Window_SkillsetList.prototype.windowWidth = function() { return 240; }; Window_SkillsetList.prototype.setActor = function(actor) { if (this._actor !== actor) { this._actor = actor; this.refresh(); this.selectLast(); } }; Window_SkillsetList.prototype.numVisibleRows = function() { return 4; }; Window_SkillsetList.prototype.makeCommandList = function() { if (this._actor) { var skillsets = this._actor._skillsets; skillsets.forEach(function(skillset) { var index = this._actor._skillsets.indexOf(skillset); var name = $gameSkillset._data[skillset.id].name; var enabled = this._actor.MaxJobPointsUsableSlot(index) > 0; this.addCommand(name, 'skill', enabled, index); }, this); } }; Window_SkillsetList.prototype.update = function() { Window_Command.prototype.update.call(this); if (this._skillWindow) { this._skillWindow.setIndex(this.currentExt()); } }; Window_SkillsetList.prototype.setSkillWindow = function(skillWindow) { this._skillWindow = skillWindow; this.update(); }; Window_SkillsetList.prototype.cursorLeft = function(wrap) { var maxCols = this._skillWindow.maxPagNum(); if (maxCols >= 2 && wrap) { this._skillWindow.setPagNum(this._skillWindow._pagnum - 1); } }; Window_SkillsetList.prototype.cursorRight = function(wrap) { var maxCols = this._skillWindow.maxPagNum(); if (maxCols >= 2 && wrap) { this._skillWindow.setPagNum(this._skillWindow._pagnum + 1); } }; Window_SkillsetList.prototype.selectLast = function() { var skill = this._actor.lastMenuSkill(); if (skill) { this.selectExt(skill.stypeId); } else { this.select(0); } }; //============================================================================= // Window_SynthesisActor //============================================================================= function Window_SynthesisActor() { this.initialize.apply(this, arguments); } Window_SynthesisActor.prototype = Object.create(Window_MenuStatus.prototype); Window_SynthesisActor.prototype.constructor = Window_SynthesisActor; Window_SynthesisActor.prototype.initialize = function(x, y, width, height) { Window_Selectable.prototype.initialize.call(this, x, y, width, height); this._formationMode = false; this._pendingIndex = -1; this._index1 = -1; this._index2 = -1; this._rankValueAdded = 0; this.loadImages(); this.refresh(); }; Window_SynthesisActor.prototype.updateRankValueAdded = function() { if (this.isAllSelected()) { var rank1 = $gameParty.members()[this.getRealIndex(0)]._rankValueAdded; var rank2 = $gameParty.members()[this.getRealIndex(1)]._rankValueAdded; this._rankValueAdded = rank1 + rank2 + 1; } else { this._rankValueAdded = 0; } this.refresh(); }; Window_SynthesisActor.prototype.isAllSelected = function() { return ((this._index1 > -1) && (this._index2 > -1)); }; Window_SynthesisActor.prototype.maxCols = function() { return (this.maxItems() > 2) ? 2 : 1; }; Window_SynthesisActor.prototype.maxItems = function() { return 2 + this.getListResult().length; }; Window_SynthesisActor.prototype.itemRect = function(index) { var rect = new Rectangle(); var maxCols = this.maxCols(); rect.width = this.itemWidth() / (3 - this.maxCols()); rect.height = this.itemHeight(); if (index < 2) { rect.x = 0; rect.y = index * (rect.height * 2) + Math.floor(rect.height / 2); } else { rect.x = (rect.width + this.spacing()) - this._scrollX; rect.y = (index - 2) * rect.height - this._scrollY; } return rect; }; Window_SynthesisActor.prototype.setTopRow = function(row) { var scrollY = (row - 1 - this.numVisibleRows()).clamp(0, Math.max(0,this.getListResult().length - this.numVisibleRows())) * this.itemHeight(); if (this._scrollY !== scrollY) { this._scrollY = scrollY; this.refresh(); this.updateCursor(); } }; Window_SynthesisActor.prototype.cursorDown = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (index < 2) { this.select((index + 1) % 2); } else if (index > 1 && this.getListResult().length > 0) { this.select(2 + ((index - 1 + this.getListResult().length) % this.getListResult().length)); this.setTopRow(this.index() + 1); } }; Window_SynthesisActor.prototype.cursorUp = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (index < 2) { this.select((index + 1) % 2); } else if (index > 1 && this.getListResult().length > 0) { this.select(2 + ((index - 3 + this.getListResult().length) % this.getListResult().length)); this.setTopRow(this.index() + 2); } }; Window_SynthesisActor.prototype.cursorRight = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (this.maxItems() > 2) { if (index < 2) { this.select(2 + (index % this.getListResult().length)); } else if (index > 1) { this.select(Math.min(index - 2, 1)); } } }; Window_SynthesisActor.prototype.cursorLeft = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (this.maxItems() > 2) { if (index < 2) { this.select(2 + (index % this.getListResult().length)); } else if (index > 1) { this.select(Math.min(index - 2, 1)); } } }; Window_SynthesisActor.prototype.setNewIndex = function(index, NewIndex) { if (index === 0) { this._index1 = NewIndex; } else if (index === 1) { this._index2 = NewIndex; } this.refresh(); }; Window_SynthesisActor.prototype.getRealIndex = function(index) { if (index === 0) { return this._index1; } else if (index === 1) { return this._index2; } else { return this.getListResult()[index-2]; } }; Window_SynthesisActor.prototype.getListResult = function() { return $gameSynthesis._classicData.concat($gameSynthesis._specialData.map(function(result) { return result.idResult; })); }; Window_SynthesisActor.prototype.loadImages = function() { $gameSynthesis._classicData.concat($gameSynthesis._specialData.map(function(result) { return result.idResult; })).forEach(function(index) { ImageManager.loadFace($dataClasses[index].faceName); }, this); }; Window_SynthesisActor.prototype.drawItemBackground = function(index) { if (index < 2) { Window_MenuStatus.prototype.drawItemBackground.call(this, index); var rect = this.itemRect(index); var color = this.normalColor(); this.contents.fillRect(rect.x, rect.y, rect.width, 2, color); this.contents.fillRect(rect.x, rect.y, 2, rect.height, color); this.contents.fillRect(rect.x, rect.y + rect.height - 2, rect.width, 2, color); this.contents.fillRect(rect.x + rect.width - 2, rect.y, 2, rect.height, color); } else { if (index === this._pendingIndex) { var rect = this.itemRect(index); var color = this.pendingColor(); this.contents.fillRect(rect.x, rect.y, rect.width, rect.height, color); } } }; Window_SynthesisActor.prototype.drawItemImage = function(index) { var realIndex = this.getRealIndex(index); if (index < 2) { if (realIndex > -1) { var actor = $gameParty.members()[realIndex]; var rect = this.itemRect(index); this.drawActorFace(actor, rect.x + 1, rect.y + 1, 144, rect.height - 2); } } else { var classes = $dataClasses[realIndex]; var rect = this.itemRect(index); this.changePaintOpacity(false); this.drawClassFace(classes, rect.x + 1, rect.y + 1, 144, rect.height - 2); this.changePaintOpacity(true); } }; Window_SynthesisActor.prototype.drawItemStatus = function(index) { var realIndex = this.getRealIndex(index); if (index < 2) { if (realIndex > -1) { var actor = $gameParty.members()[realIndex]; var rect = this.itemRect(index); var x = rect.x + 162; var y = rect.y + rect.height / 2 - this.lineHeight() * 1.5; var width = rect.width - x - this.textPadding(); this.drawActorSynthesisStatus(actor, x, y, width); } else { var rect = this.itemRect(index); var x = rect.x + 6; var y = rect.y + (rect.height / 2); var width = rect.width - 12; this.drawBlockText(DQM.Param.DisplayNoMonsterSelectedSynthesis, x, y, width, 'center'); } } else { var classes = $dataClasses[realIndex]; var rect = this.itemRect(index); var x = rect.x + 162; var y = rect.y + rect.height / 2 - this.lineHeight() * 1.5; var width = rect.width - x - this.textPadding(); this.drawClassSimpleStatus(classes, x, y); } }; Window_SynthesisActor.prototype.drawActorSynthesisStatus = function(actor, x, y, width) { var lineHeight = this.lineHeight(); this.drawActorName(actor, x, y); this.drawActorLevel(actor, x, y + lineHeight * 1); this.drawActorRank(actor, x, y + lineHeight * 2, width); }; Window_SynthesisActor.prototype.drawActorRank = function(actor, x, y, width) { width = width || 168; this.resetTextColor(); var text = actor.currentClass().name.concat(' ').concat(actor.RankClass()); if (actor._rankValueAdded > 0) { text = text.concat('+').concat(actor._rankValueAdded); } this.drawText(text, x, y, width); }; Window_SynthesisActor.prototype.refresh = function() { this.loadImages(); this.refreshSynthesisList(); this.drawOthersItems(); Window_MenuStatus.prototype.refresh.call(this); }; Window_SynthesisActor.prototype.drawClassSimpleStatus = function(classes, x, y) { var lineHeight = this.lineHeight(); this.drawClassName(classes, x, y); this.drawClassRank(classes, x, y + lineHeight * 1); }; Window_SynthesisActor.prototype.drawClassName = function(classes, x, y, width) { width = width || 168; this.resetTextColor(); this.drawText(classes.name, x, y, width); }; Window_SynthesisActor.prototype.drawClassRank = function(classes, x, y, width) { width = width || 168; var text = DQM.Param.RankClassList[classes.RankClassId]; if (this._rankValueAdded > 0) { text = text.concat('+').concat(this._rankValueAdded); } this.resetTextColor(); this.drawText(text, x, y, width); }; Window_SynthesisActor.prototype.drawOthersItems = function() { this.resetTextColor(); var x = this.width / 4 - this.textWidth('+'); var y = this.height / 2 - 30; this.drawText('+', x, y); this.drawVertLineCenterMax(0); }; Window_SynthesisActor.prototype.refreshSynthesisList = function() { if (this.isAllSelected()) { $gameSynthesis.update(this._index1, this._index2); } else { $gameSynthesis.initialize(); } }; Window_SynthesisActor.prototype.processOk = function() { Window_Selectable.prototype.processOk.call(this); }; Window_SynthesisActor.prototype.drawAllItems = function() { this.drawItem(0); this.drawItem(1); var topIndex = 2 + this.topRow(); for (var i = 0; i < this.numVisibleRows(); i++) { var index = topIndex + i; if (index < this.maxItems()) { this.drawItem(index); } } }; Window_SynthesisActor.prototype.isCursorVisible = function() { if ([0,1].contains(this.index())) { return true; } else { return (this.index() >= (this.topRow() + 2) && (this.index() <= (this.bottomRow() + 2))); } }; //============================================================================= // Window_SynthesisResult //============================================================================= function Window_SynthesisResult() { this.initialize.apply(this, arguments); } Window_SynthesisResult.prototype = Object.create(Window_Selectable.prototype); Window_SynthesisResult.prototype.constructor = Window_SynthesisResult; Window_SynthesisResult.prototype.initialize = function(x, y) { var height = this.itemHeight(); var width = Graphics.boxWidth; Window_Selectable.prototype.initialize.call(this, x, y, width, height); this._classId = -1; this.refresh(); }; Window_SynthesisResult.prototype.setClassId = function(classId) { this._classId = classId; this.refresh(); }; Window_SynthesisResult.prototype.itemHeight = function() { return 190; }; Window_SynthesisResult.prototype.itemRect = function() { var rect = new Rectangle(); rect.width = this.width; rect.height = this.itemHeight(); rect.x = 0; rect.y = -20; return rect; }; Window_SynthesisResult.prototype.drawItemImage = function() { if (this._classId > 0) { var classes = $dataClasses[this._classId]; var rect = this.itemRect(); this.changePaintOpacity(false); this.drawClassFace(classes, rect.x + 1, rect.y + 1, 144, rect.height - 2); this.changePaintOpacity(true); } }; Window_SynthesisResult.prototype.drawItemStatus = function() { if (this._classId > 0) { var classes = $dataClasses[this._classId]; var rect = this.itemRect(); var x = rect.x + 162; var y = rect.y + rect.height / 2 - this.lineHeight() * 1.5; var width = rect.width - x - this.textPadding(); this.drawClassSimpleStatus(classes, x, y); } }; Window_SynthesisResult.prototype.refresh = function() { if (this.contents) { this.contents.clear(); this.drawItemImage(); this.drawItemStatus(); } }; Window_SynthesisResult.prototype.drawClassSimpleStatus = function(classes, x, y) { var lineHeight = this.lineHeight(); this.drawClassName(classes, x, y); this.drawClassRank(classes, x, y + lineHeight * 1); }; Window_SynthesisResult.prototype.drawClassName = function(classes, x, y, width) { width = width || 168; this.resetTextColor(); this.drawText(classes.name, x, y, width); }; Window_SynthesisResult.prototype.drawClassRank = function(classes, x, y, width) { width = width || 168; var text = DQM.Param.RankClassList[classes.RankClassId]; if (this._rankValueAdded > 0) { text = text.concat('+').concat(this._rankValueAdded); } this.resetTextColor(); this.drawText(text, x, y, width); }; //============================================================================= // Window_PlayerStatus //============================================================================= function Window_PlayerStatus() { this.initialize.apply(this, arguments); } Window_PlayerStatus.prototype = Object.create(Window_Base.prototype); Window_PlayerStatus.prototype.constructor = Window_PlayerStatus; Window_PlayerStatus.prototype.initialize = function(x, y) { var width = this.windowWidth(); var height = this.windowHeight(); Window_Base.prototype.initialize.call(this, x, y, width, height); this.loadImages(); this.refresh(); }; Window_PlayerStatus.prototype.windowWidth = function() { return Graphics.boxWidth - 240; }; Window_PlayerStatus.prototype.windowHeight = function() { return Graphics.boxHeight; }; Window_PlayerStatus.prototype.loadImages = function() { ImageManager.loadFace(DQM.Param.playerFace.faceName); }; Window_PlayerStatus.prototype.refresh = function() { this.contents.clear(); this.drawPlayerData(); this.drawGoldValue(); this.drawBookStatus(); this.drawTeamStats(); }; Window_PlayerStatus.prototype.drawPlayerData = function() { var lineHeight = this.lineHeight(); this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.DisplayNamePlayer, 1, lineHeight / 2, this.windowWidth() - 150, 'center'); this.resetTextColor(); this.drawText($gameParty._namePlayer, 1, lineHeight / 2 * 3, this.windowWidth() - 150, 'center'); this.drawFace(DQM.Param.playerFace.faceName, DQM.Param.playerFace.faceIndex, this.windowWidth() - 200, 1, 197, 250); }; Window_PlayerStatus.prototype.drawGoldValue = function() { var lineHeight = this.lineHeight(); this.drawText(String($gameParty.gold()).concat(TextManager.currencyUnit), 1, lineHeight * 3, this.windowWidth() - 5, 'left'); }; Window_PlayerStatus.prototype.drawBookStatus = function() { var lineHeight = this.lineHeight(); var y = lineHeight * 6; if ($gameSystem.getMaxMonstersExisting() > 0) { y = y + lineHeight; this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.DisplayResultMonsterEncountered, 1, y, this.windowWidth() / 2 - 5, 'left'); this.resetTextColor(); if ($gameSystem.getPercentMonsterEncountered() === 100) { this.changeTextColor(this.powerUpColor()); } this.drawText(DQM.Param.DisplayBookDataAsPercent ? String($gameSystem.getPercentMonsterEncountered()).concat('%') : String($gameSystem.getMaxMonstersEncountered()).concat('/').concat(String($gameSystem.getMaxMonstersExisting())), this.windowWidth() / 2 + 5, y, this.windowWidth() / 2 - 10, 'left'); this.resetTextColor(); y = y + lineHeight; this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.DisplayResultMonsterRecruited, 1, y, this.windowWidth() / 2 - 5, 'left'); this.resetTextColor(); if ($gameSystem.getPercentMonsterRecruited() === 100) { this.changeTextColor(this.powerUpColor()); } this.drawText(DQM.Param.DisplayBookDataAsPercent ? String($gameSystem.getPercentMonsterRecruited()).concat('%') : String($gameSystem.getMaxMonstersRecruited()).concat('/').concat(String($gameSystem.getMaxMonstersExisting())), this.windowWidth() / 2 + 5, y, this.windowWidth() / 2 - 10, 'left'); this.resetTextColor(); } if ($gameSystem.getMaxSkillsetsExisting() > 0) { y = y + lineHeight; this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.DisplayResultSkillsetDiscovered, 1, y, this.windowWidth() / 2 - 5, 'left'); this.resetTextColor(); if ($gameSystem.getPercentSkillsetDiscovered() === 100) { this.changeTextColor(this.powerUpColor()); } this.drawText(DQM.Param.DisplayBookDataAsPercent ? String($gameSystem.getPercentSkillsetDiscovered()).concat('%') : String($gameSystem.getMaxSkillsetDiscovered()).concat('/').concat(String($gameSystem.getMaxSkillsetsExisting())), this.windowWidth() / 2 + 5, y, this.windowWidth() / 2 - 10, 'left'); this.resetTextColor(); y = y + lineHeight; this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.DisplayResultSkillsetMastered, 1, y, this.windowWidth() / 2 - 5, 'left'); this.resetTextColor(); if ($gameSystem.getPercentSkillsetMastered() === 100) { this.changeTextColor(this.powerUpColor()); } this.drawText(DQM.Param.DisplayBookDataAsPercent ? String($gameSystem.getPercentSkillsetMastered()).concat('%') : String($gameSystem.getMaxSkillsetMastered()).concat('/').concat(String($gameSystem.getMaxSkillsetsExisting())), this.windowWidth() / 2 + 5, y, this.windowWidth() / 2 - 10, 'left'); this.resetTextColor(); } if ($gameSystem.getMaxAttributesExisting() > 0) { y = y + lineHeight; this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.DisplayResultAttributeDiscovered, 1, y, this.windowWidth() / 2 - 5, 'left'); this.resetTextColor(); if ($gameSystem.getPercentAttributeDiscovered() === 100) { this.changeTextColor(this.powerUpColor()); } this.drawText(DQM.Param.DisplayBookDataAsPercent ? String($gameSystem.getPercentAttributeDiscovered()).concat('%') : String($gameSystem.getMaxAttributeDiscovered()).concat('/').concat(String($gameSystem.getMaxAttributesExisting())), this.windowWidth() / 2 + 5, y, this.windowWidth() / 2 - 10, 'left'); this.resetTextColor(); } }; Window_PlayerStatus.prototype.drawTeamStats = function() { var lineHeight = this.lineHeight(); var y = lineHeight * 13; this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.NameStockageSystem, 1, y, this.windowWidth() / 2 - 5, 'left'); this.resetTextColor(); if ($gameSystem._maxBattlers !==0 && $gameParty.sizeTeam($gameParty.stockageId()) >= $gameSystem._maxBattlers) { this.changeTextColor(this.powerDownColor()); } else if ($gameSystem._maxBattlers !==0 && $gameParty.sizeTeam($gameParty.stockageId()) >= $gameSystem._maxBattlers * 9 / 10) { this.changeTextColor(this.deathColor()); } this.drawText($gameSystem._maxBattlers !== 0 ? String($gameParty.sizeTeam($gameParty.stockageId())).concat('/').concat(String($gameSystem._maxBattlers)) : String($gameParty.sizeTeam($gameParty.stockageId())), this.windowWidth() / 2 + 5, y, this.windowWidth() / 2 - 10, 'left'); this.resetTextColor(); if ($gameSystem._maxSupplementaryTeam !== -1) { y = y + lineHeight; this.changeTextColor(this.systemColor()); this.drawText(DQM.Param.NameSupplementaryTeam, 1, y, this.windowWidth() / 2 - 5, 'left'); this.resetTextColor(); this.drawText(String($gameSystem._maxSupplementaryTeam), this.windowWidth() / 2 + 5, y, this.windowWidth() / 2 - 10, 'left'); } }; //============================================================================= // Window_SynthesisSelect //============================================================================= function Window_SynthesisSelect() { this.initialize.apply(this, arguments); } Window_SynthesisSelect.prototype = Object.create(Window_MenuStatus.prototype); Window_SynthesisSelect.prototype.constructor = Window_SynthesisSelect; Window_SynthesisSelect.prototype.initialize = function(x, y) { Window_MenuStatus.prototype.initialize.call(this, x, y); this._genderValue = null; this._neutralAuthorized = false; this.loadImages(); this.refresh(); }; Window_SynthesisSelect.prototype.getListActor = function() { var defaultList = $gameParty.members(); if (!this._genderValue) { return []; } var GenderList = [this._genderValue]; if (this._neutralAuthorized) { GenderList.push(0); } var ResultList = defaultList.filter(function(actor) { for (var k = 0; k < GenderList.length; k++) { if (GenderList[k] === actor._gender && (!DQM.Param.MinLevelToBeUsedInSynthesis || actor._level >= DQM.Param.MinLevelToBeUsedInSynthesis)) { return true; } } return false; }); return ResultList; }; Window_SynthesisSelect.prototype.maxItems = function() { return this.getListActor().length; }; Window_SynthesisSelect.prototype.getRealActor = function(index) { return this.getListActor()[index]; }; Window_SynthesisSelect.prototype.getRealIndex = function() { var index = this.index(); var actor = this.getRealActor(index); return $gameParty.members().indexOf(actor); }; Window_SynthesisSelect.prototype.drawItemBackground = function(index) { if (index === this._pendingIndex) { var rect = this.itemRect(index); var color = this.pendingColor(); this.changePaintOpacity(false); this.contents.fillRect(rect.x, rect.y, rect.width, rect.height, color); this.changePaintOpacity(true); } }; Window_SynthesisSelect.prototype.drawItemImage = function(index) { var actor = this.getRealActor(index); var rect = this.itemRect(index); this.changePaintOpacity(actor.isBattleMember()); this.drawActorFace(actor, rect.x + 1, rect.y + 1, 144, rect.height - 2); this.changePaintOpacity(true); }; Window_SynthesisSelect.prototype.drawItemStatus = function(index) { var actor = this.getRealActor(index); var rect = this.itemRect(index); var x = rect.x + 162; var y = rect.y + rect.height / 2 - this.lineHeight() * 1.5; var width = rect.width - x - this.textPadding(); this.drawActorSimpleStatus(actor, x, y, width); }; Window_SynthesisSelect.prototype.processOk = function() { Window_Selectable.prototype.processOk.call(this); }; //============================================================================= // Window_SkillsetSelect //============================================================================= function Window_SkillsetSelect() { this.initialize.apply(this, arguments); } Window_SkillsetSelect.prototype = Object.create(Window_Command.prototype); Window_SkillsetSelect.prototype.constructor = Window_SkillsetSelect; Window_SkillsetSelect.prototype.initialize = function(x, y, width, height) { this._skillsetList = []; this._scrollY2 = 0; this._numAdded = -1; this._isForSynthesis = false; this._actor = null; this._newSkillset = null; this.clearCommandList(); this.makeCommandList(); Window_Selectable.prototype.initialize.call(this, x, y, width, height); this.refresh(); this.select(0); }; Window_SkillsetSelect.prototype.itemHeight = function() { return this.lineHeight(); }; Window_SkillsetSelect.prototype.itemWidth = function() { return this.width / 5; }; Window_SkillsetSelect.prototype.maxItems = function() { return this._skillsetList.length + 2; }; Window_SkillsetSelect.prototype.maxCols = function() { return 2; }; Window_SkillsetSelect.prototype.numVisibleRows = function() { if (this._isForSynthesis && !this._actor) { return (this.height - (4 * this.lineHeight())) / this.lineHeight(); } else { return (this.height - (9 * this.lineHeight())) / this.lineHeight(); } }; Window_SkillsetSelect.prototype.listToAdd = function() { return this._skillsetList.slice(this._numAdded); }; Window_SkillsetSelect.prototype.listAdded = function() { return this._skillsetList.slice(0, this._numAdded); }; Window_SkillsetSelect.prototype.cursorDown = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (index < (this._numAdded - 1)) { this.select(index + 1); } else if (index === (this._numAdded - 1)) { this.select(this.maxItems() - 1); } else if (index < this.maxItems() - 3) { this.select(index + 1); } else if (index === (this.maxItems() - 3)) { this.select(this.maxItems() - 2); } else if (index === (this.maxItems() - 2)) { if (this.listToAdd().length > 0) { this.select(this._numAdded); } } else if (index === (this.maxItems() - 1)) { if (this.listAdded().length > 0) { this.select(0); } } }; Window_SkillsetSelect.prototype.cursorUp = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (index === (this.maxItems() - 1)) { if (this.listAdded().length > 0) { this.select(this._numAdded - 1); } } else if (index === (this.maxItems() - 2)) { if (this.listToAdd().length > 0) { this.select(this.maxItems() - 3); } } else if (index > this._numAdded) { this.select(index - 1); } else if (index === (this._numAdded)) { this.select(this.maxItems() - 2); } else if (index > 0) { this.select(index - 1); } else if (index === 0) { this.select(this.maxItems() - 1); } }; Window_SkillsetSelect.prototype.cursorRight = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (index === (this.maxItems() - 1)) { this.select(this.maxItems() - 2); } else if (index === (this.maxItems() - 2)) { this.select(this.maxItems() - 1); } else if (index >= this._numAdded) { if (this.listAdded().length > 0) { this.select(Math.min(this._numAdded - 1, index - this._numAdded)); } } else if (index >= 0) { if (this.listToAdd().length > 0) { this.select(Math.min(index + this._numAdded, this.maxItems() - 3)); } } }; Window_SkillsetSelect.prototype.cursorLeft = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (index === (this.maxItems() - 1)) { this.select(this.maxItems() - 2); } else if (index === (this.maxItems() - 2)) { this.select(this.maxItems() - 1); } else if (index >= this._numAdded) { if (this.listAdded().length > 0) { this.select(Math.min(this._numAdded - 1, index - this._numAdded)); } } else if (index >= 0) { if (this.listToAdd().length > 0) { this.select(Math.min(index + this._numAdded, this.maxItems() - 3)); } } }; Window_SkillsetSelect.prototype.addListToAdd = function(newList) { var prvListAdded = this.listAdded(); this._skillsetList = prvListAdded.concat(newList); this._numAdded = prvListAdded.length; this.refresh(); }; Window_SkillsetSelect.prototype.addListAdded = function(newList) { var prvListAdded = this.listToAdd(); this._skillsetList = newList.concat(prvListAdded); this._numAdded = newList.length; this.refresh(); }; Window_SkillsetSelect.prototype.addToAdded = function(index) { var skillSet = this._skillsetList[index]; var oldListAdded = this.listAdded(); var oldListToAdd = this.listToAdd(); var realIndex = oldListToAdd.indexOf(skillSet); oldListToAdd.splice(realIndex, 1); this.addListToAdd(oldListToAdd); this.addListAdded(oldListAdded.concat(skillSet)); }; Window_SkillsetSelect.prototype.removeFromAdded = function(index) { var skillSet = this._skillsetList[index]; var oldListAdded = this.listAdded(); var oldListToAdd = this.listToAdd(); var realIndex = oldListAdded.indexOf(skillSet); oldListAdded.splice(realIndex, 1); this.addListToAdd(oldListToAdd.concat(skillSet)); this.addListAdded(oldListAdded); }; Window_SkillsetSelect.prototype.isSkillsetAdded = function(index) { return (index < this._numAdded); }; Window_SkillsetSelect.prototype.isSkillsetToAdd = function(index) { return (index >= this._numAdded && index < (this._list.length - 2)); }; Window_SkillsetSelect.prototype.isOk = function(index) { return (index === this._list.length - 2); }; Window_SkillsetSelect.prototype.isCancel = function(index) { return (index === this._list.length - 1); }; Window_SkillsetSelect.prototype.selectOkEnabled = function() { return true; }; Window_SkillsetSelect.prototype.selectCancelEnabled = function() { return true; }; Window_SkillsetSelect.prototype.setActor = function(actor) { this._actor = actor; this.addListAdded(this._actor._skillsets); }; Window_SkillsetSelect.prototype.setNewSkillset = function(skillset) { this._newSkillset = skillset; this.addListToAdd(skillset); }; Window_SkillsetSelect.prototype.makeCommandList = function() { for (var k = 0; k < this._skillsetList.length; k++) { var command; if (this.isSkillsetAdded(k)) { command = 'remove'; } else { command = 'add'; } var name = $gameSkillset._data[this._skillsetList[k].id].name; this.addCommand(name, command, true, this._skillsetList[k].id); } var textOk; if (this._isForSynthesis) { textOk = DQM.Param.SynthesisName; } else { textOk = DQM.Param.SkillsetConfirm; } this.addCommand(textOk, 'ok', this.selectOkEnabled()); this.addCommand(TextManager.cancel, 'cancel', this.selectCancelEnabled()); }; Window_SkillsetSelect.prototype.allItemsRect = function(toAdd) { var rect = new Rectangle(); rect.width = this.itemWidth(); rect.height = this.itemHeight() * this.numVisibleRows(); var index; var scroll; if (toAdd) { index = this._numAdded; scroll = this._scrollY; } else { index = 0; scroll = this._scrollY2; } var smallRect = this.itemRect(index); rect.x = smallRect.x; rect.y = smallRect.y + scroll; return rect; }; Window_SkillsetSelect.prototype.drawOthersItems = function() { var height = this.itemHeight() * this.numVisibleRows(); var width = this.itemWidth(); var x = this.itemWidth(); var y = 0; if (!this._isForSynthesis && this._actor) { y = y + 5 * this.lineHeight(); height = height - 5 * this.lineHeight(); } this.drawTable(x, y, width, height, DQM.Param.SkillsetToRemoveListName); x = this.itemWidth() * 3; this.drawTable(x, y, width, height, DQM.Param.SkillsetToAddListName); }; Window_SkillsetSelect.prototype.drawTable = function(x, y, width, height, text) { this.drawText(text, x, y, width, 'center'); var color = this.normalColor(); this.contents.fillRect(x, y + this.itemHeight(), width, 2, color); this.contents.fillRect(x, y + this.itemHeight(), 2, height, color); this.contents.fillRect(x, y + this.itemHeight() + height - 2, width, 2, color); this.contents.fillRect(x + width - 2, y + this.itemHeight(), 2, height, color); }; Window_SkillsetSelect.prototype.itemRect = function(index) { var rect = new Rectangle(); rect.width = this.itemWidth(); rect.height = this.itemHeight(); if (this.isOk(index)) { rect.x = this.itemWidth() + this.spacing(); rect.y = this.height - (2 * rect.height); } else if (this.isCancel(index)) { rect.x = this.itemWidth() * 3 - this.spacing(); rect.y = this.height - (2 * rect.height); } else if (this.isSkillsetAdded(index)) { rect.x = this.itemWidth() * 3; rect.y = (index + 1) * rect.height - this._scrollY; } else { rect.x = this.itemWidth(); rect.y = (index - this.listAdded().length + 1) * rect.height - this._scrollY2; } if (!this._isForSynthesis && this._actor && !this.isOk(index) && !this.isCancel(index)) { rect.y = rect.y + 5 * this.lineHeight(); } return rect; }; Window_SkillsetSelect.prototype.drawActorDatas = function() { this.drawItemImage(); this.drawItemStatus(); }; Window_SkillsetSelect.prototype.drawItemImage = function() { var actor = this._actor; this.changePaintOpacity(actor.isBattleMember()); this.drawActorFace(actor, 1, 1, 144, (this.lineHeight() * 5) - 2); this.changePaintOpacity(true); }; Window_SkillsetSelect.prototype.drawItemStatus = function() { var actor = this._actor; var x = 163; var y = 1 + this.lineHeight() * 1; var width = this.contentsWidth() - x - this.textPadding(); this.drawActorSimpleStatus(actor, x, y, width); }; Window_SkillsetSelect.prototype.drawAllItems = function() { if (!this._isForSynthesis && this._actor) { this.drawActorDatas(); } var topIndex = Math.floor(this._scrollY / this.itemHeight()); for (var i = 0; i < Math.min(this.numVisibleRows(),this.listToAdd().length); i++) { var index = topIndex + i; if (index < this.maxItems()) { this.drawItem(index); } } topIndex = this.listToAdd().length + Math.floor(this._scrollY2 / this.itemHeight()); for (var i = 0; i < Math.min(this.numVisibleRows(), this.listAdded().length); i++) { var index = topIndex + i; if (index < this.maxItems()) { this.drawItem(index); } } this.drawItem(this.maxItems() - 2); this.drawItem(this.maxItems() - 1); this.drawOthersItems(); }; Window_SkillsetSelect.prototype.drawItem = function(index) { var rect = this.itemRectForText(index); this.resetTextColor(); this.changePaintOpacity(this.isCommandEnabled(index)); if (this.isOk(index) || this.isCancel(index)) { this.drawText(this.commandName(index), rect.x, rect.y, rect.width, 'center'); } else { var currentPoint = this._skillsetList[index].jobPoints; var maxPoints; var skillsetData = $gameSkillset._data[this._list[index].ext]; var jobPointsMax = skillsetData.list[skillsetData.list.length-1].level; if ($gameSystem.isInSkillSetBook(skillsetData)) { if ($gameSystem._skillSetBookFlags[skillsetData.id].LevelMax === jobPointsMax) { maxPoints = jobPointsMax; } else { maxPoints = DQM.Param.UnknownLevel; } } else { maxPoints = DQM.Param.UnknownLevel; } this.drawText(this.commandName(index).concat(' ').concat(currentPoint).concat('/').concat(maxPoints), rect.x, rect.y, rect.width, 'left'); } }; //============================================================================= // Window_SkillsetStatus //============================================================================= function Window_SkillsetStatus() { this.initialize.apply(this, arguments); } Window_SkillsetStatus.prototype = Object.create(Window_Base.prototype); Window_SkillsetStatus.prototype.constructor = Window_SkillsetStatus; Window_SkillsetStatus.prototype.initialize = function(x, y, width, height) { Window_Base.prototype.initialize.call(this, x, y, width, height); this._actor = null; this._index = null; this._pagnum = null; this.refresh(); }; Window_SkillsetStatus.prototype.setActor = function(actor) { if (this._actor !== actor) { this._actor = actor; this._index = null; this._pagnum = null; this.refresh(); } }; Window_SkillsetStatus.prototype.setIndex = function(index) { if (this._index !== index) { this._index = index; this._pagnum = 0; this.refresh(); } }; Window_SkillsetStatus.prototype.LineByPage = function() { var lineHeight = this.lineHeight(); var height = this.height - lineHeight; return Math.floor(height/lineHeight); }; Window_SkillsetStatus.prototype.ColumnByPage = function() { var widthHeight = 200; var width = this.width; return Math.floor(width/widthHeight); }; Window_SkillsetStatus.prototype.ObjByPage = function() { return this.LineByPage() * this.ColumnByPage(); }; Window_SkillsetStatus.prototype.maxPagNum = function() { var skillset = $gameSkillset._data[this._actor.SkillSetSlotId(this._index)]; var valmax = $gameSystem._skillSetBookFlags[skillset.id].LevelMax; var MaxObj = this.ObjByPage(); var result = skillset.list.slice(0, valmax+1).reduce(function(nbr, newdata) { var addedValue = 0; addedValue += newdata.skillObtained.length; addedValue += newdata.stateResist.length; addedValue += newdata.elementResist.length; addedValue += newdata.debuffResist.length; addedValue += newdata.paramBonus.filter(function(paramBonus) { return paramBonus !== 0; }).length; return nbr + addedValue; }, 0); return Math.ceil(result/MaxObj); }; Window_SkillsetStatus.prototype.setPagNum = function(numpag) { if (this._pagnum !== numpag) { this._pagnum = (numpag + this.maxPagNum()) % this.maxPagNum(); this.refresh(); } }; Window_SkillsetStatus.prototype.refresh = function() { this.contents.clear(); if (!this._actor || !this._actor._skillsets[this._index]) { return; } var skillset = $gameSkillset._data[this._actor.SkillSetSlotId(this._index)]; var currentLevel = this._actor.CurrentJobPoints(this._index); var x = 0; var y = 0; var lineHeight = this.lineHeight(); var height = this.height - 2 * lineHeight; var width = this.width; var numObj = 0; var numPag = 0; if (!skillset || !$gameSystem.isInSkillSetBook(skillset)) { return; } var widthColumn = 70; var widthColumnX = 200; var NewSkillList; var ParamBonus; var elementResist; var stateResist; var debuffResist; var NewAttributeList; var levelWithId; for (var i = 0; i < skillset.list.length; i++) { this.changeTextColor(this.systemColor()); NewSkillList = skillset.list[i].skillObtained; ParamBonus = skillset.list[i].paramBonus; stateResist = skillset.list[i].stateResist; elementResist = skillset.list[i].elementResist; debuffResist = skillset.list[i].debuffResist; NewAttributeList = skillset.list[i].attributeObtained; levelWithId = (NewSkillList.length > 0); levelWithId = levelWithId || ParamBonus.some(function(a) { return a !== 0; }); levelWithId = levelWithId || (stateResist.length > 0); levelWithId = levelWithId || (elementResist.length > 0); levelWithId = levelWithId || (debuffResist.length > 0); levelWithId = levelWithId || (NewAttributeList.length > 0); if (levelWithId) { if (this._pagnum === numPag) { this.drawText(skillset.list[i].level, x, y, widthColumn); } this.resetTextColor(); if (skillset.list[i].level <= $gameSystem._skillSetBookFlags[skillset.id].LevelMax) { for (var k = 0; k < NewSkillList.length; k++) { if (y === 0 && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { if (i > currentLevel) { this.changePaintOpacity(false); } this.drawText($dataSkills[NewSkillList[k]].name, x + widthColumn, y, 100, 'right'); if (i > currentLevel) { this.changePaintOpacity(true); } y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = 0; } } for (var k = 0; k < NewAttributeList.length; k++) { if (y === 0 && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { if (i > currentLevel) { this.changePaintOpacity(false); } this.drawText($gameAttributes._data[NewAttributeList[k]].name, x + widthColumn, y, 100, 'right'); if (i > currentLevel) { this.changePaintOpacity(true); } y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = 0; } } for (var k = 0; k < ParamBonus.length; k++) { if (ParamBonus[k] !== 0) { if (y === 0 && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { if (i > currentLevel) { this.changePaintOpacity(false); } var TextParam = TextManager.param(k).concat("+"); this.drawText(TextParam.concat(ParamBonus[k]), x + widthColumn, y, 100, 'right'); if (i > currentLevel) { this.changePaintOpacity(true); } y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = 0; } } } for (var k = 0; k < stateResist.length; k++) { if (y === 0 && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { if (i > currentLevel) { this.changePaintOpacity(false); } var TextParam = "Rés. ".concat($dataStates[stateResist[k].stateId].name); this.drawText(TextParam.concat("+".concat(stateResist[k].BonusValue)), x + widthColumn, y, 100, 'right'); if (i > currentLevel) { this.changePaintOpacity(true); } y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = 0; } } for (var k = 0; k < elementResist.length; k++) { if (y === 0 && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { if (i > currentLevel) { this.changePaintOpacity(false); } var TextParam = "Rés. ".concat($dataSystem.elements[elementResist[k].elementId]); this.drawText(TextParam.concat("+".concat(elementResist[k].BonusValue)), x + widthColumn, y, 100, 'right'); if (i > currentLevel) { this.changePaintOpacity(true); } y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = 0; } } for (var k = 0; k < debuffResist.length; k++) { if (y === 0 && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { if (i > currentLevel) { this.changePaintOpacity(false); } var TextParam = "Rés. debuff ".concat(TextManager.param(debuffResist[k].debuffId).concat("+")); this.drawText(TextParam.concat(debuffResist[k].BonusValue), x + widthColumn, y, 100, 'right'); if (i > currentLevel) { this.changePaintOpacity(true); } y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = 0; } } } else { this.changePaintOpacity(false); this.drawText(DQM.Param.UnknownData, x + widthColumn, y, 100, 'right'); this.changePaintOpacity(true); return; } } } }; //============================================================================= // Window_MenuStatus //============================================================================= //============================================================================= // Window_ItemList //============================================================================= //============================================================================= // Window_SkillStatus //============================================================================= //============================================================================= // Window_EquipStatus //============================================================================= //============================================================================= // Window_SkillType //============================================================================= //============================================================================= // Window_ActorCommand //============================================================================= DQM.Core.Window_ActorCommand_makeCommandList = Window_ActorCommand.prototype.makeCommandList; Window_ActorCommand.prototype.makeCommandList = function() { if(this._actor) { if (this._actor.isFirstOrder()) { this.addCommand(DQM.Param.autoAttackActorText, 'autoattack', this._actor.canAttack()); } if (this._actor.canTension()) { this.addCommand(DQM.Param.TensionName, 'tension', true); } } DQM.Core.Window_ActorCommand_makeCommandList.call(this, arguments); if (this._actor) { this.addCommand(DQM.Param.StrategyName, 'Strategy', true); } }; //============================================================================= // Window_Status //============================================================================= DQM.Core.Window_Status_initialize = Window_Status.prototype.initialize; Window_Status.prototype.initialize = function() { DQM.Core.Window_Status_initialize.call(this); this._pagnum = 0; this.refresh(); }; Window_Status.prototype.maxPagNum = function() { return (3 + Math.max(Math.ceil(this.getTotalObjects() / this.getMaxResistanceByPage()), 1)); }; Window_Status.prototype.setPagNum = function(pagNum) { if (this._pagnum !== pagNum) { this._pagnum = (pagNum + this.maxPagNum()) % this.maxPagNum(); this.refresh(); } }; Window_Status.prototype.getValueToTest = function(type, id) { if (this._actor) { if (type === 0) { if (this._actor.getAbsorbElementValue(id) > 0) { return -this._actor.getAbsorbElementValue(id); } else { return Math.max(this._actor.elementRate(id),0); } } else if (type === 1) { if (this._actor.isStateResist(id)) { return 0; } else { return Math.max(this._actor.stateRate(id),0); } } else if (type === 2) { return Math.max(this._actor.debuffRate(id),0); } else if (type === 3) { return Math.max(this._actor.sparam(id),0); } } else { return 1; } }; Window_Status.prototype.getMessageValue = function(value) { var index1 = 0; var index2 = 0; while (index1 < DQM.Param.ResultResistValueSteps.length && (Number(DQM.Param.ResultResistValueSteps[index1])/100) <= value) { index1++; } while (index2 < DQM.Param.ResultResistValueSteps.length && (Number(DQM.Param.ResultResistValueSteps[index2])/100) < value) { index2++; } var index; if (index1 === index2) { index = index1; } else if (index2 < 0 || (index1 < 0 && index2 === (DQM.Param.ResultResistValueSteps.length - 1))) { index = DQM.Param.ResultResistValueSteps.length; } else if (index1 < 0 && index2 === (DQM.Param.ResultResistValueSteps.length - 2)) { index = DQM.Param.ResultResistValueSteps.length - 1; } else if ((index1 - index2) === 1) { index = index2; } else if ((index1 - index2) === 2) { index = (index1 + index2) / 2; } return DQM.Param.ResultResistMessageSteps[index]; }; Window_Status.prototype.getMessageResistance = function(type, id) { var message = this.getMessageValue(this.getValueToTest(type, id)); var nameData; if (type === 0) { nameData = $dataSystem.elements[id]; } else if (type === 1) { nameData = $dataStates[id].name; } else if (type === 2) { nameData = 'debuff'.concat(' ').concat($dataSystem.terms.params[id]); } else if (type === 3) { nameData = DQM.Param.DisplaySParamName[id - 6]; } return message.format(nameData); }; Window_Status.prototype.getTotalObjects = function() { return this.getListToDraw().length; }; Window_Status.prototype.drawProfile = function(x, y) { var text = this._actor.profile(); var listDesc = text.split(' '); var Text1 = ''; var Text2 = ''; for (var k = 0; k < listDesc.length; k++) { if (k === 0 || (Text1.concat(listDesc[k]).length < Math.floor(text.length / 2))) { Text1 = Text1.concat(k === 0 ? '' : ' ').concat(listDesc[k]); } else { if (Math.abs(Text1.concat(listDesc[k]).length - Math.floor(text.length / 2)) <= Math.abs(Text1 - Math.floor(text.length / 2))) { Text1 = Text1.concat(' ').concat(listDesc[k]); } else { k = k - 1; } for (var l = k + 1; l < listDesc.length; l++) { Text2 = Text2.concat(l === (k + 1) ? '' : ' ').concat(listDesc[l]); } k = listDesc.length; } } this.drawText(Text1, x, y, this.width - 2 * this.textPadding()); this.drawText(Text2, x, y + this.lineHeight(), this.width - 2 * this.textPadding()); }; Window_Status.prototype.getListToTest = function() { var list = $dataSystem.elements.map(function(name, id) { return {"code":0, "id":id}; }); list = list.concat($dataStates.slice(1).map(function(state) { return {"code":1, "id":state.id}; })); list = list.concat($dataSystem.terms.params.map(function(name, id) { return {"code":2, "id":id}; })); return list.concat([{"code":3, "id":6},{"code":3, "id":7}]); }; Window_Status.prototype.getListToDraw = function() { return this.getListToTest().filter(function(object) { return !this.MessageResistanceIsNull(object.code, object.id); }, this); }; Window_Status.prototype.getListMessages = function() { return this.getListToDraw().map(function(object) { return this.getMessageResistance(object.code, object.id); }, this); }; Window_Status.prototype.getListResistanceToDraw = function(pagNum) { var indexStart = this.getMaxResistanceByPage() * (pagNum - 2); var indexEnd = indexStart + this.getMaxResistanceByPage(); return this.getListMessages().slice(indexStart, indexEnd); }; Window_Status.prototype.getMaxResistanceByPage = function() { var lineHeight = this.lineHeight(); var maxHeight = this.contentsHeight() - (3 * lineHeight); var maxCols = this.getMaxResistanceCols(); return Math.floor(maxHeight / lineHeight) * maxCols; }; Window_Status.prototype.getMaxResistanceCols = function() { return 3; }; Window_Status.prototype.MessageResistanceIsNull = function(type, id) { return (!this.getMessageResistance(type, id) || this.getMessageResistance(type, id).length < 1); }; Window_Status.prototype.cursorLeft = function(wrap) { var maxCols = this.maxPagNum(); if (maxCols >= 2 && wrap) { this.setPagNum(this._pagnum - 1); } }; Window_Status.prototype.cursorRight = function(wrap) { var maxCols = this.maxPagNum(); if (maxCols >= 2 && wrap) { this.setPagNum(this._pagnum + 1); } }; Window_Status.prototype.isCursorMovable = function() { return true; }; Window_Status.prototype.processCursorMove = function() { if (this.isCursorMovable()) { var lastIndex = this.index(); if (Input.isRepeated('right')) { this.cursorRight(Input.isTriggered('right')); } if (Input.isRepeated('left')) { this.cursorLeft(Input.isTriggered('left')); } if (!this.isHandled('pagedown') && Input.isTriggered('pagedown')) { this.cursorPagedown(); } if (!this.isHandled('pageup') && Input.isTriggered('pageup')) { this.cursorPageup(); } if (this.index() !== lastIndex) { SoundManager.playCursor(); } } }; DQM.Core.Window_Status_refresh = Window_Status.prototype.refresh; Window_Status.prototype.refresh = function() { this.contents.clear(); if (this._pagnum === 0) { DQM.Core.Window_Status_refresh.call(this); } else if (this._pagnum === 1) { this.contents.clear(); if (this._actor) { var lineHeight = this.lineHeight(); this.drawBlock1(lineHeight * 0); this.drawHorzLine(lineHeight * 1); this.drawBlock2Pag2(lineHeight * 2); this.drawHorzLine(lineHeight * 6); this.drawVertLineCenterMax(lineHeight * 7); this.drawBlock3Pag2(lineHeight * 7); } } else if (this._pagnum > 1 && this._pagnum < this.maxPagNum() - 1) { this.contents.clear(); if (this._actor) { var lineHeight = this.lineHeight(); this.drawBlock1(lineHeight * 0); this.drawHorzLine(lineHeight * 1); this.drawBlock2Pag3(lineHeight * 2, this._pagnum); } } else if (this._pagnum === this.maxPagNum() - 1) { this.contents.clear(); if (this._actor) { var lineHeight = this.lineHeight(); this.drawBlock1(lineHeight * 0); this.drawHorzLine(lineHeight * 1); this.drawBlock2Pag4(lineHeight * 2); } } else { DQM.Core.Window_Status_refresh.call(this); } }; Window_Status.prototype.drawBlock2Pag2 = function(y) { this.drawActorFace(this._actor, 12, y); this.drawJobInfo(204, y); this.drawClassInfo(456, y); }; Window_Status.prototype.drawBlock3Pag2 = function(y) { this.drawActorSkillsets(this._actor, 0, y); this.drawActorAttributes(this._actor, this.contentsWidth() / 2, y); }; Window_Status.prototype.drawBlock2Pag3 = function(y, numPag) { var Text = DQM.Param.DisplayResistanceName; this.changeTextColor(this.systemColor()); this.drawText(Text, 0, y, this.contentsWidth(), 'center'); this.resetTextColor(); var List = this.getListResistanceToDraw(numPag); var lineHeight = this.lineHeight(); var colsWidth = this.contentsWidth() / this.getMaxResistanceCols(); for (var k = 0; k < List.length; k++) { this.drawText(List[k], (k % this.getMaxResistanceCols()) * colsWidth, y + lineHeight + (Math.floor(k / this.getMaxResistanceCols()) * lineHeight), colsWidth - 12, 'center'); } }; Window_Status.prototype.drawBlock2Pag4 = function(y) { var Text = DQM.Param.DisplaySyntheseHistoricalName; this.changeTextColor(this.systemColor()); this.drawText(Text, 0, y, this.contentsWidth(), 'center'); this.resetTextColor(); var List = [this._actor._classId, this._actor._synthesisHist]; var lineHeight = this.lineHeight(); var width = this.contentsWidth() - 16; this.drawHistoricalSynthesis(List, 0, y + lineHeight, width); }; Window_Status.prototype.drawHorzLineWidth = function(x, y, width) { var lineY = y + this.lineHeight() / 2 - 1; this.contents.paintOpacity = 48; this.contents.fillRect(x, lineY, width, 2, this.lineColor()); this.contents.paintOpacity = 255; }; Window_Status.prototype.drawHistoricalSynthesis = function(historical, x, y, width) { this.drawText($dataClasses[historical[0]].name, x, y, width, 'center'); var lineHeight = this.lineHeight(); if ((y + lineHeight * 2) < this.contentsHeight()) { for (var k = 0; k < historical[1].length; k++) { this.drawVertLine(x + (width / 2), y + lineHeight, lineHeight / 2); this.drawHorzLineWidth(x + (width / 4) * (k + 1), y + lineHeight, width / 4); this.drawVertLine(x + (width / 4) + ((width / 2) * k), y + (lineHeight * 3 / 2), lineHeight / 2); this.drawHistoricalSynthesis(historical[1][k], x + ((width / 2) * k), y + (lineHeight * 2), width / 2); } } }; Window_Status.prototype.drawJobInfo = function(x, y) { var lineHeight = this.lineHeight(); this.drawActorLevel(this._actor, x, y + lineHeight * 0); this.drawActorIcons(this._actor, x, y + lineHeight * 1); this.drawActorJobPoints(this._actor, x, y + lineHeight * 2); this.drawActorGender(this._actor, x, y + lineHeight * 3); }; Window_Status.prototype.drawActorJobPoints = function(actor, x, y) { var Text1 = DQM.Param.JobPointIcon; var Text2 = String(actor._jobPoints); this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 156); this.resetTextColor(); this.drawText(Text2, x + 150, y, 256); }; Window_Status.prototype.drawClassInfo = function(x, y) { var lineHeight = this.lineHeight(); this.drawActorClassGroup(this._actor, x, y + lineHeight * 0); this.drawActorClassRank(this._actor, x, y + lineHeight * 1); this.drawActorClassSize(this._actor, x, y + lineHeight * 2); }; Window_Status.prototype.drawActorClassGroup = function(actor, x, y) { var Text1 = DQM.Param.GroupClassLabel; var Text2 = actor.GroupClass(); this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 256); this.resetTextColor(); this.drawText(Text2, x + 150, y, 256); }; Window_Status.prototype.drawActorClassRank = function(actor, x, y) { var Text1 = DQM.Param.RankClassLabel; var Text2 = actor.RankClass(); if (actor._rankValueAdded > 0) { Text2 = Text2.concat('+').concat(actor._rankValueAdded); } this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 256); this.resetTextColor(); this.drawText(Text2, x + 150, y, 256); }; Window_Status.prototype.drawActorClassSize = function(actor, x, y) { var Text1 = DQM.Param.SizeClassLabel; var Text2 = actor.SizeClassIcon(); this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 256); this.resetTextColor(); this.drawText(Text2, x + 150, y, 256); }; Window_Status.prototype.drawActorGender = function(actor, x, y) { var Text1 = DQM.Param.GenderActorLabel; var Text2 = actor.Gender(); this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 256); this.resetTextColor(); if (Text2 === '+-' || Text2 === '-+') { this.drawText('+', x + 150, y - 5, 256); this.drawText('-', x + 150, y + 5, 256); } else { this.drawText(Text2, x + 150, y, 256); } }; Window_Status.prototype.drawActorSkillsets = function(actor, x, y) { var Text = DQM.Param.SkillsetBookNameCommand; this.changeTextColor(this.systemColor()); this.drawText(Text, x, y, this.contentsWidth() / 2, 'center'); this.resetTextColor(); for (var k = 0; k < actor._skillsets.length; k++) { var skillsetData = actor.GetSkillSetData(k); var jobPointsCurrent = actor.CurrentJobPoints(k); var jobPointsMax = skillsetData.list[skillsetData.list.length-1].level; Text = skillsetData.name; this.drawText(Text, x, y + (k + 1) * this.lineHeight(), this.contentsWidth() / 2 - 100, 'left'); if ($gameSystem.isInSkillSetBook(skillsetData)) { if ($gameSystem._skillSetBookFlags[skillsetData.id].LevelMax === jobPointsMax) { Text = String(jobPointsCurrent).concat('/').concat(jobPointsMax); } else { Text = String(jobPointsCurrent).concat('/').concat(DQM.Param.UnknownLevel); } } else { Text = String(jobPointsCurrent).concat('/').concat(DQM.Param.UnknownLevel); } this.drawText(Text, x + (this.contentsWidth() / 2 - 90), y + (k + 1) * this.lineHeight(), 84, 'right'); } }; Window_Status.prototype.drawActorAttributes = function(actor, x, y) { var Text = DQM.Param.AttributeBookNameCommand; this.changeTextColor(this.systemColor()); this.drawText(Text, x, y, this.contentsWidth() / 2, 'center'); this.resetTextColor(); var columnId = 0; for (var k = 0; k < actor._attributes.length; k++) { var attribute = actor.attributes()[k]; Text = attribute.name; this.drawText(Text, x + 15 + (this.contentsWidth()*columnId/4), y + ((k%6) + 1) * this.lineHeight(), this.contentsWidth() / 4 - 15, 'left'); if ((k+1)%6 === 0) { columnId++; } } }; //============================================================================= // Window_MenuStrategy //============================================================================= function Window_MenuStrategy() { this.initialize.apply(this, arguments); } Window_MenuStrategy.prototype = Object.create(Window_Command.prototype); Window_MenuStrategy.prototype.constructor = Window_MenuStrategy; Window_MenuStrategy.prototype.initialize = function(x, y, actor) { Window_Command.prototype.initialize.call(this, x, y); this._actor = actor; if (actor) { this.selectLast(); } }; Window_MenuStrategy._lastCommandSymbol = null; Window_MenuStrategy.initCommandPosition = function() { this._lastCommandSymbol = null; }; Window_MenuStrategy.prototype.windowWidth = function() { var lengthMax = 0; for (var k = 0; k < DQM.Param.StrategyList.length; k++) { lengthMax = Math.max(lengthMax, DQM.Param.StrategyList[k].length * 17); } return lengthMax; }; Window_MenuStrategy.prototype.windowHeight = function() { return Math.min((DQM.Param.StrategyList.length + 1) * this.lineHeight(), Graphics.boxHeight); }; Window_MenuStrategy.prototype.numVisibleRows = function() { return this.maxItems(); }; Window_MenuStrategy.prototype.makeCommandList = function() { for (var k = 0; k < DQM.Param.StrategyList.length; k++) { this.addCommand(DQM.Param.StrategyList[k], 'ok', true); } }; Window_MenuStrategy.prototype.selectLast = function() { this.select(this._actor._strategy); }; //============================================================================= // Window_TeamFormation //============================================================================= function Window_TeamFormation() { this.initialize.apply(this, arguments); } Window_TeamFormation.prototype = Object.create(Window_Selectable.prototype); Window_TeamFormation.prototype.constructor = Window_TeamFormation; Window_TeamFormation.prototype.initialize = function(x, y) { var height = this.windowHeight(); var width = this.windowWidth(); Window_Selectable.prototype.initialize.call(this, x, y, width, height); this._pendingIndex = -1; this.loadImages(); this.refresh(); }; Window_TeamFormation.prototype.windowWidth = function() { return Math.floor(Graphics.boxWidth); }; Window_TeamFormation.prototype.windowHeight = function() { return Graphics.boxHeight; }; Window_TeamFormation.prototype.maxItems = function() { var result = $gameParty.maxBattleMembers() * $gameParty.stockageId(); if ($gameParty._allMembers || $gameSystem._maxSupplementaryTeam === -1) { return result + $gameParty.maxStockagePlace(); } else { return result; } }; Window_TeamFormation.prototype.itemHeight = function() { var clientHeight = this.height - this.padding * 2 - this.lineHeight(); return Math.floor(clientHeight / this.numVisibleRows()); }; Window_TeamFormation.prototype.numVisibleRows = function() { return 3; }; Window_TeamFormation.prototype.updateCursor = function() { var rect = this.itemRect(this.index()); var actor; if (this.pendingIndex() === -1) { actor = this.actor(this.index()); } else { var actor = this.actor(this.pendingIndex()); } if (!actor || ($gameSystem._maxSupplementaryTeam === -1 && this.index() >= this.maxCols()) || ($gameSystem._maxSupplementaryTeam > -1 && this.index() >= (($gameSystem._maxSupplementaryTeam + 1) * this.maxCols()))) { this.setCursorRect(rect.x, rect.y, rect.width, rect.height); } else { this.setCursorRect(rect.x, rect.y, rect.width * actor.SizeClass() + (this.spacing() * (actor.SizeClass()-1)), rect.height); } }; Window_TeamFormation.prototype.loadImages = function() { $gameParty.members().forEach(function(actor) { ImageManager.loadFace(actor.faceName()); }, this); }; Window_TeamFormation.prototype.drawItem = function(index) { this.drawItemBackground(index); this.drawItemImage(index); }; Window_TeamFormation.prototype.actor = function(index) { var teamIndex = Math.min(Math.floor(index / $gameParty.maxBattleMembers()), $gameParty.stockageId()); var indexActor = index - (teamIndex * $gameParty.maxBattleMembers()); var actorList = $gameParty.members().filter(function(actor) { return actor._teamIndex === teamIndex && actor._index === indexActor; }); if (actorList.length > 0) { return actorList[0]; } }; Window_TeamFormation.prototype.drawItemBackground = function(index) { if (index === this._pendingIndex) { var rect = this.itemRect(index); var color = this.pendingColor(); this.changePaintOpacity(false); var actor = this.actor(index); if (!actor || (actor._teamIndex === 1 && $gameSystem._maxSupplementaryTeam === -1) || (actor._teamIndex === $gameSystem._maxSupplementaryTeam + 1 && $gameSystem._maxSupplementaryTeam > -1)) { this.contents.fillRect(rect.x, rect.y, rect.width, rect.height, color); } else { this.contents.fillRect(rect.x, rect.y, rect.width * actor.SizeClass() + (this.spacing() * (actor.SizeClass()-1)), rect.height, color); } this.changePaintOpacity(true); } }; Window_TeamFormation.prototype.maxCols = function() { return $gameParty.maxBattleMembers(); }; Window_TeamFormation.prototype.itemWidth = function() { return 150; }; Window_TeamFormation.prototype.numVisibleColumns = function() { return Math.floor(this.windowWidth() / this.itemWidth()); }; Window_TeamFormation.prototype.maxTopColumn = function() { return Math.max(this.maxCols() - this.numVisibleColumns(),0); }; Window_TeamFormation.prototype.drawTeamNames = function() { this.drawText(DQM.Param.NameMainTeam, 0, -this._scrollY, this.windowWidth()); if ($gameSystem._maxSupplementaryTeam === -1) { this.drawText(DQM.Param.NameStockageSystem, 0, this.itemHeight() + this.lineHeight() - this._scrollY, this.windowWidth()); } else { for (var k = 1; k <= $gameSystem._maxSupplementaryTeam; k++) { this.drawText(DQM.Param.NameSupplementaryTeam.concat(' ').concat(String(k)), 0, ((this.itemHeight() + this.lineHeight()) * k) - this._scrollY, this.windowWidth()); } if ($gameParty._allMembers) { this.drawText(DQM.Param.NameStockageSystem, 0, ((this.itemHeight() + this.lineHeight()) * ($gameSystem._maxSupplementaryTeam + 1)) - this._scrollY, this.windowWidth()); } } }; Window_TeamFormation.prototype.itemRect = function(index) { var rect = new Rectangle(); var maxCols = this.maxCols(); rect.width = this.itemWidth(); rect.height = this.itemHeight(); rect.x = index % maxCols * (rect.width + this.spacing()) - this._scrollX; rect.y = Math.floor(index / maxCols) * rect.height + (Math.min(Math.floor(1 + index / maxCols), ($gameSystem._maxSupplementaryTeam === -1 ? 2 : $gameSystem._maxSupplementaryTeam + 1) + ($gameSystem._maxSupplementaryTeam !== -1 && $gameParty._allMembers ? 1 : 0)) * this.lineHeight()) - this._scrollY; return rect; }; Window_TeamFormation.prototype.drawItemImage = function(index) { var actor = this.actor(index); var rect = this.itemRect(index); if (actor) { if (actor._teamIndex === $gameParty.stockageId()) { var color = this.normalColor(); this.contents.fillRect(rect.x, rect.y, rect.width, 2, color); this.contents.fillRect(rect.x, rect.y, 2, rect.height, color); this.contents.fillRect(rect.x, rect.y + rect.height - 2, rect.width, 2, color); this.contents.fillRect(rect.x + rect.width - 2, rect.y, 2, rect.height, color); } else { var color = this.normalColor(); this.contents.fillRect(rect.x, rect.y, rect.width * actor.SizeClass() + (this.spacing() * (actor.SizeClass()-1)), 2, color); this.contents.fillRect(rect.x, rect.y, 2, rect.height, color); this.contents.fillRect(rect.x, rect.y + rect.height - 2, rect.width * actor.SizeClass() + (this.spacing() * (actor.SizeClass()-1)), 2, color); this.contents.fillRect(rect.x + (rect.width * actor.SizeClass()) + (this.spacing() * (actor.SizeClass()-1)) - 2, rect.y, 2, rect.height, color); } this.changePaintOpacity(true); this.drawActorFace(actor, rect.x + 1, rect.y + 1, 144, rect.height - 2); this.changePaintOpacity(true); } else { var color = this.normalColor(); this.contents.fillRect(rect.x, rect.y, rect.width, 2, color); this.contents.fillRect(rect.x, rect.y, 2, rect.height, color); this.contents.fillRect(rect.x, rect.y + rect.height - 2, rect.width, 2, color); this.contents.fillRect(rect.x + rect.width - 2, rect.y, 2, rect.height, color); } }; Window_TeamFormation.prototype.processOk = function() { Window_Selectable.prototype.processOk.call(this); var actor = this.actor(this.index()); if (actor) { $gameParty.setMenuActor(actor); } }; Window_TeamFormation.prototype.isCurrentItemEnabled = function() { return true; }; Window_TeamFormation.prototype.getIndexByActor = function(actor) { if (!actor) { return 0; } return (actor._teamIndex * $gameParty.maxBattleMembers()) + actor._index; }; Window_TeamFormation.prototype.selectLast = function() { this.select(this.getIndexByActor($gameParty.menuActor()) || 0); }; Window_TeamFormation.prototype.pendingIndex = function() { return this._pendingIndex; }; Window_TeamFormation.prototype.setPendingIndex = function(index) { var lastPendingIndex = this._pendingIndex; this._pendingIndex = index; this.redrawItem(this._pendingIndex); this.redrawItem(lastPendingIndex); }; Window_TeamFormation.prototype.setTopColumn = function(column) { var scrollX = column.clamp(0, this.maxTopColumn()) * this.itemWidth(); if (this._scrollX !== scrollX) { this._scrollX = scrollX; this.refresh(); this.updateCursor(); } }; Window_TeamFormation.prototype.setTopRow = function(row) { var scrollY; if ($gameSystem._maxSupplementaryTeam === -1 && row === 0) { scrollY = 0; } else if ($gameSystem._maxSupplementaryTeam === -1 && row === 1 && (this.maxRows() - this.numVisibleRows() > 0)) { scrollY = this.itemHeight() + this.lineHeight(); } else if ($gameSystem._maxSupplementaryTeam === -1 && row > 1 && (this.maxRows() - this.numVisibleRows() > 1)) { scrollY = row.clamp(0, this.maxRows() - this.numVisibleRows()) * this.itemHeight() + (this.lineHeight() * 2); } else if (row > $gameSystem._maxSupplementaryTeam && $gameSystem._maxSupplementaryTeam > -1) { scrollY = row.clamp(0, this.maxRows() - this.numVisibleRows()) * this.itemHeight() + (this.lineHeight() * ($gameSystem._maxSupplementaryTeam + 1)); } else { scrollY = row.clamp(0, this.maxRows() + 1 - this.numVisibleRows()) * (this.itemHeight() + this.lineHeight()); } if (this._scrollY !== scrollY) { this._scrollY = scrollY; this.refresh(); this.updateCursor(); } }; Window_TeamFormation.prototype.select = function(index) { if (this.pendingIndex() !== -1 || ($gameSystem._maxSupplementaryTeam === -1 && index >= this.maxCols()) || ($gameSystem._maxSupplementaryTeam > -1 && index >= (($gameSystem._maxSupplementaryTeam + 1) * this.maxCols()))) { this._index = index; } else { var teamIndex = Math.min(Math.floor(index/this.maxCols()), $gameSystem._maxSupplementaryTeam + 1); var memberIndex = index - (teamIndex * this.maxCols()); var actorList; var actor; for (var k = 0; k < memberIndex; k++) { actorList = $gameParty.members().filter(function(actor) { return actor._teamIndex === teamIndex && actor._index === k; }); if (actorList.length > 0) { if (actorList[0]._index + actorList[0].SizeClass() > memberIndex) { actor = actorList[0]; k = memberIndex; } } } if (actor) { this._index = (teamIndex * this.maxCols()) + actor._index; } else { this._index = index; } } this._stayCount = 0; this.ensureCursorVisible(); this.updateCursor(); this.callUpdateHelp(); }; Window_TeamFormation.prototype.cursorDown = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); if (index < maxItems - maxCols || (wrap && maxCols === 1)) { this.select((index + maxCols) % maxItems); this.setTopRow(Math.floor(this.index()/maxCols)); this.setTopColumn(this.index() % maxCols); } }; Window_TeamFormation.prototype.cursorUp = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); var actor = this.actor(this.pendingIndex()); if (index >= maxCols || (wrap && maxCols === 1)) { var searchIndex = $gameSystem._maxSupplementaryTeam === -1 ? 1 : $gameSystem._maxSupplementaryTeam + 1; if (actor && index >= searchIndex * maxCols && index < (searchIndex + 1) * maxCols && index > (searchIndex + 1) * maxCols - actor.SizeClass()) { this.select((searchIndex * maxCols - actor.SizeClass() + maxItems) % maxItems); } else { this.select((index - maxCols + maxItems) % maxItems); } this.setTopRow(Math.floor(this.index()/maxCols)); this.setTopColumn(this.index() % maxCols); } }; Window_TeamFormation.prototype.cursorRight = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); var actor = this.actor(index); var pendingActor = this.actor(this.pendingIndex()); var rightPush; if (!actor || this.pendingIndex() !== -1) { rightPush = 1; } else { rightPush = actor._teamIndex === $gameParty.stockageId() ? 1 : actor.SizeClass(); } if (maxCols >= 2 && (index < maxItems - rightPush || (wrap && this.isHorizontal()))) { if (pendingActor && (index / maxCols) >= $gameParty.stockageId()) { this.select((index + rightPush) % maxItems); } else if (pendingActor && (((index % maxCols) + rightPush + pendingActor.SizeClass()) > maxCols)) { this.select(Math.min((index + maxCols) - (index % maxCols), maxItems - pendingActor.SizeClass()) % maxItems); } else if (pendingActor) { this.select(Math.min((index + rightPush),maxItems - pendingActor.SizeClass()) % maxItems); } else { this.select((index + rightPush) % maxItems); } this.setTopRow(Math.floor(this.index()/maxCols)); this.setTopColumn(this.index() % maxCols); } }; Window_TeamFormation.prototype.cursorLeft = function(wrap) { var index = this.index(); var maxItems = this.maxItems(); var maxCols = this.maxCols(); var pendingActor = this.actor(this.pendingIndex()); if (maxCols >= 2 && (index > 0 || (wrap && this.isHorizontal()))) { if (pendingActor && index > $gameParty.stockageId() * maxCols) { this.select((index - 1 + maxItems) % maxItems); } else if (pendingActor && ((index % maxCols) === 0)) { this.select(Math.max((index - pendingActor.SizeClass() + maxItems) % maxItems), 0); } else { this.select((index - 1 + maxItems) % maxItems); } this.setTopRow(Math.floor(this.index()/maxCols)); this.setTopColumn(this.index()% maxCols); } }; Window_TeamFormation.prototype.drawAllItems = function() { var topIndex = this.topIndex(); for (var i = 0; i < this.maxPageItems(); i++) { var index = topIndex + i; if (index < this.maxItems()) { this.drawItem(index); var actor = this.actor(index); if (actor) { if (actor._teamIndex !== $gameParty.stockageId()) { i = i + actor.SizeClass() - 1; } } } } this.drawTeamNames(); }; //============================================================================= // Window_SavefileList //============================================================================= Window_SavefileList.prototype.drawPartyCharacters = function(info, x, y) { if (info.characters) { this.drawCharacter(DQM.Param.playerSprite.characterName, DQM.Param.playerSprite.characterIndex, x, y); } }; //============================================================================= // Window_ShopBuy //============================================================================= //============================================================================= // Window_ShopNumber //============================================================================= //============================================================================= // Window_NameEdit //============================================================================= DQM.Core.Window_NameEdit_initialize = Window_NameEdit.prototype.initialize; Window_NameEdit.prototype.initialize = function(actor, maxLength) { if (actor === 0) { var width = this.windowWidth(); var height = this.windowHeight(); var x = (Graphics.boxWidth - width) / 2; var y = (Graphics.boxHeight - (height + this.fittingHeight(9) + 8)) / 2; Window_Base.prototype.initialize.call(this, x, y, width, height); this._actor = actor; this._name = $gameParty._namePlayer.slice(0, this._maxLength); this._index = this._name.length; this._maxLength = maxLength; this._defaultName = $gameParty._namePlayer; this.deactivate(); this.refresh(); ImageManager.loadFace(DQM.Param.playerFace.faceName); } else { DQM.Core.Window_NameEdit_initialize.call(this, actor, maxLength); } }; DQM.Core.Window_NameEdit_refresh = Window_NameEdit.prototype.refresh; Window_NameEdit.prototype.refresh = function() { if (this._actor === 0) { this.contents.clear(); this.drawFace(DQM.Param.playerFace.faceName, DQM.Param.playerFace.faceIndex, 0, 0); for (var i = 0; i < this._maxLength; i++) { this.drawUnderline(i); } for (var j = 0; j < this._name.length; j++) { this.drawChar(j); } var rect = this.itemRect(this._index); this.setCursorRect(rect.x, rect.y, rect.width, rect.height); } else { DQM.Core.Window_NameEdit_refresh.call(this); } }; //============================================================================= // Window_BattleStatus //============================================================================= //============================================================================= // Window_BattleLog //============================================================================= Window_BattleLog.prototype.displayRecruitResults = function(subject, target, result) { if (target.result().used) { this.push('pushBaseLine'); if (target.result().critical) { this.push('addText', TextManager.criticalToEnemy); } this.push('popupDamage', target); this.push('popupDamage', subject); if (target.result().missed) { this.displayMiss(target); } else if (target.result().evaded) { this.displayEvasion(target); } else { this.push('performDamage', target); this.push('addText', this.makeRecruitText(target, result)); } } }; Window_BattleLog.prototype.updateScaleSprite = function() { var PartyScale = $gameParty.getScaleMin(); var TroopScale = $gameTroop.getScaleMin(); var x; var y; if ($gameSystem.isSideView()) { x = Graphics.boxwidth + (((Graphics.boxwidth / 2) - $gameParty.getWidthTeam() * PartyScale) / 2); } else { x = (Graphics.boxwidth - $gameParty.getWidthTeam() * PartyScale) / 2; } y = (Graphics.boxheight - $gameParty.getHeightTeam() * PartyScale) / 2; this._spriteset._actorSprites.forEach(function(actor) { if (actor.scale.y !== PartyScale) { if ($gameSystem.isSideView()) { actor.scale.x = -PartyScale; actor.scale.y = PartyScale; actor.setHome(x, y + ($gameParty.getHeightTeam() - actor._actor._screenWidth) * PartyScale); x = x + 24; y = y + 32; } else { actor.scale.x = PartyScale; actor.scale.y = PartyScale; actor.setHome(x, y + ($gameParty.getHeightTeam() - actor._actor._screenWidth) * PartyScale); x = x + actor._actor.screenWidth * PartyScale; } } }); if ($gameSystem.isSideView()) { x = Graphics.boxwidth - (((Graphics.boxwidth / 2) - $gameTroop.getWidthTeam() * TroopScale) / 2); } else { x = (Graphics.boxwidth - $gameTroop.getWidthTeam() * TroopScale) / 2; } y = (Graphics.boxheight - $gameTroop.getHeightTeam() * TroopScale) / 2; this._spriteset._enemySprites.forEach(function(enemy) { if (enemy.scale.y !== TroopScale) { if ($gameSystem.isSideView()) { enemy.scale.x = TroopScale; enemy.scale.y = TroopScale; enemy.setHome(x, y + ($gameTroop.getHeightTeam() - enemy._enemy._screenWidth) * TroopScale); x = x - 24; y = y + 32; } else { enemy.scale.x = TroopScale; enemy.scale.y = TroopScale; enemy.setHome(x, y + ($gameTroop.getHeightTeam() - enemy._enemy._screenWidth) * TroopScale); x = x + enemy._enemy.screenWidth * TroopScale; } } }); }; Window_BattleLog.prototype.displayScreenActor = function() { if (!$gameSystem.isSideView()) { this._spriteset.battlerSprites().forEach(function(member) { var data = member._battler; if (data && data.isActor() && data.isAlive()) { member.visible = true; } else if (data && data.isEnemy() && data.isAlive()) { member.visible = false; } }); this._spriteset._battleField.scale.x = 1; this._spriteset._back1Sprite.scale.x = -1; this._spriteset._back1Sprite.x = Graphics.boxWidth; this._spriteset._back2Sprite.scale.x = -1; this._spriteset._back2Sprite.x = Graphics.boxWidth; } }; Window_BattleLog.prototype.displayScreenEnemy = function() { if (!$gameSystem.isSideView()) { this._spriteset.battlerSprites().forEach(function(member) { var data = member._battler; if (data && data.isActor() && data.isAlive()) { member.visible = false; } else if (data && data.isEnemy() && data.isAlive()) { member.visible = true; } }); this._spriteset._battleField.scale.x = 1; this._spriteset._back1Sprite.scale.x = 1; this._spriteset._back1Sprite.x = 0; this._spriteset._back2Sprite.scale.x = 1; this._spriteset._back2Sprite.x = 0; } }; Window_BattleLog.prototype.changePointOfView = function(target) { if (!$gameSystem.isSideView()) { if (target.isActor()) { this.push('displayScreenActor'); } else if (target.isEnemy()) { this.push('displayScreenEnemy'); } this.push('wait'); } }; Window_BattleLog.prototype.makeRecruitText = function(target, result) { var fmt; var PossibleValue = DQM.Param.RecruitMessageValueMin.filter(function(value) { return value <= result; }); var index = DQM.Param.RecruitMessageValueMin.indexOf(PossibleValue[PossibleValue.length - 1]); fmt = DQM.Param.RecruitMessageText[index]; return fmt.format(target.name()); }; Window_BattleLog.prototype.startTurnRecruit = function() { this.push('wait'); }; Window_BattleLog.prototype.recruitGaugeColor1 = function() { return this.textColor(22); }; Window_BattleLog.prototype.recruitGaugeColor2 = function() { return this.textColor(12); }; Window_BattleLog.prototype.drawRecruitGauge = function(x, y, width) { width = width || 186; var color1 = this.recruitGaugeColor1(); var color2 = this.recruitGaugeColor2(); this.drawGauge(x, y, width, BattleManager._recruitLvl/100, color1, color2); this.changeTextColor(this.systemColor()); this.drawText('%', x, y, 44); this.drawCurrentAndMax(BattleManager._recruitLvl, 100, x, y, width, this.normalColor(), this.normalColor()); }; Window_BattleLog.prototype.ReflexionTime = function() { return 100; }; Window_BattleLog.prototype.ReflexionWait = function() { this._waitCount = this.ReflexionTime(); }; Window_BattleLog.prototype.GaugeIncreaseSpeed = function() { return 2; }; Window_BattleLog.prototype.waitForGaugeUpdate = function() { this._waitCount = this.GaugeIncreaseSpeed(); }; Window_BattleLog.prototype.resetRecruitLvl = function() { BattleManager._recruitLvl = 0; }; Window_BattleLog.prototype.updateRecruitGauge = function(x, y, width, result) { for (var i = 0; i < Math.min(result, 100 - BattleManager._recruitLvl); i++) { this.push('refreshRecruit',x, y, width); this.push('waitForGaugeUpdate'); } this.push('popBaseLine'); }; DQM.Core.Window_BattleLog_refresh = Window_BattleLog.prototype.refresh; Window_BattleLog.prototype.refreshRecruit = function(x, y, width) { DQM.Core.Window_BattleLog_refresh.call(this); BattleManager._recruitLvl = Math.min(BattleManager._recruitLvl + 1, 100); if (BattleManager._recruitLvl !== 0) { this.drawRecruitGauge(x, y, width); } }; DQM.Core.Window_BattleLog_displayAffectedStatus = Window_BattleLog.prototype.displayAffectedStatus; Window_BattleLog.prototype.displayAffectedStatus = function(target) { DQM.Core.Window_BattleLog_displayAffectedStatus.call(this, target); if (target.result().isTensionAffected()) { if (target.result()._levelTensionChange === 0 && target._tension === Number(DQM.Param.TensionListLevel[DQM.Param.TensionListLevel.length - 1])) { this.push('addText', DQM.Param.TensionMessageTooHigh); } else if (target.result()._levelTensionChange === 0 && String(target._tension) === -Number(DQM.Param.TensionListLevel[DQM.Param.TensionListLevel.length - 1])) { this.push('addText', DQM.Param.TensionMessageTooLow); } else { this.push('addText', DQM.Param.TensionMessageResult.format(target._tension)); } } }; Window_BattleLog.prototype.refresh = function() { DQM.Core.Window_BattleLog_refresh.call(this); if (0 !== BattleManager._recruitLvl) { var posx = Number(DQM.Param.RecruitGaugePositions[0]); var posy = Number(DQM.Param.RecruitGaugePositions[1]); var width = Number(DQM.Param.RecruitGaugePositions[2]); this.drawRecruitGauge(posx, posy, width); } }; Window_BattleLog.prototype.processRecruit = function(target) { BattleManager.processRecruit(target); }; Window_BattleLog.prototype.cancelRecruit = function() { BattleManager.recruitForbidden(); }; DQM.Core.Window_BattleLog_startAction = Window_BattleLog.prototype.startAction; Window_BattleLog.prototype.startAction = function(subject, action, targets) { this.changePointOfView(subject); DQM.Core.Window_BattleLog_startAction.call(this, subject, action, targets); }; DQM.Core.Window_BattleLog_displayCounter = Window_BattleLog.prototype.displayCounter; Window_BattleLog.prototype.displayCounter = function(target) { this.changePointOfView(target); DQM.Core.Window_BattleLog_displayCounter.call(this, target); }; DQM.Core.Window_BattleLog_displayReflection = Window_BattleLog.prototype.displayReflection; Window_BattleLog.prototype.displayReflection = function(target) { this.changePointOfView(target); DQM.Core.Window_BattleLog_displayReflection.call(this, target); }; DQM.Core.Window_BattleLog_displaySubstitute = Window_BattleLog.prototype.displaySubstitute; Window_BattleLog.prototype.displaySubstitute = function(substitute, target) { this.changePointOfView(target); DQM.Core.Window_BattleLog_displaySubstitute.call(this, substitute, target); }; DQM.Core.Window_BattleLog_displayActionResults = Window_BattleLog.prototype.displayActionResults; Window_BattleLog.prototype.displayActionResults = function(subject, target) { this.changePointOfView(target); DQM.Core.Window_BattleLog_displayActionResults.call(this, subject, target); }; //============================================================================= // Window_SynthesisCommand //============================================================================= function Window_SynthesisLog() { this.initialize.apply(this, arguments); } Window_SynthesisLog.prototype = Object.create(Window_BattleLog.prototype); Window_SynthesisLog.prototype.constructor = Window_SynthesisLog; Window_SynthesisLog.prototype.initialize = function() { var width = this.windowWidth(); var height = this.windowHeight(); Window_Selectable.prototype.initialize.call(this, 0, 0, width, height); this.opacity = 0; this._lines = []; this._methods = []; this._waitCount = 0; this._waitMode = ''; this._baseLineStack = []; this._spriteset = null; this.createBackBitmap(); this.createBackSprite(); this.refresh(); }; Window_SynthesisLog.prototype.stopProcessing = function() { SceneManager._scene.stopProcessingSynthesis(); }; Window_SynthesisLog.prototype.changePointOfView = function(target) { }; Window_SynthesisLog.prototype.displayRecruitResults = function(subject, target, result) { }; Window_SynthesisLog.prototype.updateScaleSprite = function() { }; Window_SynthesisLog.prototype.displayScreenActor = function() { }; Window_SynthesisLog.prototype.displayScreenEnemy = function() { }; Window_SynthesisLog.prototype.makeRecruitText = function(target, result) { }; Window_SynthesisLog.prototype.startTurnRecruit = function() { }; Window_SynthesisLog.prototype.recruitGaugeColor1 = function() { }; Window_SynthesisLog.prototype.recruitGaugeColor2 = function() { }; Window_SynthesisLog.prototype.drawRecruitGauge = function(x, y, width) { }; Window_SynthesisLog.prototype.ReflexionTime = function() { }; Window_SynthesisLog.prototype.ReflexionWait = function() { }; Window_SynthesisLog.prototype.GaugeIncreaseSpeed = function() { }; Window_SynthesisLog.prototype.waitForGaugeUpdate = function() { }; Window_SynthesisLog.prototype.resetRecruitLvl = function() { }; Window_SynthesisLog.prototype.updateRecruitGauge = function(x, y, width, result) { }; Window_SynthesisLog.prototype.refreshRecruit = function(x, y, width) { }; Window_SynthesisLog.prototype.displayAffectedStatus = function(target) { DQM.Core.Window_BattleLog_displayAffectedStatus.call(this, target); }; Window_SynthesisLog.prototype.refresh = function() { DQM.Core.Window_BattleLog_refresh.call(this); }; Window_SynthesisLog.prototype.processRecruit = function(target) { }; Window_SynthesisLog.prototype.cancelRecruit = function() { }; Window_SynthesisLog.prototype.startAction = function(subject, action, targets) { DQM.Core.Window_BattleLog_startAction.call(this, subject, action, targets); }; Window_SynthesisLog.prototype.displayCounter = function(target) { DQM.Core.Window_BattleLog_displayCounter.call(this, target); }; Window_SynthesisLog.prototype.displayReflection = function(target) { DQM.Core.Window_BattleLog_displayReflection.call(this, target); }; Window_SynthesisLog.prototype.displaySubstitute = function(substitute, target) { DQM.Core.Window_BattleLog_displaySubstitute.call(this, substitute, target); }; Window_SynthesisLog.prototype.displayActionResults = function(subject, target) { DQM.Core.Window_BattleLog_displayActionResults.call(this, subject, target); }; Window_SynthesisLog.prototype.makeAppearActors = function() { this._spriteset.battlerSprites().forEach(function(member) { member.visible = true; }); this._spriteset.battlerSprites()[1].opacity = 0; }; Window_SynthesisLog.prototype.setNewPositionHome = function() { this._spriteset.setNewPositionHome(); }; Window_SynthesisLog.prototype.miniWait = function() { this._waitCount = 1; }; Window_SynthesisLog.prototype.processSynthesis = function() { for (var k = 0; k < this._spriteset.battlerSprites().length; k++) { var spriteActor = this._spriteset.battlerSprites()[k]; if (k === 1) { spriteActor.opacity = Math.min(spriteActor.opacity + 255 / DQM.Param.SynthesisWaitSpeed, 255); } else { var homeX = spriteActor._homeX; var homeY = spriteActor._homeY; var centerX = Graphics.width / 2; spriteActor.opacity = Math.max(0, spriteActor.opacity - 255 / DQM.Param.SynthesisWaitSpeed); spriteActor.setHome(centerX + ((k - 1) * Math.max(0, Math.abs(homeX - centerX) - (centerX / (2 * DQM.Param.SynthesisWaitSpeed)))), homeY); } } this.miniWait(); }; Window_SynthesisLog.prototype.showSynthesisAnimation = function() { this.showNormalAnimation([this._spriteset.battlerSprites()[1]._actor], DQM.Param.SynthesisAnimationId, false); }; //============================================================================= // Window_PartyCommand //============================================================================= DQM.Core.Window_PartyCommand_makeCommandList = Window_PartyCommand.prototype.makeCommandList; Window_PartyCommand.prototype.makeCommandList = function() { DQM.Core.Window_PartyCommand_makeCommandList.call(this); this.addCommand(DQM.Param.autoAttackPartyText, 'autofight'); this.addCommand(DQM.Param.RecruitCommand, 'recruit', BattleManager.isRecruitAllowed()); this.addCommand(DQM.Param.StrategyName, 'Strategy', true); }; //----------------------------------------------------------------------------- // Window_MenuJobStatus // // The window for displaying party member status on the menu screen. function Window_MenuJobStatus() { this.initialize.apply(this, arguments); } Window_MenuJobStatus.prototype = Object.create(Window_MenuStatus.prototype); Window_MenuJobStatus.prototype.constructor = Window_MenuJobStatus; Window_MenuJobStatus.prototype.drawItemStatus = function(index) { var actor = $gameParty.members()[index]; var rect = this.itemRect(index); var x = rect.x + 162; var y = rect.y + rect.height / 2 - this.lineHeight() * 1.5; var width = rect.width - x - this.textPadding(); this.drawActorJobPointsStatus(actor, x, y, width); }; //============================================================================= // Window_SkillSetList // // The window for selecting a category of items on the item and shop screens. //============================================================================= /* function Window_SkillSetListActor() { this.initialize.apply(this, arguments); } Window_SkillSetListActor.prototype = Object.create(Window_HorzCommand.prototype); Window_SkillSetListActor.prototype.constructor = Window_SkillSetListActor; Window_SkillSetListActor.prototype.initialize = function(actorId) { Window_HorzCommand.prototype.initialize.call(this, 0, 0); this._actor = actorId; }; Window_SkillSetListActor.prototype.windowWidth = function() { return Graphics.boxWidth; }; Window_SkillSetListActor.prototype.maxCols = function() { return Game_Actor[this._actor].SkillSetSlotUsed(); }; Window_SkillSetListActor.prototype.update = function() { Window_HorzCommand.prototype.update.call(this); if (this._skillWindow) { this._skillWindow.setSkillSet(this.currentSymbol()); } }; Window_SkillSetListActor.prototype.makeCommandList = function() { for (var n = 0; n < Game_Actor[this._actor].SkillSetSlotUsed(); n++) { this.addCommand(Game_Actor[this._actor].GetNameSlot(n), Game_Actor[this._actor].GetNameSlot(n)); } }; Window_SkillSetListActor.prototype.setItemWindow = function(skillWindow) { this._skillWindow = skillWindow; this.update(); }; */ //============================================================================= // Window_filterAndSortBookType //============================================================================= function Window_filterAndSortBookType() { this.initialize.apply(this, arguments); } Window_filterAndSortBookType.prototype = Object.create(Window_Command.prototype); Window_filterAndSortBookType.prototype.constructor = Window_filterAndSortBookType; Window_filterAndSortBookType.prototype.makeCommandList = function(arraySort, arrayFilter) { if (arrayFilter && arrayFilter.length > 0) { arrayFilter.forEach(function(filter) { this.addCommand(filter.name, 'filterType', filter.enabled, filter.id); }, this); } if (arraySort && arraySort.length > 0) { arraySort.forEach(function(sort) { this.addCommand(sort.name, 'sortType', true, sort.id); }, this); } this.addCommand(TextManager.cancel, 'cancel', true, null); this.addCommand(TextManager.clear, 'clear', true, null); this.refresh(); }; Window_filterAndSortBookType.prototype.refresh = function() { this.createContents(); Window_Selectable.prototype.refresh.call(this); }; Window_filterAndSortBookType.prototype.isCancelEnabled = function() { return true; }; //============================================================================= // Window_filterAndSortBookValue //============================================================================= function Window_filterAndSortBookValue() { this.initialize.apply(this, arguments); } Window_filterAndSortBookValue.prototype = Object.create(Window_Command.prototype); Window_filterAndSortBookValue.prototype.constructor = Window_filterAndSortBookValue; Window_filterAndSortBookValue.prototype.makeCommandList = function(listValue) { if (listValue && listValue.length > 0) { listValue.forEach(function(value) { this.addCommand(value.name, 'setValue', value.enabled, value.id); }, this); } this.refresh(); }; Window_filterAndSortBookValue.prototype.refresh = function() { this.createContents(); Window_Selectable.prototype.refresh.call(this); }; Window_filterAndSortBookValue.prototype.isCancelEnabled = function() { return true; }; //============================================================================= // Window_SkillsetBookIndex //============================================================================= function Window_SkillsetBookIndex() { this.initialize.apply(this, arguments); } Window_SkillsetBookIndex.prototype = Object.create(Window_Selectable.prototype); Window_SkillsetBookIndex.prototype.constructor = Window_SkillsetBookIndex; Window_SkillsetBookIndex.lastTopRow = 0; Window_SkillsetBookIndex.lastIndex = 0; Window_SkillsetBookIndex.prototype.initialize = function(x, y) { var width = Graphics.boxWidth; var height = this.fittingHeight(6); Window_Selectable.prototype.initialize.call(this, x, y, width, height); this.refresh(); this.setTopRow(Window_SkillsetBookIndex.lastTopRow); this.select(Window_SkillsetBookIndex.lastIndex); // this.resetSortFilterConditions(); this.activate(); }; /* Window_SkillsetBookIndex.prototype.resetSortFilterConditions = function() { this.sortConditions = [{"type":1, "value":1}]; this.filterConditions = []; this.refresh(); }; Window_SkillsetBookIndex.prototype.addFilterConditions = function(conditionsType, conditionValue) { this.filterConditions = [{"type":conditionsType, "value":conditionValue}].concat(this.filterConditions.filter(function(filter) { filter.type !== conditionsType; })); this.refresh(); }; Window_SkillsetBookIndex.prototype.addSortConditions = function(conditionsType, conditionValue) { this.sortConditions = [{"type":conditionsType, "value":conditionValue}].concat(this.sortConditions); this.refresh(); }; Window_SkillsetBookIndex.prototype.getValueToTestBook() = function(skillset, type) { if (type === 1) { return skillset.id; } else if (type === 2) { return skillset.name; } else if (type === 3) { return skillset.list.reduce(function(r, bonusList) { return r + bonusList.skillObtained.length; }, 0); } else if (type === 4) { return skillset.list.reduce(function(r, bonusList) { return r + bonusList.paramBonus.reduce(function(p, value) { return p + Number(value); }, 0); }, 0); } else if (type === 5) { return skillset.list.reduce(function(r, bonusList) { return r + bonusList.stateResist.reduce(function(p, data) { return p + Number(data.BonusValue); }, 0) + bonusList.elementResist.reduce(function(p, data) { return p + Number(data.BonusValue); }, 0) + bonusList.debuffResist.reduce(function(p, data) { return p + Number(data.BonusValue); }, 0); }, 0); } else if (type === 6) { return skillset.list.reduce(function(r, bonusList) { return r + bonusList.attributeObtained.length; }, 0); } }; */ Window_SkillsetBookIndex.prototype.getRealList = function() { return this._list;//.filter(function(skillset) { // return this.filterConditions.length < 1 ? true : this.filterConditions.every(function(condition) { // return condition.value === 0 ? this.getValueToTestBook(skillset, condition.type) < 1 : this.getValueToTestBook(skillset, condition.type) > 0; // }); // }).sort(function(a,b) { // this.sortConditions.forEach(function(condition) { // if (this.getValueToTestBook(a, condition.type) !== this.getValueToTestBook(b, condition.type)) { // return (this.getValueToTestBook(a, condition.type) - this.getValueToTestBook(b, condition.type)) * condition.value; // } // }, this); // }); }; // //Window_SkillsetBookIndex.prototype.canSetFilter = function(type, value) { // return this._list.filter(function(skillset) { // return this.filterConditions.length < 1 ? true : this.filterConditions.every(function(condition) { // return condition.type !== type && (condition.value === 0 ? this.getValueToTestBook(skillset, condition.type) < 1 : this.getValueToTestBook(skillset, condition.type) > 0); // }) && (value === 0 ? this.getValueToTestBook(skillset, type) < 1 : this.getValueToTestBook(skillset, type) > 0); // }).length > 0; //}; // Window_SkillsetBookIndex.prototype.maxCols = function() { return 3; }; Window_SkillsetBookIndex.prototype.maxItems = function() { return this.getRealList() ? this.getRealList().length : 0; }; Window_SkillsetBookIndex.prototype.setStatusWindow = function(statusWindow) { this._statusWindow = statusWindow; this.updateStatus(); }; Window_SkillsetBookIndex.prototype.update = function() { Window_Selectable.prototype.update.call(this); this.updateStatus(); }; Window_SkillsetBookIndex.prototype.updateStatus = function() { if (this._statusWindow) { var skillset = this.getRealList()[this.index()]; this._statusWindow.setSkillset(skillset); } }; Window_SkillsetBookIndex.prototype.refresh = function() { this._list = []; for (var i = 1; i < $gameSkillset._data.length; i++) { var skillset = $gameSkillset._data[i]; if ($gameSkillset.UsableList().contains(skillset)) { this._list.push(skillset); } } this.createContents(); this.drawAllItems(); }; Window_SkillsetBookIndex.prototype.drawItem = function(index) { var skillset = this.getRealList()[index]; var rect = this.itemRectForText(index); var name; if ($gameSystem.isInSkillSetBook(skillset)) { name = skillset.name; } else { name = DQM.Param.UnknownData; } this.drawText(name, rect.x, rect.y, rect.width); }; Window_SkillsetBookIndex.prototype.processCancel = function() { Window_Selectable.prototype.processCancel.call(this); Window_SkillsetBookIndex.lastTopRow = this.topRow(); Window_SkillsetBookIndex.lastIndex = this.index(); }; //============================================================================= // Window_SkillsetBookStatus //============================================================================= function Window_SkillsetBookStatus() { this.initialize.apply(this, arguments); } Window_SkillsetBookStatus.prototype = Object.create(Window_Base.prototype); Window_SkillsetBookStatus.prototype.constructor = Window_SkillsetBookStatus; Window_SkillsetBookStatus.prototype.initialize = function(x, y, width, height) { Window_Base.prototype.initialize.call(this, x, y, width, height); this._skillset = null; this._pagnum = null; this.refresh(); }; Window_SkillsetBookStatus.prototype.setSkillset = function(skillset) { if (this._skillset !== skillset) { this._skillset = skillset; this._pagnum = 0; this.refresh(); } }; Window_SkillsetBookStatus.prototype.LineByPage = function() { var lineHeight = this.lineHeight(); var height = this.height - lineHeight - lineHeight * 2 - this.textPadding(); return Math.floor(height/lineHeight); }; Window_SkillsetBookStatus.prototype.ColumnByPage = function() { var widthHeight = 200; var width = this.width; return Math.floor(width/widthHeight); }; Window_SkillsetBookStatus.prototype.ObjByPage = function() { return this.LineByPage() * this.ColumnByPage(); }; Window_SkillsetBookStatus.prototype.maxPagNum = function() { var skillset = this._skillset; var valmax = $gameSystem._skillSetBookFlags[skillset.id].LevelMax; var MaxObj = this.ObjByPage(); var result = skillset.list.slice(0, valmax+1).reduce(function(nbr, newdata) { var addedValue = 0; addedValue += newdata.skillObtained.length; addedValue += newdata.stateResist.length; addedValue += newdata.elementResist.length; addedValue += newdata.debuffResist.length; addedValue += newdata.paramBonus.filter(function(paramBonus) { return paramBonus !== 0; }).length; return nbr + addedValue; }, 0); return Math.ceil(result/MaxObj); }; Window_SkillsetBookStatus.prototype.setPagNum = function(numpag) { if (this._pagnum !== numpag) { this._pagnum = (numpag + this.maxPagNum()) % this.maxPagNum(); this.refresh(); } }; Window_SkillsetBookStatus.prototype.refresh = function() { var skillset = this._skillset; var x = 0; var y = 0; var lineHeight = this.lineHeight(); this.contents.clear(); if (!skillset || !$gameSystem.isInSkillSetBook(skillset)) { return; } var name = skillset.name; this.resetTextColor(); this.drawText(name, x, y); x = this.textPadding(); y = lineHeight + this.textPadding(); var descWidth = this.contentsWidth() - 2; this.drawText(skillset.desc, x, y, descWidth); y += lineHeight; var height = this.height - 2 * lineHeight; var width = this.width; var numPag = 0; var numObj = 0; var widthColumn = 70; var widthColumnX = 200; var NewSkillList; var ParamBonus; var elementResist; var stateResist; var debuffResist; var NewAttributeList; var levelWithId; for (var i = 0; i < skillset.list.length; i++) { this.changeTextColor(this.systemColor()); NewSkillList = skillset.list[i].skillObtained; ParamBonus = skillset.list[i].paramBonus; stateResist = skillset.list[i].stateResist; elementResist = skillset.list[i].elementResist; debuffResist = skillset.list[i].debuffResist; NewAttributeList = skillset.list[i].attributeObtained; levelWithId = (NewSkillList.length > 0); levelWithId = levelWithId || ParamBonus.some(function(a) { return a !== 0; }); levelWithId = levelWithId || (stateResist.length > 0); levelWithId = levelWithId || (elementResist.length > 0); levelWithId = levelWithId || (debuffResist.length > 0); levelWithId = levelWithId || (NewAttributeList.length > 0); if (levelWithId) { if (this._pagnum === numPag) { this.drawText(skillset.list[i].level, x, y, widthColumn); } this.resetTextColor(); if (skillset.list[i].level <= $gameSystem._skillSetBookFlags[skillset.id].LevelMax) { for (var k = 0; k < NewSkillList.length; k++) { if (y === lineHeight * 2 + this.textPadding() && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { this.drawText($dataSkills[NewSkillList[k]].name, x + widthColumn, y, 100, 'right'); y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = lineHeight * 2 + this.textPadding(); } } for (var k = 0; k < NewAttributeList.length; k++) { if (y === 0 && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { this.drawText($gameAttributes._data[NewAttributeList[k]].name, x + widthColumn, y, 100, 'right'); y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = 0; } } for (var k = 0; k < ParamBonus.length; k++) { if (ParamBonus[k] !== 0) { if (y === lineHeight * 2 + this.textPadding() && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { var TextParam = TextManager.param(k).concat("+"); this.drawText(TextParam.concat(ParamBonus[k]), x + widthColumn, y, 100, 'right'); y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = lineHeight * 2 + this.textPadding(); } } } for (var k = 0; k < stateResist.length; k++) { if (y === lineHeight * 2 + this.textPadding() && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { var TextParam = "Rés. ".concat($dataStates[stateResist[k].stateId].name); this.drawText(TextParam.concat("+".concat(stateResist[k].BonusValue)), x + widthColumn, y, 100, 'right'); y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = lineHeight * 2 + this.textPadding(); } } for (var k = 0; k < elementResist.length; k++) { if (y === lineHeight * 2 + this.textPadding() && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { var TextParam = "Rés. ".concat($dataSystem.elements[elementResist[k].elementId]); this.drawText(TextParam.concat("+".concat(elementResist[k].BonusValue)), x + widthColumn, y, 100, 'right'); y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = lineHeight * 2 + this.textPadding(); } } for (var k = 0; k < debuffResist.length; k++) { if (y === lineHeight * 2 + this.textPadding() && this._pagnum === numPag) { this.changeTextColor(this.systemColor()); this.drawText(skillset.list[i].level, x, y, widthColumn); this.resetTextColor(); } if (this._pagnum === numPag) { var TextParam = "Rés. debuff ".concat(TextManager.param(debuffResist[k].debuffId).concat("+")); this.drawText(TextParam.concat(debuffResist[k].BonusValue), x + widthColumn, y, 100, 'right'); y += lineHeight; } numObj++; if (numObj === this.ObjByPage()) { numPag++; numObj = 0; } if (y >= height) { x += widthColumnX; y = lineHeight * 2 + this.textPadding(); } } } else { this.changePaintOpacity(false); this.drawText(DQM.Param.UnknownData, x + widthColumn, y, 100, 'right'); this.changePaintOpacity(true); return; } } } }; //============================================================================= // Window_AttributeBookIndex //============================================================================= function Window_AttributeBookIndex() { this.initialize.apply(this, arguments); } Window_AttributeBookIndex.prototype = Object.create(Window_Selectable.prototype); Window_AttributeBookIndex.prototype.constructor = Window_AttributeBookIndex; Window_AttributeBookIndex.lastTopRow = 0; Window_AttributeBookIndex.lastIndex = 0; Window_AttributeBookIndex.prototype.initialize = function(x, y) { var width = Graphics.boxWidth; var height = this.fittingHeight(6); Window_Selectable.prototype.initialize.call(this, x, y, width, height); this.refresh(); this.setTopRow(Window_AttributeBookIndex.lastTopRow); this.select(Window_AttributeBookIndex.lastIndex); // this.resetSortFilterConditions(); this.activate(); }; Window_AttributeBookIndex.prototype.maxCols = function() { return 3; }; Window_AttributeBookIndex.prototype.maxItems = function() { return this._list ? this._list.length : 0; }; Window_AttributeBookIndex.prototype.setStatusWindow = function(statusWindow) { this._statusWindow = statusWindow; this.updateStatus(); }; Window_AttributeBookIndex.prototype.update = function() { Window_Selectable.prototype.update.call(this); this.updateStatus(); }; Window_AttributeBookIndex.prototype.updateStatus = function() { if (this._statusWindow) { var attribute = this._list[this.index()]; this._statusWindow.setAttribute(attribute); } }; Window_AttributeBookIndex.prototype.refresh = function() { this._list = []; for (var i = 1; i < $gameAttributes._data.length; i++) { var attribute = $gameAttributes._data[i]; if ($gameAttributes.UsableList().contains(attribute)) { this._list.push(attribute); } } this.createContents(); this.drawAllItems(); }; Window_AttributeBookIndex.prototype.drawItem = function(index) { var attribute = this._list[index]; var rect = this.itemRectForText(index); var name; if ($gameSystem.isInAttributeBook(attribute)) { name = attribute.name; } else { name = DQM.Param.UnknownData; } this.drawText(name, rect.x, rect.y, rect.width); }; Window_AttributeBookIndex.prototype.processCancel = function() { Window_Selectable.prototype.processCancel.call(this); Window_AttributeBookIndex.lastTopRow = this.topRow(); Window_AttributeBookIndex.lastIndex = this.index(); }; //============================================================================= // Window_SkillsetBookStatus //============================================================================= function Window_AttributeBookStatus() { this.initialize.apply(this, arguments); } Window_AttributeBookStatus.prototype = Object.create(Window_Base.prototype); Window_AttributeBookStatus.prototype.constructor = Window_AttributeBookStatus; Window_AttributeBookStatus.prototype.initialize = function(x, y, width, height) { Window_Base.prototype.initialize.call(this, x, y, width, height); this._attribute = null; this._pagnum = null; this.refresh(); }; Window_AttributeBookStatus.prototype.setAttribute = function(attribute) { if (this._attribute !== attribute) { this._attribute = attribute; this._pagnum = 0; this.refresh(); } }; Window_AttributeBookStatus.prototype.LineByPage = function() { var lineHeight = this.lineHeight(); var height = this.height - lineHeight - lineHeight * 2 - this.textPadding(); return Math.floor(height/lineHeight); }; Window_AttributeBookStatus.prototype.ColumnByPage = function() { var widthHeight = 200; var width = this.width; return Math.floor(width/widthHeight); }; Window_AttributeBookStatus.prototype.ObjByPage = function() { return this.LineByPage() * this.ColumnByPage(); }; Window_AttributeBookStatus.prototype.maxPagNum = function() { var MaxObj = this.ObjByPage(); var result = this.getListMessage().length; return Math.ceil(result/MaxObj); }; Window_AttributeBookStatus.prototype.getListMessage = function() { var attribute = this._attribute; var list = []; var MaxObj = this.ObjByPage(); var index = 0; var levelSynthesis = 0; var conditionsType = 0; var valueId = 0; var classList = $gameAttributes.getClassList(attribute); var skillsetList = $gameAttributes.getSkillsetList(attribute); list = list.concat(classList.reduce(function(r, classData) { if ((index%MaxObj) === 0 || classData.levelSynthesis !== levelSynthesis || classData.conditionsType !== conditionsType || classData.valueId !== valueId) { if (classData.conditionsType === 0) { if (classData.levelSynthesis === 0) { r = r.concat([[DQM.Param.DisplayAttributeWithoutConditions, true]]); } else { r = r.concat([[DQM.Param.DisplayAttributeConditionLevelSynthesis.format(classData.levelSynthesis), true]]); } } else if (classData.conditionsType === 1) { r = r.concat([[DQM.Param.DisplayAttributeConditionGroupClass.format(DQM.Param.GroupClassList[classData.valueId]), true]]); } else if (classData.conditionsType === 2) { r = r.concat([[DQM.Param.DisplayAttributeConditionSizeClass.format(DQM.Param.SizeClassIcon[classData.valueId]), true]]); } else if (classData.conditionsType === 3) { r = r.concat([[DQM.Param.DisplayAttributeConditionRankClass.format(DQM.Param.RankClassList[classData.valueId]), true]]); } index++; levelSynthesis = classData.levelSynthesis; conditionsType = classData.conditionsType; valueId = classData.valueId; } if ($gameSystem.ClassIsAddedToAttributeDiscoveredList(attribute, $dataClasses[classData.classId])) { r = r.concat([[$dataClasses[classData.classId].name, false]]); } else { r = r.concat([[DQM.Param.UnknownData, false]]); } index++; return r; }, [])); if (skillsetList.length > 0) { list = list.concat([[DQM.Param.DisplayAttributeConditionSkillset, true]]); } index++; return list.concat(skillsetList.reduce(function(r, skillset) { if (index%MaxObj === 0) { r = r.concat([[DQM.Param.DisplayAttributeConditionSkillset, true]]); index++; } if (!$gameSystem.isInSkillSetBook($gameSkillset._data[skillset.skillsetId])) { r = r.concat([[DQM.Param.UnknownData, false]]); } else if ($gameSystem._skillSetBookFlags[skillset.skillsetId].LevelMax < skillset.levelSkillset) { r = r.concat([[DQM.Param.UnknownData, false]]); } else { r = r.concat([[$gameSkillset._data[skillset.skillsetId].name, skillset.levelSkillset, false]]); } index++; return r; }, [])); }; Window_AttributeBookStatus.prototype.getListMessageByPagNum = function(numpag) { return this.getListMessage().slice(numpag * this.ObjByPage(), (numpag + 1) * this.ObjByPage()); }; Window_AttributeBookStatus.prototype.setPagNum = function(numpag) { if (this._pagnum !== numpag) { this._pagnum = (numpag + this.maxPagNum()) % this.maxPagNum(); this.refresh(); } }; Window_AttributeBookStatus.prototype.refresh = function() { var attribute = this._attribute; var x = 0; var y = 0; var lineHeight = this.lineHeight(); this.contents.clear(); if (!attribute || !$gameSystem.isInAttributeBook(attribute)) { return; } var name = attribute.name; this.resetTextColor(); this.drawText(name, x, y); x = this.textPadding(); y = lineHeight + this.textPadding(); var descWidth = this.contentsWidth() - 2; this.drawText(attribute.desc, x, y, descWidth); y = y + lineHeight + this.textPadding(); var columnWidth = this.width / this.ColumnByPage(); var numLines = this.LineByPage(); var List = this.getListMessageByPagNum(this._pagnum); for (var k = 0; k < List.length; k++) { if (List[k][List[k].length-1]) { this.changeTextColor(this.systemColor()); this.drawText(List[k][0], x + (Math.floor(k / numLines) * (columnWidth + this.textPadding() * 2)), y + ((k % numLines) * lineHeight), columnWidth, 'center'); } else if (List[k].length === 2) { this.drawText(List[k][0], x + (Math.floor(k / numLines) * (columnWidth + this.textPadding() * 2)), y + ((k % numLines) * lineHeight), columnWidth, 'center'); } else { this.drawText(List[k][0], x + (Math.floor(k / numLines) * (columnWidth + this.textPadding() * 2)), y + ((k % numLines) * lineHeight), columnWidth * 4 / 5, 'left'); this.drawText(List[k][1], x + (Math.floor(k / numLines) * (columnWidth + this.textPadding() * 2)) + (columnWidth * 5 / 6), y + ((k % numLines) * lineHeight), columnWidth / 6, 'right'); } this.resetTextColor(); } }; //============================================================================= // Window_MonsterBookIndex //============================================================================= function Window_MonsterBookIndex() { this.initialize.apply(this, arguments); } Window_MonsterBookIndex.prototype = Object.create(Window_Selectable.prototype); Window_MonsterBookIndex.prototype.constructor = Window_MonsterBookIndex; Window_MonsterBookIndex.lastTopRow = 0; Window_MonsterBookIndex.lastIndex = 0; Window_MonsterBookIndex.prototype.initialize = function(x, y) { var width = Graphics.boxWidth; var height = this.fittingHeight(6); Window_Selectable.prototype.initialize.call(this, x, y, width, height); this.refresh(); this.setTopRow(Window_MonsterBookIndex.lastTopRow); this.select(Window_MonsterBookIndex.lastIndex); this.activate(); }; Window_MonsterBookIndex.prototype.maxCols = function() { return 3; }; Window_MonsterBookIndex.prototype.maxItems = function() { return this._list ? this._list.length : 0; }; Window_MonsterBookIndex.prototype.setStatusWindow = function(statusWindow) { this._statusWindow = statusWindow; this.updateStatus(); }; Window_MonsterBookIndex.prototype.update = function() { Window_Selectable.prototype.update.call(this); this.updateStatus(); }; Window_MonsterBookIndex.prototype.updateStatus = function() { if (this._statusWindow) { var skillset = this._list[this.index()]; this._statusWindow.setSkillset(skillset); } }; Window_MonsterBookIndex.prototype.refresh = function() { this._list = []; for (var i = 1; i < $dataClasses.length; i++) { this._list.push($dataClasses[i]); } this.createContents(); this.drawAllItems(); }; Window_MonsterBookIndex.prototype.drawItem = function(index) { var monster = this._list[index]; var rect = this.itemRectForText(index); var name; if ($gameSystem.isInMonsterBook(monster)) { name = monster.name; } else { name = DQM.Param.UnknownData; } this.drawText(name, rect.x, rect.y, rect.width); }; Window_MonsterBookIndex.prototype.processCancel = function() { Window_Selectable.prototype.processCancel.call(this); Window_MonsterBookIndex.lastTopRow = this.topRow(); Window_MonsterBookIndex.lastIndex = this.index(); }; //============================================================================= // Window_MonsterBookStatus //============================================================================= function Window_MonsterBookStatus() { this.initialize.apply(this, arguments); } Window_MonsterBookStatus.prototype = Object.create(Window_Base.prototype); Window_MonsterBookStatus.prototype.constructor = Window_MonsterBookStatus; Window_MonsterBookStatus.prototype.initialize = function(x, y, width, height) { Window_Base.prototype.initialize.call(this, x, y, width, height); this._monster = null; this._pagnum = null; this.createSprite(); this.loadImages(); this.refresh(); }; Window_MonsterBookStatus.prototype.createSprite = function() { this._sprite = new Sprite_Class(); this.addChild(this._sprite); }; Window_MonsterBookStatus.prototype.setSkillset = function(monster) { if (this._monster !== monster) { this._monster = monster; this._pagnum = 0; this._sprite.setClass(monster); this._sprite.defineNewHomePosition(this.width, this.height); this.refresh(); } }; Window_MonsterBookStatus.prototype.getLocationInfos = function() { if (!this._monster) { return []; } else { return $gameSystem._monsterBookFlags[this._monster.id].locationList || []; } }; Window_MonsterBookStatus.prototype.getSynthesisClassic = function() { if (!this._monster) { return []; } if (!this._monster.IsClassicSynthesys) { return []; } var result = []; var listGroup = $dataClasses.slice(1).filter(function(classFst) { return classFst.id < this._monster.id && classFst.GroupClassId === this._monster.GroupClassId && classFst.IsClassicSynthesys; }, this); var lvlMinimal = listGroup.length > 0 ? listGroup[listGroup.length - 1].id : 1; var listDpt = $dataClasses.slice(1).filter(function(classDpt) { return classDpt.id >= lvlMinimal && classDpt.id < this._monster.id; }, this); for (var k = 0; k < listDpt.length; k++) { var listTst = $dataClasses.slice(1).filter(function(classTst) { return (listDpt[k].GroupClassId === this._monster.GroupClassId && classTst.id < this._monster.id) || (listDpt[k].GroupClassId !== this._monster.GroupClassId && ((classTst.GroupClassId === this._monster.GroupClassId && classTst.id < this._monster.id) || (classTst.GroupClassId !== this._monster.GroupClassId && classTst.GroupClassId !== listDpt[k].GroupClassId && classTst.id >= listDpt[k].id && this._monster.GroupClassId === $gameSynthesis.CalculateNewGroup(classTst.id, listDpt[k].id) ))); }, this); for (var l = 0; l < listTst.length; l++) { if (!DQM.Param.specialSynthesisOnly || DQM.Param.SynthesisFormula.every(function(formula) { return formula[1].length !== 2 || !$gameSynthesis.checkConditionsOnGroup([listDpt[k].id, listTst[l].id], formula[1]); })) { result.push([listDpt[k].id, listTst[l].id].sort(function(a,b) { return a - b; })); if (result.length > 1) { return result; } } } } return result; }; Window_MonsterBookStatus.prototype.getSynthesisInfos = function() { if (!this._monster) { return []; } else { return ($gameSystem._monsterBookFlags[this._monster.id].synthesisList || []).concat(this.getSynthesisClassic()); } }; Window_MonsterBookStatus.prototype.MoreClassicSynthesis = function() { return this._monster ? this.getSynthesisInfos().length - ($gameSystem._monsterBookFlags[this._monster.id].synthesisList || []).length > 1 : false; }; Window_MonsterBookStatus.prototype.getLearningTotalInfos = function() { if (!this._monster) { return []; } else { return this._monster.learnings.filter(function(learning) { return learning.level <= Number(DQM.Param.valueChangeLevelMax[DQM.Param.valueChangeLevelMax.length - 1]); }); } }; Window_MonsterBookStatus.prototype.getLearningInfos = function() { var listTotal = this.getLearningTotalInfos(); var realList = listTotal.filter(function(learning) { return learning.level <= $gameSystem.getLevelMaxReached(this._monster.id); }, this).map(function(learning) { return {"level":learning.level, "skill":$dataSkills[learning.skillId].name}; }); if (listTotal.length > realList.length) { realList = realList.concat([{"level":DQM.Param.UnknownLevel, "skill":DQM.Param.UnknownData}]); } return realList; }; Window_MonsterBookStatus.prototype.getAttributeInfos = function() { if (!this._monster) { return []; } var attributes = this._monster.AttributeList; var listFinal = attributes.sort(function(a,b) { if (a.particularConditions.length !== b.particularConditions.length) { return a.particularConditions.length - b.particularConditions.length; } else if (a.levelSynthesis !== b.levelSynthesis) { return a.levelSynthesis - b.levelSynthesis; } else { return a.attributeId - b.attributeId; } }, this).map(function(attribute) { if (!$gameSystem.ClassIsAddedToAttributeDiscoveredList($gameAttributes._data[attribute.attributeId], this._monster)) { return DQM.Param.UnknownData; } var textToDisplay = $gameAttributes._data[attribute.attributeId].name; if (attribute.levelSynthesis > 0) { textToDisplay = textToDisplay.concat('(').concat(DQM.Param.RankClassLabel).concat(' +').concat(attribute.levelSynthesis).concat(')'); } if (attribute.particularConditions.length > 0) { textToDisplay = textToDisplay.concat('(+'); textToDisplay = textToDisplay.concat(DQM.Param.DisplayMonsterAttributesSynthesisCondition); textToDisplay = textToDisplay.concat(' '); if (attribute.particularConditions[0].ConditionsType === 1) { textToDisplay = textToDisplay.concat(DQM.Param.GroupClassLabel); textToDisplay = textToDisplay.concat(' '); textToDisplay = textToDisplay.concat(DQM.Param.GroupClassList[attribute.particularConditions[0].ValueId]); } else if (attribute.particularConditions[0].ConditionsType === 2) { textToDisplay = textToDisplay.concat(DQM.Param.SizeClassLabel); textToDisplay = textToDisplay.concat(' '); textToDisplay = textToDisplay.concat(DQM.Param.SizeClassIcon[attribute.particularConditions[0].ValueId]); } else if (attribute.particularConditions[0].ConditionsType === 3) { textToDisplay = textToDisplay.concat(DQM.Param.RankClassLabel); textToDisplay = textToDisplay.concat(' '); textToDisplay = textToDisplay.concat(DQM.Param.RankClassList[attribute.particularConditions[0].ValueId]); } textToDisplay = textToDisplay.concat(')'); } return textToDisplay; }, this); return listFinal; }; Window_MonsterBookStatus.prototype.getLearningNumPag = function() { if (!DQM.Param.DisplayMonsterLearningsSwitch) { return 0; } return Math.max(1, Math.ceil(this.getLearningInfos().length * 3 / (this.ObjByPage() * 2))); }; Window_MonsterBookStatus.prototype.getLocationNumPag = function() { if (!DQM.Param.DisplayMonsterLocationSwitch) { return 0; } return Math.max(1, Math.ceil(this.getLocationInfos().length / this.ObjByPage())); }; Window_MonsterBookStatus.prototype.getAttributeNumPag = function() { if (!DQM.Param.DisplayMonsterAttributesSwitch) { return 0; } return Math.max(1, Math.ceil(this.getAttributeInfos().length / this.ObjByPage())); }; Window_MonsterBookStatus.prototype.getSynthesisNumPag = function() { if (!DQM.Param.DisplayMonsterSynthesisSwitch) { return 0; } return Math.max(1, Math.ceil(this.getSynthesisInfos().length * 2 / this.ObjByPage())); }; Window_MonsterBookStatus.prototype.LineByPage = function() { var lineHeight = this.lineHeight(); var height = this.height - lineHeight - lineHeight * 4 - this.textPadding(); return Math.floor(height/lineHeight); }; Window_MonsterBookStatus.prototype.ColumnByPage = function() { var widthHeight = 300; var width = this.width; return Math.floor(width/widthHeight); }; Window_MonsterBookStatus.prototype.ObjByPage = function() { return this.LineByPage() * this.ColumnByPage(); }; Window_MonsterBookStatus.prototype.maxPagNum = function() { return this.allIsShowable() ? 2 + this.getLearningNumPag() + this.getLocationNumPag() + this.getAttributeNumPag() + this.getSynthesisNumPag() : 2; }; Window_MonsterBookStatus.prototype.setPagNum = function(numpag) { if (this._pagnum !== numpag) { this._pagnum = (numpag + this.maxPagNum()) % this.maxPagNum(); this.refresh(); } }; Window_MonsterBookStatus.prototype.allIsShowable = function() { return this._monster && $gameSystem.isInMonsterBook(this._monster) && $gameSystem._monsterBookFlags[this._monster.id].isAsActor; }; Window_MonsterBookStatus.prototype.loadImages = function() { $dataClasses.slice(1).forEach(function(monster) { if (monster && monster.faceName) { ImageManager.loadFace(monster.faceName); } }); }; Window_MonsterBookStatus.prototype.refresh = function() { var monster = this._monster; var x = 0; var y = 0; var lineHeight = this.lineHeight(); this.contents.clear(); if (!monster || !$gameSystem.isInMonsterBook(monster)) { this._sprite.hide(); return; } if (this._pagnum !== 1) { this._sprite.hide(); var name = monster.name; this.resetTextColor(); this.drawText(name, x, y); x = this.textPadding(); y = lineHeight + this.textPadding(); var descWidth = this.contentsWidth() - 150; var text = this.allIsShowable() ? monster.Profile : DQM.Param.UnknownData; var listDesc = text.split(' '); var Text1 = ''; var Text2 = ''; for (var k = 0; k < listDesc.length; k++) { if (k === 0 || (Text1.concat(listDesc[k]).length < Math.floor(text.length / 2))) { Text1 = Text1.concat(k === 0 ? '' : ' ').concat(listDesc[k]); } else { if (Math.abs(Text1.concat(listDesc[k]).length - Math.floor(text.length / 2)) <= Math.abs(Text1 - Math.floor(text.length / 2))) { Text1 = Text1.concat(' ').concat(listDesc[k]); } else { k = k - 1; } for (var l = k + 1; l < listDesc.length; l++) { Text2 = Text2.concat(l === (k + 1) ? '' : ' ').concat(listDesc[l]); } k = listDesc.length; } } this.drawText(Text1, x, y, descWidth); this.drawText(Text2, x, y + lineHeight, descWidth); y += lineHeight; this.drawClassFace(monster, this.contentsWidth() - 145, 1, 144); y += lineHeight; if (this._pagnum === 0) { var Text1 = DQM.Param.GroupClassLabel; var Text2 = this.allIsShowable() ? DQM.Param.GroupClassList[monster.GroupClassId] : DQM.Param.UnknownData; this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 145); this.resetTextColor(); this.drawText(Text2, x + 150, y, 145); x += 300; var Text1 = DQM.Param.RankClassLabel; var Text2 = this.allIsShowable() ? DQM.Param.RankClassList[monster.RankClassId] : DQM.Param.UnknownData; this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 145); this.resetTextColor(); this.drawText(Text2, x + 150, y, 145); x = this.textPadding(); y += lineHeight; var Text1 = DQM.Param.SizeClassLabel; var Text2 = this.allIsShowable() ? DQM.Param.SizeClassList[monster.SizeClass] : DQM.Param.UnknownData; this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 145); this.resetTextColor(); this.drawText(Text2, x + 150, y, 145); y += lineHeight; var Text1 = DQM.Param.SkillsetBookNameCommand; if ($gameSkillset._data[monster.SkillSetDefault]) { var Text2 = this.allIsShowable() ? $gameSkillset._data[monster.SkillSetDefault].name : DQM.Param.UnknownData; } else { var Text2 = DQM.Param.UnknownData; } this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 145); this.resetTextColor(); this.drawText(Text2, x + 150, y, 145); } else if (this._pagnum <= this.getLearningNumPag() + 1) { var Text1 = DQM.Param.DisplayMonsterLearningsName; this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 145); this.resetTextColor(); y += lineHeight; var learningList = this.getLearningInfos(); var maxObj = Math.floor(this.ObjByPage() * 3 / 2); learningList = learningList.slice(maxObj * (this._pagnum - 2), maxObj * (this._pagnum - 1)); for (var k = 0; k < learningList.length; k++) { this.drawText(learningList[k].level, x + Math.floor(k / this.LineByPage()) * 200, y + (k % this.LineByPage()) * lineHeight, 30, 'left'); this.drawText(learningList[k].skill, x + 40 + Math.floor(k / this.LineByPage()) * 200, y + (k % this.LineByPage()) * lineHeight, 150, 'right'); } } else if (this._pagnum <= this.getAttributeNumPag() + this.getLearningNumPag() + 1) { var Text1 = DQM.Param.DisplayMonsterAttributesName; this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 145); this.resetTextColor(); y += lineHeight; var attributeList = this.getAttributeInfos(); var maxObj = this.ObjByPage(); attributeList = attributeList.slice(maxObj * (this._pagnum - this.getLearningNumPag() - 2), maxObj * (this._pagnum - this.getLearningNumPag() - 1)); for (var k = 0; k < attributeList.length; k++) { this.drawText(attributeList[k], x + Math.floor(k / this.LineByPage()) * 300, y + (k % this.LineByPage()) * lineHeight, 290); } } else if (this._pagnum <= this.getAttributeNumPag() + this.getLocationNumPag() + this.getLearningNumPag() + 1) { var Text1 = DQM.Param.DisplayMonsterLocationName; this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 145); this.resetTextColor(); y += lineHeight; var locationList = this.getLocationInfos(); var maxObj = this.ObjByPage(); locationList = locationList.slice(maxObj * (this._pagnum - this.getAttributeNumPag() - this.getLearningNumPag() - 2), maxObj * (this._pagnum - this.getAttributeNumPag() - this.getLearningNumPag() - 1)); for (var k = 0; k < locationList.length; k++) { this.drawText(locationList[k], x + Math.floor(k / this.LineByPage()) * 300, y + (k % this.LineByPage()) * lineHeight, 290); } } else { var Text1 = DQM.Param.DisplayMonsterSynthesisFormulaName; this.changeTextColor(this.systemColor()); this.drawText(Text1, x, y, 145); this.resetTextColor(); y += lineHeight; var synthesisList = this.getSynthesisInfos(); var maxObj = Math.floor(this.ObjByPage() / 2); synthesisList = synthesisList.slice(maxObj * (this._pagnum - this.getAttributeNumPag() - this.getLocationNumPag() - this.getLearningNumPag() - 2), maxObj * (this._pagnum - this.getAttributeNumPag() - this.getLearningNumPag() - this.getLocationNumPag() - 1)); for (var k = 0; k < synthesisList.length; k++) { var Text; if ((this._pagnum === this.getLearningNumPag() + this.getAttributeNumPag() + this.getLocationNumPag() + this.getSynthesisNumPag() + 1) && this.MoreClassicSynthesis() && k === synthesisList.length - 1) { Text = DQM.Param.DisplayMonsterSynthesisEtc; } else { Text = synthesisList[k].reduce(function(text, classId, index, synList) { var nameClass = $dataClasses[classId].name; return index < synList.length - 1 ? text.concat(nameClass).concat(' X ') : text.concat(nameClass); }, ''); } this.drawText(Text, x, y + k * lineHeight, 580, 'center'); } } } else { this._sprite.show(); } }; //============================================================================= // Window_JobPointsInput // // The window used for the insertion of Job Points in a skillset [Input Number]. //============================================================================= function Window_JobPointsInput() { this.initialize.apply(this, arguments); } Window_JobPointsInput.prototype = Object.create(Window_NumberInput.prototype); Window_JobPointsInput.prototype.constructor = Window_JobPointsInput; Window_JobPointsInput.prototype.initialize = function(x, y, width, height) { Window_Selectable.prototype.initialize.call(this, x, y, width, height); this._number = 0; this._maxDigits = 1; this.openness = 0; this.createButtons(); this.deactivate(); }; Window_JobPointsInput.prototype.start = function() { this._maxDigits = 3; this._number = 0; this._number = this._number.clamp(0, Math.pow(10, this._maxDigits) - 1); this.placeButtons(); this.updateButtonsVisiblity(); this.createContents(); this.refresh(); this.open(); this.activate(); this.select(0); }; Window_JobPointsInput.prototype.buttonY = function() { var spacing = 8; return this.height + spacing; }; Window_JobPointsInput.prototype.setMaxInput = function(max) { if (this._max !== max) { this._max = max; this.refresh(); } }; Window_JobPointsInput.prototype.isCancelEnabled = function() { return true; }; DQM.Core.Window_NumberInput_changeDigit = Window_NumberInput.prototype.changeDigit; Window_JobPointsInput.prototype.changeDigit = function(up) { DQM.Core.Window_NumberInput_changeDigit.call(this, up); this._number = this._number.clamp(0, this._max); this.refresh(); }; Window_JobPointsInput.prototype.processOk = function() { SoundManager.playOk(); SceneManager._scene.onInputJobOk(); }; Window_JobPointsInput.prototype.processCancel = function() { this.close(); SceneManager._scene._skillTypeWindow.activate(); }; //============================================================================= // Window_SkillListLog // // The window used for the insertion of Job Points in a skillset [Display result]. //============================================================================= function Window_SkillListLog() { this.initialize.apply(this, arguments); } Window_SkillListLog.prototype = Object.create(Window_BattleLog.prototype); Window_SkillListLog.prototype.constructor = Window_SkillListLog; Window_SkillListLog.prototype.initialize = function(x, y) { var width = Graphics.boxWidth; var height = this.fittingHeight(1); Window_Selectable.prototype.initialize.call(this, 0, 0, width, height); this.opacity = 250; this._lines = []; this._methods = []; this._waitCount = 0; this._waitMode = ''; this._baseLineStack = []; this._spriteset = null; this.createBackBitmap(); this.createBackSprite(); this.refresh(); }; Window_SkillListLog.prototype.refresh = function() { DQM.Core.Window_BattleLog_refresh.call(this); }; Window_SkillListLog.prototype.addText = function(text) { this.contents.clear(); this.drawText(text, 0, 0, this.width - 40); this.wait(); }; Window_SkillListLog.prototype.displayResult = function(actor, index, addedValue) { if (addedValue > 0) { var previousValue = actor._skillsets[index].jobPoints - addedValue; var skillset = $gameSkillset._data[actor._skillsets[index].id]; var Message = DQM.Param.DisplayAddedJobPointsOnSkillsetResult.format(actor.name(), addedValue, skillset.name); this.push('addText', Message); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); for (var k = previousValue + 1; k <= previousValue + addedValue; k++) { var bonusList = skillset.list[k]; for (var j = 0; j < bonusList.skillObtained.length; j++) { Message = TextManager.obtainSkill.format($dataSkills[bonusList.skillObtained[j]].name); this.push('addText', Message); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); } for (var j = 0; j < bonusList.attributeObtained.length; j++) { Message = DQM.Param.DisplayObtainAttributeResult.format(actor.name(), $gameAttributes._data[bonusList.attributeObtained[j]].name); this.push('addText', Message); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); } for (var j = 0; j < bonusList.paramBonus.length; j++) { if (bonusList.paramBonus[j] > 0) { Message = DQM.Param.DisplayParamBonusAddedResult.format(TextManager.param(j),actor.name(),bonusList.paramBonus[j]); this.push('addText', Message); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); } } for (var j = 0; j < bonusList.stateResist.length; j++) { Message = DQM.Param.DisplayStateResistRaisedResult.format(actor.name(), $dataStates[bonusList.stateResist[j].stateId].name, bonusList.stateResist[j].BonusValue); this.push('addText', Message); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); } for (var j = 0; j < bonusList.elementResist.length; j++) { Message = DQM.Param.DisplayElementResistRaisedResult.format(actor.name(), $dataSystem.elements[bonusList.elementResist[j].elementId], bonusList.elementResist[j].BonusValue); this.push('addText', Message); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); } for (var j = 0; j < bonusList.debuffResist.length; j++) { Message = DQM.Param.DisplayDebuffResistRaisedResult.format(actor.name(), TextManager.param(bonusList.debuffResist[j].debuffId), bonusList.debuffResist[j].BonusValue); this.push('addText', Message); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); } } if (previousValue + addedValue === skillset.list[skillset.list.length - 1].level) { Message = DQM.Param.DisplayMasteringSkillsetResult.format(actor.name(), skillset.name); this.push('addText', Message); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); this.push('wait'); } this.push('refresh'); } }; //============================================================================= // New Function //============================================================================= newActorAddable = function() { return $gameParty.canAddNewActor(); }; MonstersEncounteredIsReached = function(minNumber) { return $gameSystem.getMaxMonstersEncountered() >= minNumber; }; MonstersRecruitedIsReached = function(minNumber) { return $gameSystem.getMaxMonstersRecruited() >= minNumber; }; SkillsetDiscoveredIsReached = function(minNumber) { return $gameSystem.getMaxSkillsetDiscovered() >= minNumber; }; SkillsetMasteredIsReached = function(minNumber) { return $gameSystem.getMaxSkillsetMastered() >= minNumber; }; AttributeDiscoveredIsReached = function(minNumber) { return $gameSystem.getMaxAttributeDiscovered() >= minNumber; }; PercentMonsterEncounteredIsReached = function(minPercent) { return $gameSystem.getPercentMonsterEncountered() >= minPercent; }; PercentMonsterRecruitedIsReached = function(minPercent) { return $gameSystem.getPercentMonsterRecruited() >= minPercent; }; PercentSkillsetDiscoveredIsReached = function(minPercent) { return $gameSystem.getPercentSkillsetDiscovered() >= minPercent; }; PercentSkillsetMasteredIsReached = function(minPercent) { return $gameSystem.getPercentSkillsetMastered() >= minPercent; }; PercentAttributeDiscoveredIsReached = function(minPercent) { return $gameSystem.getPercentAttributeDiscovered() >= minPercent; }; //============================================================================= // End of File //=============================================================================