Invité Invité
| Sujet: [RPG Maker VX] Compétence passive Mar 8 Nov 2011 - 19:21 | |
| Shanghai Simple Script - Passive SkillsIntroductionPermets de créer des compétences qui auront des effets permanents, on peut aussi faire en sorte qu'un actor bénéficie d'un état spécifique permanent. CompatibilitéCe script est compatible avec les gens qui savent lire uniquement. auteur: Shanghai screenscript - Code:
-
#=============================================================================== # # Shanghai Simple Script - Passive Skills # Last Date Updated: 2010.05.19 # Level: Normal # # Skills learned by actors can now give stat bonuses or apply autostates. #=============================================================================== # Instructions # ----------------------------------------------------------------------------- # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials but above ▼ Main. Remember to save. # # <passive param: +x> # <passive param: -x> # <passive param: x%> # Replace param with hp, mp, atk, def, spi, agi, dex, res, hit, eva, cri, or # odds, and this tag will increase or decrease the base stat by that much. % # will increase by a percent. # # <passive state: x> # <passive state: x, x, x> # Gives the skill with state x always applied. Unremovable until the skill has # been forgotten. # # Insert multiple of these tags if you want more than one passive effect # applied for a single skill. #===============================================================================
$imported = {} if $imported == nil $imported["PassiveSkills"] = true
#============================================================================== # RPG::BaseItem #==============================================================================
class RPG::BaseItem
#-------------------------------------------------------------------------- # passive_traits #-------------------------------------------------------------------------- def passive_traits return @passive_traits if @passive_traits != nil @passive_traits = { :maxhp => 0, :maxmp => 0, :atk => 0, :def => 0, :spi => 0, :agi => 0, :dex => 0, :res => 0, :hit => 0, :eva => 0, :cri => 0, :odds => 0, :maxhpp => 100, :maxmpp => 100, :atkp => 100, :defp => 100, :spip => 100, :agip => 100, :dexp => 100, :resp => 100, :hitp => 100, :evap => 100, :crip => 100, :oddsp => 100, :states => []} self.note.split(/[\r\n]+/).each { |line| case line when /<(?:PASSIVE|pas)[ ](.*):[ ]([\+\-]\d+)>/i case $1.upcase when "MAXHP", "HP" @passive_traits[:maxhp] = $2.to_i when "MAXMP", "MP" @passive_traits[:maxmp] = $2.to_i when "ATK" @passive_traits[:atk] = $2.to_i when "DEF" @passive_traits[:def] = $2.to_i when "SPI" @passive_traits[:spi] = $2.to_i when "AGI" @passive_traits[:agi] = $2.to_i when "DEX" @passive_traits[:dex] = $2.to_i when "RES" @passive_traits[:res] = $2.to_i when "HIT" @passive_traits[:hit] = $2.to_i when "EVA" @passive_traits[:eva] = $2.to_i when "CRI" @passive_traits[:cri] = $2.to_i when "ODDS" @passive_traits[:odds] = $2.to_i end when /<(?:PASSIVE|pas)[ ](.*):[ ](\d+)([%%])>/i case $1.upcase when "MAXHP", "HP" @passive_traits[:maxhpp] = $2.to_i when "MAXMP", "MP" @passive_traits[:maxmpp] = $2.to_i when "ATK" @passive_traits[:atkp] = $2.to_i when "DEF" @passive_traits[:defp] = $2.to_i when "SPI" @passive_traits[:spip] = $2.to_i when "AGI" @passive_traits[:agip] = $2.to_i when "DEX" @passive_traits[:dexp] = $2.to_i when "RES" @passive_traits[:resp] = $2.to_i when "HIT" @passive_traits[:hitp] = $2.to_i when "EVA" @passive_traits[:evap] = $2.to_i when "CRI" @passive_traits[:crip] = $2.to_i when "ODDS" @passive_traits[:oddsp] = $2.to_i end when /<(?:PASSIVE_STATE|passive state):[ ](\d+(?:\s*,\s*\d+)*)>/i $1.scan(/\d+/).each { |num| @passive_traits[:states].push($data_states[num.to_i]) if num.to_i > 0 } end } return @passive_traits end end
#============================================================================== # ** Game_Battler #==============================================================================
class Game_Battler #-------------------------------------------------------------------------- # * Get Current States as an Object Array #-------------------------------------------------------------------------- alias states_sss_passive_skills states unless $@ def states array = states_sss_passive_skills if actor? for skill in skills do array |= skill.passive_traits[:states] end end return array.compact end end
#============================================================================== # Game Actor #==============================================================================
class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Get Basic Maximum HP #-------------------------------------------------------------------------- alias base_maxhp_sss_passive_skills base_maxhp unless $@ def base_maxhp n = base_maxhp_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:maxhpp] / 100.0 end for skill in skills do n += skill.passive_traits[:maxhp] end return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Maximum MP #-------------------------------------------------------------------------- alias base_maxmp_sss_passive_skills base_maxmp unless $@ def base_maxmp n = base_maxmp_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:maxmpp] / 100.0 end for skill in skills do n += skill.passive_traits[:maxmp] end return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Attack #-------------------------------------------------------------------------- alias base_atk_sss_passive_skills base_atk unless $@ def base_atk n = base_atk_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:atkp] / 100.0 end for skill in skills do n += skill.passive_traits[:atk] end return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Defense #-------------------------------------------------------------------------- alias base_def_sss_passive_skills base_def unless $@ def base_def n = base_def_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:defp] / 100.0 end for skill in skills do n += skill.passive_traits[:def] end return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Spirit #-------------------------------------------------------------------------- alias base_spi_sss_passive_skills base_spi unless $@ def base_spi n = base_spi_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:spip] / 100.0 end for skill in skills do n += skill.passive_traits[:spi] end return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Agility #-------------------------------------------------------------------------- alias base_agi_sss_passive_skills base_agi unless $@ def base_agi n = base_agi_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:agip] / 100.0 end for skill in skills do n += skill.passive_traits[:agi] end return Integer(n) end #-------------------------------------------------------------------------- # * Get Basic Dexterity #-------------------------------------------------------------------------- if $imported["DEX Stat"] alias base_dex_sss_passive_skills base_dex unless $@ def base_dex n = base_dex_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:dexp] / 100.0 end for skill in skills do n += skill.passive_traits[:dex] end return Integer(n) end end #-------------------------------------------------------------------------- # * Get Basic Resist #-------------------------------------------------------------------------- if $imported["RES Stat"] alias base_res_sss_passive_skills base_res unless $@ def base_res n = base_res_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:resp] / 100.0 end for skill in skills do n += skill.passive_traits[:res] end return Integer(n) end end #-------------------------------------------------------------------------- # * Get Hit Rate #-------------------------------------------------------------------------- alias hit_sss_passive_skills hit unless $@ def hit n = hit_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:hitp] / 100.0 end for skill in skills do n += skill.passive_traits[:hit] end return [Integer(n), 0].max end #-------------------------------------------------------------------------- # * Get Evasion Rate #-------------------------------------------------------------------------- alias eva_sss_passive_skills eva unless $@ def eva n = eva_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:evap] / 100.0 end for skill in skills do n += skill.passive_traits[:eva] end return [Integer(n), 0].max end #-------------------------------------------------------------------------- # * Get Critical Rate #-------------------------------------------------------------------------- alias cri_sss_passive_skills cri unless $@ def cri n = cri_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:crip] / 100.0 end for skill in skills do n += skill.passive_traits[:cri] end return [Integer(n), 0].max end #-------------------------------------------------------------------------- # * Get Get Ease of Hitting #-------------------------------------------------------------------------- alias odds_sss_passive_skills odds unless $@ def odds n = odds_sss_passive_skills for skill in skills do n = n * skill.passive_traits[:oddsp] / 100.0 end for skill in skills do n += skill.passive_traits[:odds] end return [Integer(n), 1].max end end
#=============================================================================== # # END OF FILE # #=============================================================================== - Code:
-
<passive param: +x> <passive param: -x> - Code:
-
<passive state: x> <passive state: x, x, x> |
|
elm6 Ninja (niveau 1)
Messages postés : 144 Date d'inscription : 10/02/2010 Jauge LPC :
| Sujet: Re: [RPG Maker VX] Compétence passive Mer 9 Nov 2011 - 11:13 | |
| J'ai pas encore testé ça Garruk, mais c'est une belle trouvaille, je compte bien m'en servir! =) Merci.
Modifier les stats grace à une skill passive, c'est déjà cool, mais le fait de pouvoir appliquer un état c'est encore mieux, c'est la porte ouverte à de nombreuses possibilités très sympa! =) |
|
shin Chevalier Dragon (niveau 1)
Messages postés : 726 Date d'inscription : 18/10/2011 Jauge LPC :
| Sujet: Re: [RPG Maker VX] Compétence passive Mer 9 Nov 2011 - 18:32 | |
| on doit pouvoire faire des choses plutot interessante avec un tel script faut juste que je regarde les differentes façons de donner les competences passives.
merci pour le partage |
|
Invité Invité
| Sujet: Re: [RPG Maker VX] Compétence passive Jeu 10 Nov 2011 - 13:53 | |
| Ouais ce script et une pure merveille, maintenant les compétences autoboosters, autophénix deviennent possibles, sans se prendre la tête à modifier ses troupes et tout. Merci et content qu'il vous plaise. =) |
|
Contenu sponsorisé
| Sujet: Re: [RPG Maker VX] Compétence passive | |
| |
|