Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Pacman Advanced Creative (PAC) Engine - Item, Skill and Equip Addons (1.6)
- # 4/6/2011
- # Type: System
- # Installation: Tags.
- # Level: Average
- #
- #===============================================================================
- #
- # Description:
- # This will give you a number of features to add to your game in the manner
- # of making skills more interesting. They are all related to items, skills,
- # equipment or a combination of the three in some way. Read the instructions
- # for more information.
- #
- #===============================================================================
- #
- # Instructions:
- # INSTALLATION
- # Paste above main, below materials, in the script editor. Remember to save and
- # send a blank cheque to me.
- # TAGS
- #
- # <equipskill: x>
- # <equipskill: x, x, x>
- # Place this in an equipment (armour or weapon) notebox to give actors the
- # skill(s) with the ID x.
- #
- # <break equip: x>
- # <break equip: x, x, x>
- # Put this in a skill's notebox to make it break the equipment type x for the
- # actor it is used against. By default, they are:
- # 0 - Weapon
- # 1 - Shield
- # 2 - Helmet
- # 3 - Armour
- # 4 - Accessory
- #
- # <repair equip: x>
- # <repair equip: x, x, x>
- # Use these tags in a skill's notebox to make it repair the equipment type x
- # for the actor it is used on. The IDs are the same for break equip.
- #
- # <forget skill: x>
- # <forget skill: x, x, x>
- # If these tags are in a skill's notebox, once an actor learn the skill with the
- # tag, they will forget the skill ID(s) x.
- #
- # <passive param: +x>
- # <passive param: -x>
- # <passive param: x%>
- # Replace param with hp, mp, atk, def, agi, spi, dex, res, hit, eva, cit or
- # odds. Place these in a skill's notebox to increase or decrease those params
- # for the actors that have the skill by x, x% will increase by x%. Place
- # several of these if you wish to alter more than one parameter.
- #
- # <passive state: x>
- # <passive state: x, x, x>
- # Replace x with the state ID(s) you want any actor with the skill this tag
- # is in the notebox of to permanantly give the actor that state as long as they
- # have the skill.
- #
- # <teach skill: x>
- # <teach skill: x, x, x>
- # Put this in an item notebox and replace x with the skill ID(s) you want the
- # item to teach an actor(s) when applied to them.
- #
- # <target temp param: +x>
- # <target temp param: -x>
- # Placed in an item's or skill's notebox, these give a temporary boost or fall
- # to the specified parameter of the target of the skill or item until the end
- # of the battle. Replace param with maxhp, maxmp, atk, def, spi agi, hit, eva,
- # cri and odds (and dex or res if you have the scripts). To make several
- # effects, use multiple tags.
- #
- # <user temp param: +x>
- # <user temp param: -x>
- # These do the same as <target temp param>, only for the user of the skill.
- # Enter them the same as target temp param tags.
- #
- # <clear temp stats: user>
- # <clear temp stats: target>
- # Will clear the temporary boosts and falls of either the user or target,
- # respectively.
- #
- # \sticky
- # Place this in a weapon or armor's notebox to make it a sticky piece, meaning
- # that it cannot be unequipped from the equip menu. It can still be unequipped
- # via event commands.
- # \unsticky
- # Place this in an item or skill's notebox to make it able to remove sticky
- # equipment. If you want to remove all sticky pieces equipped to an actor, use:
- # $game_actors[ACTOR_ID].unequip_sticky_equips
- #
- #===============================================================================
- #
- # BEGIN PAC SKILL AND EQUIP ADDONS
- #
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["PAC_ISaEAddons_1.6"] = true
- #===============================================================================
- #
- # PAC EQUIP SKILLS
- #
- #===============================================================================
- #==============================================================================
- # RPG::BaseItem
- #==============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # skills
- #--------------------------------------------------------------------------
- def skills
- return @equipment_skills if @equipment_skills != nil
- @equipment_skills = []
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:EQUIPMENTSKILL|equipskill):[ ](\d+(?:\s*,\s*\d+)*)>/i
- $1.scan(/\d+/).each { |num|
- @equipment_skills.push($data_skills[num.to_i]) if num.to_i > 0 }
- end
- }
- return @equipment_skills
- end
- end
- #==============================================================================
- # Game Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # skills
- #--------------------------------------------------------------------------
- alias pac_saea_skills skills unless $@
- def skills
- list = pac_saea_skills
- for equip in equips.compact
- next if equip == nil
- list += equip.skills
- end
- return list.uniq
- end
- #--------------------------------------------------------------------------
- # skill_can_use?
- #--------------------------------------------------------------------------
- def skill_can_use?(skill)
- return super(skill)
- end
- end
- #===============================================================================
- #
- # PAC BREAK EQUIP
- #
- #===============================================================================
- #==============================================================================
- # RPG::Skill
- #==============================================================================
- class RPG::Skill < RPG::UsableItem
- #--------------------------------------------------------------------------
- # # Equipment Break
- #--------------------------------------------------------------------------
- def equipment_break
- return @equipment_break if @equipment_break != nil
- @equipment_break = []
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:BREAK EQUIP|break equips):[ ](\d+(?:\s*,\s*\d+)*)>/i
- $1.scan(/\d+/).each { |num| @equipment_break.push(num.to_i) }
- end
- }
- return @equipment_break
- end
- #--------------------------------------------------------------------------
- # # Equipment Repair
- #--------------------------------------------------------------------------
- def equipment_repair
- return @equipment_repair if @equipment_repair != nil
- @equipment_repair = []
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:REPAIR EQUIP|repair equips):[ ](\d+(?:\s*,\s*\d+)*)>/i
- $1.scan(/\d+/).each { |num| @equipment_repair.push(num.to_i) }
- end
- }
- return @equipment_repair
- end
- end
- #==============================================================================
- # ** Game_Battler
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # * Apply Skill Effects
- #--------------------------------------------------------------------------
- alias pac_saea_skill_effect skill_effect unless $@
- def skill_effect(user, skill)
- pac_saea_skill_effect(user, skill)
- break_equipment(skill) unless @skipped or @missed or @evaded
- repair_equipment(skill) unless @skipped or @missed or @evaded
- end
- #--------------------------------------------------------------------------
- # * Break Equipment
- #--------------------------------------------------------------------------
- def break_equipment(skill)
- return unless $game_temp.in_battle
- return unless actor?
- return if skill.equipment_break.empty?
- @broken_equipment = [] if @broken_equipment.nil?
- @broken_equipment += skill.equipment_break
- end
- #--------------------------------------------------------------------------
- # * Repair Equipment
- #--------------------------------------------------------------------------
- def repair_equipment(skill)
- return unless $game_temp.in_battle
- return unless actor?
- return if skill.equipment_break.empty?
- @broken_equipment = [] if @broken_equipment.nil?
- @broken_equipment -= skill.equipment_repair
- end
- end
- #==============================================================================
- # ** Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # * Get Weapon Object Array
- #--------------------------------------------------------------------------
- alias pac_saea_weapons weapons unless $@
- def weapons
- result = pac_saea_weapons
- @broken_equipment = [] if @broken_equipment.nil?
- result[0] = nil if @broken_equipment.include?(0)
- result[1] = nil if two_swords_style and @broken_equipment.include?(1)
- return result
- end
- #--------------------------------------------------------------------------
- # * Get Armor Object Array
- #--------------------------------------------------------------------------
- alias pac_saea_armors armors unless $@
- def armors
- result = pac_saea_armors
- @broken_equipment = [] if @broken_equipment.nil?
- for i in @broken_equipment
- next if i == 0
- result[i-1] = nil
- end
- return result
- end
- #--------------------------------------------------------------------------
- # * Clear Broken Equipment
- #--------------------------------------------------------------------------
- def clear_broken_equipment
- @broken_equipment = []
- end
- end
- #==============================================================================
- # ** Scene_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # * Start processing
- #--------------------------------------------------------------------------
- alias pac_saea_start start unless $@
- def start
- for member in $game_party.members do member.clear_broken_equipment end
- pac_saea_start
- end
- #--------------------------------------------------------------------------
- # * End Battle
- #--------------------------------------------------------------------------
- alias pac_saea_battle_end battle_end unless $@
- def battle_end(result)
- for member in $game_party.members do member.clear_broken_equipment end
- pac_saea_battle_end(result)
- end
- end
- #===============================================================================
- #
- # PAC FORGET SKILLS
- #
- #===============================================================================
- class RPG::Skill < RPG::UsableItem
- #--------------------------------------------------------------------------
- # * Forget Upon Learning
- #--------------------------------------------------------------------------
- def forget_upon_learning
- return @forget_upon_learning if @forget_upon_learning != nil
- @forget_upon_learning = []
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:FORGET SKILL|forget skills):[ ](\d+(?:\s*,\s*\d+)*)>/i
- $1.scan(/\d+/).each { |num| @forget_upon_learning.push(num.to_i) }
- end
- }
- return @forget_upon_learning
- end
- end
- #==============================================================================
- # ** Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # * Learn Skill
- #--------------------------------------------------------------------------
- alias pac_forget_learn_skill learn_skill unless $@
- def learn_skill(skill_id)
- unless skill_learn?($data_skills[skill_id])
- for sk_id in $data_skills[skill_id].forget_upon_learning
- forget_skill(sk_id)
- end
- end
- pac_forget_learn_skill(skill_id)
- end
- end
- #===============================================================================
- #
- # PAC PASSIVE SKILLS
- #
- #===============================================================================
- #==============================================================================
- # 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_pac_passive_skills states unless $@
- def states
- array = states_pac_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_pac_passive_skills base_maxhp unless $@
- def base_maxhp
- n = base_maxhp_pac_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_pac_passive_skills base_maxmp unless $@
- def base_maxmp
- n = base_maxmp_pac_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_pac_passive_skills base_atk unless $@
- def base_atk
- n = base_atk_pac_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_pac_passive_skills base_def unless $@
- def base_def
- n = base_def_pac_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_pac_passive_skills base_spi unless $@
- def base_spi
- n = base_spi_pac_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_pac_passive_skills base_agi unless $@
- def base_agi
- n = base_agi_pac_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_pac_passive_skills base_dex unless $@
- def base_dex
- n = base_dex_pac_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_pac_passive_skills base_res unless $@
- def base_res
- n = base_res_pac_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_pac_passive_skills hit unless $@
- def hit
- n = hit_pac_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_pac_passive_skills eva unless $@
- def eva
- n = eva_pac_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_pac_passive_skills cri unless $@
- def cri
- n = cri_pac_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 Ease of Hitting
- #--------------------------------------------------------------------------
- alias odds_pac_passive_skills odds unless $@
- def odds
- n = odds_pac_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
- #===============================================================================
- #
- # PAC Item Teaching Skills
- #
- #===============================================================================
- #==============================================================================
- # RPG::BaseItem
- #==============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # teach_skills
- #--------------------------------------------------------------------------
- def teach_skills
- return @teach_skills if @teach_skills != nil
- @teach_skills = []
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:TEACH SKILL|LEARN SKILL):[ ](\d+(?:\s*,\s*\d+)*)>/i
- $1.scan(/\d+/).each { |num|
- @teach_skills.push(num.to_i) if num.to_i > 0 }
- end
- }
- return @teach_skills
- end
- end
- #==============================================================================
- # ** Game_Battler
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # * Item Application Test
- #--------------------------------------------------------------------------
- alias item_test_pac_teachskillitems item_test unless $@
- def item_test(user, item)
- return true if item.teach_skills != []
- return item_test_pac_teachskillitems(user, item)
- end
- #--------------------------------------------------------------------------
- # * Apply Item Effects
- #--------------------------------------------------------------------------
- alias item_effect_pac_teachskillitems item_effect unless $@
- def item_effect(user, item)
- item_effect_pac_teachskillitems(user, item)
- return if @skipped or @missed or @evaded
- teach_item_skills(item) if actor?
- end
- #--------------------------------------------------------------------------
- # * teach_item_skills
- #--------------------------------------------------------------------------
- def teach_item_skills(item)
- for skill_id in item.teach_skills do learn_skill(skill_id) end
- end
- end
- #===============================================================================
- #
- # PAC TEMPORARY BOOSTS
- #
- #===============================================================================
- #==============================================================================
- # RPG::BaseItem
- #==============================================================================
- class RPG::BaseItem
- #--------------------------------------------------------------------------
- # target_temp_boost
- #--------------------------------------------------------------------------
- def target_temp_boost
- return @target_temp_boost if @target_temp_boost != nil
- @target_temp_boost = {:maxhp => 0, :maxmp => 0, :atk => 0, :def => 0,
- :spi => 0, :agi => 0, :hit => 0, :eva => 0, :cri => 0, :odds => 0,
- :dex => 0, :res => 0}
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:TARGET TEMPORARY|target temp)[ ](.*):[ ]([\+\-]\d+)>/i
- case $1.upcase
- when "MAXHP"
- @target_temp_boost[:maxhp] = $2.to_i
- when "MAXMP"
- @target_temp_boost[:maxmp] = $2.to_i
- when "ATK"
- @target_temp_boost[:atk] = $2.to_i
- when "DEF"
- @target_temp_boost[:def] = $2.to_i
- when "SPI"
- @target_temp_boost[:spi] = $2.to_i
- when "AGI"
- @target_temp_boost[:agi] = $2.to_i
- when "HIT"
- @target_temp_boost[:hit] = $2.to_i
- when "EVA"
- @target_temp_boost[:eva] = $2.to_i
- when "CRI"
- @target_temp_boost[:cri] = $2.to_i
- when "ODDS"
- @target_temp_boost[:odds] = $2.to_i
- when "DEX"
- @target_temp_boost[:dex] = $2.to_i
- when "RES"
- @target_temp_boost[:res] = $2.to_i
- end
- end
- }
- return @target_temp_boost
- end
- #--------------------------------------------------------------------------
- # user_temp_boost
- #--------------------------------------------------------------------------
- def user_temp_boost
- return @user_temp_boost if @user_temp_boost != nil
- @user_temp_boost = {:maxhp => 0, :maxmp => 0, :atk => 0, :def => 0,
- :spi => 0, :agi => 0, :hit => 0, :eva => 0, :cri => 0, :odds => 0,
- :dex => 0, :res => 0}
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:USER TEMPORARY|user temp)[ ](.*):[ ]([\+\-]\d+)>/i
- case $1.upcase
- when "MAXHP"
- @user_temp_boost[:maxhp] = $2.to_i
- when "MAXMP"
- @user_temp_boost[:maxmp] = $2.to_i
- when "ATK"
- @user_temp_boost[:atk] = $2.to_i
- when "DEF"
- @user_temp_boost[:def] = $2.to_i
- when "SPI"
- @user_temp_boost[:spi] = $2.to_i
- when "AGI"
- @user_temp_boost[:agi] = $2.to_i
- when "HIT"
- @user_temp_boost[:hit] = $2.to_i
- when "EVA"
- @user_temp_boost[:eva] = $2.to_i
- when "CRI"
- @user_temp_boost[:cri] = $2.to_i
- when "ODDS"
- @user_temp_boost[:odds] = $2.to_i
- when "DEX"
- @user_temp_boost[:dex] = $2.to_i
- when "RES"
- @user_temp_boost[:res] = $2.to_i
- end
- end
- }
- return @user_temp_boost
- end
- #--------------------------------------------------------------------------
- # clear_temp_stats
- #--------------------------------------------------------------------------
- def clear_temp_stats
- return @clear_temp_stats if @clear_temp_stats != nil
- @clear_temp_stats = {:user => false, :target => false}
- self.note.split(/[\r\n]+/).each { |line|
- case line
- when /<(?:CLEAR TEMP STATS|clear temp boosts)[ ](.*)>/i
- case $1.upcase
- when "USER"
- @clear_temp_stats[:user] = true
- when "TARGET", "TARGETS"
- @clear_temp_stats[:target] = true
- end
- end
- }
- return @clear_temp_stats
- end
- end
- #==============================================================================
- # ** Game_Battler
- #==============================================================================
- class Game_Battler
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias initialize_pac_temp_stat_boosts initialize unless $@
- def initialize
- initialize_pac_temp_stat_boosts
- clear_temp_stat_boosts
- end
- #--------------------------------------------------------------------------
- # * Clear Temp Stat Boosts
- #--------------------------------------------------------------------------
- def clear_temp_stat_boosts
- @temp_maxhp_boost = 0
- @temp_maxmp_boost = 0
- @temp_atk_boost = 0
- @temp_def_boost = 0
- @temp_spi_boost = 0
- @temp_agi_boost = 0
- @temp_hit_boost = 0
- @temp_eva_boost = 0
- @temp_cri_boost = 0
- @temp_odds_boost = 0
- @temp_dex_boost = 0
- @temp_res_boost = 0
- end
- #--------------------------------------------------------------------------
- # * Apply Temp Boost
- #--------------------------------------------------------------------------
- def apply_temp_boost(hash)
- @temp_maxhp_boost += hash[:maxhp]
- @temp_maxmp_boost += hash[:maxmp]
- @temp_atk_boost += hash[:atk]
- @temp_def_boost += hash[:def]
- @temp_spi_boost += hash[:spi]
- @temp_agi_boost += hash[:agi]
- @temp_hit_boost += hash[:hit]
- @temp_eva_boost += hash[:eva]
- @temp_cri_boost += hash[:cri]
- @temp_odds_boost += hash[:odds]
- @temp_dex_boost += hash[:dex]
- @temp_res_boost += hash[:res]
- end
- #--------------------------------------------------------------------------
- # * Apply Skill Effects
- #--------------------------------------------------------------------------
- alias skill_effect_pac_temp_boosts skill_effect unless $@
- def skill_effect(user, skill)
- skill_effect_pac_temp_boosts(user, skill)
- return unless $game_temp.in_battle
- return if @skipped or @missed or @evaded
- clear_temp_stat_boosts if skill.clear_temp_stats[:target]
- user.clear_temp_stat_boosts if skill.clear_temp_stats[:user]
- apply_temp_boost(skill.target_temp_boost)
- user.apply_temp_boost(skill.user_temp_boost)
- end
- #--------------------------------------------------------------------------
- # * Apply Item Effects
- #--------------------------------------------------------------------------
- alias item_effect_pac_temp_boosts item_effect unless $@
- def item_effect(user, item)
- item_effect_pac_temp_boosts(user, item)
- return unless $game_temp.in_battle
- return if @skipped or @missed or @evaded
- clear_temp_stat_boosts if item.clear_temp_stats[:target]
- user.clear_temp_stat_boosts if item.clear_temp_stats[:user]
- apply_temp_boost(item.target_temp_boost)
- user.apply_temp_boost(item.user_temp_boost)
- end
- #--------------------------------------------------------------------------
- # * Maxmp Limit
- #--------------------------------------------------------------------------
- unless method_defined?(:maxmp_limit)
- def maxmp_limit; return 9999; end
- end
- #--------------------------------------------------------------------------
- # * Parameter Limit
- #--------------------------------------------------------------------------
- unless method_defined?(:parameter_limit)
- def parameter_limit; return 999; end
- end
- #--------------------------------------------------------------------------
- # * Get Maximum HP
- #--------------------------------------------------------------------------
- alias maxhp_pac_temp_boosts maxhp unless $@
- def maxhp
- clear_temp_stat_boosts if @temp_maxhp_boost.nil?
- return [[maxhp_pac_temp_boosts + @temp_maxhp_boost, 1].max, maxhp_limit].min
- end
- #--------------------------------------------------------------------------
- # * Get Maximum MP
- #--------------------------------------------------------------------------
- alias maxmp_pac_temp_boosts maxmp unless $@
- def maxmp
- clear_temp_stat_boosts if @temp_maxmp_boost.nil?
- return [[maxmp_pac_temp_boosts + @temp_maxmp_boost, 0].max, maxmp_limit].min
- end
- #--------------------------------------------------------------------------
- # * Get Attack
- #--------------------------------------------------------------------------
- alias atk_pac_temp_boosts atk unless $@
- def atk
- clear_temp_stat_boosts if @temp_atk_boost.nil?
- return [[atk_pac_temp_boosts + @temp_atk_boost, 1].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # * Get Defense
- #--------------------------------------------------------------------------
- alias def_pac_temp_boosts def unless $@
- def def
- clear_temp_stat_boosts if @temp_def_boost.nil?
- return [[def_pac_temp_boosts + @temp_def_boost, 1].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # * Get Spirit
- #--------------------------------------------------------------------------
- alias spi_pac_temp_boosts spi unless $@
- def spi
- clear_temp_stat_boosts if @temp_spi_boost.nil?
- return [[spi_pac_temp_boosts + @temp_spi_boost, 1].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # * Get Agility
- #--------------------------------------------------------------------------
- alias agi_pac_temp_boosts agi unless $@
- def agi
- clear_temp_stat_boosts if @temp_agi_boost.nil?
- return [[agi_pac_temp_boosts + @temp_agi_boost, 1].max, parameter_limit].min
- end
- #--------------------------------------------------------------------------
- # * Get Dexterity
- #--------------------------------------------------------------------------
- if $imported["DEX Stat"]
- alias dex_pac_temp_boosts dex unless $@
- def dex
- clear_temp_stat_boosts if @temp_dex_boost.nil?
- return [[dex_pac_temp_boosts + @temp_dex_boost, 1].max, parameter_limit].min
- end
- end
- #--------------------------------------------------------------------------
- # * Get Resist
- #--------------------------------------------------------------------------
- if $imported["RES Stat"]
- alias res_pac_temp_boosts res unless $@
- def res
- clear_temp_stat_boosts if @temp_res_boost.nil?
- return [[res_pac_temp_boosts + @temp_res_boost, 1].max, parameter_limit].min
- end
- end
- end
- #==============================================================================
- # ** Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # * Get Hit Rate
- #--------------------------------------------------------------------------
- alias hit_pac_temp_boosts_actor hit unless $@
- def hit
- clear_temp_stat_boosts if @temp_hit_boost.nil?
- return [hit_pac_temp_boosts_actor + @temp_hit_boost, 0].max
- end
- #--------------------------------------------------------------------------
- # * Get Evasion Rate
- #--------------------------------------------------------------------------
- alias eva_pac_temp_boosts_actor eva unless $@
- def eva
- clear_temp_stat_boosts if @temp_eva_boost.nil?
- return [eva_pac_temp_boosts_actor + @temp_eva_boost, 0].max
- end
- #--------------------------------------------------------------------------
- # * Get Critical Ratio
- #--------------------------------------------------------------------------
- alias cri_pac_temp_boosts_actor cri unless $@
- def cri
- clear_temp_stat_boosts if @temp_cri_boost.nil?
- return [cri_pac_temp_boosts_actor + @temp_cri_boost, 0].max
- end
- #--------------------------------------------------------------------------
- # * Get Ease of Hitting
- #--------------------------------------------------------------------------
- alias odds_pac_temp_boosts_actor odds unless $@
- def odds
- clear_temp_stat_boosts if @temp_odds_boost.nil?
- return [odds_pac_temp_boosts_actor + @temp_odds_boost, 0].max
- end
- end
- #==============================================================================
- # ** Game_Enemy
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # * Get Hit Rate
- #--------------------------------------------------------------------------
- alias hit_pac_temp_boosts_enemy hit unless $@
- def hit
- clear_temp_stat_boosts if @temp_hit_boost.nil?
- return [hit_pac_temp_boosts_enemy + @temp_hit_boost, 0].max
- end
- #--------------------------------------------------------------------------
- # * Get Evasion Rate
- #--------------------------------------------------------------------------
- alias eva_pac_temp_boosts_enemy eva unless $@
- def eva
- clear_temp_stat_boosts if @temp_eva_boost.nil?
- return [eva_pac_temp_boosts_enemy + @temp_eva_boost, 0].max
- end
- #--------------------------------------------------------------------------
- # * Get Critical Ratio
- #--------------------------------------------------------------------------
- alias cri_pac_temp_boosts_enemy cri unless $@
- def cri
- clear_temp_stat_boosts if @temp_cri_boost.nil?
- return [cri_pac_temp_boosts_enemy + @temp_cri_boost, 0].max
- end
- #--------------------------------------------------------------------------
- # * Get Ease of Hitting
- #--------------------------------------------------------------------------
- alias odds_pac_temp_boosts_enemy odds unless $@
- def odds
- clear_temp_stat_boosts if @temp_odds_boost.nil?
- return [odds_pac_temp_boosts_enemy + @temp_odds_boost, 0].max
- end
- end
- #==============================================================================
- # ** Scene_Battle
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # * Battle Start Processing
- #--------------------------------------------------------------------------
- alias process_battle_start_pac_temp_boosts process_battle_start unless $@
- def process_battle_start
- for member in $game_party.members
- member.clear_temp_stat_boosts
- end
- process_battle_start_pac_temp_boosts
- end
- #--------------------------------------------------------------------------
- # * End Battle
- #--------------------------------------------------------------------------
- alias battle_end_pac_temp_boosts battle_end unless $@
- def battle_end(result)
- battle_end_pac_temp_boosts(result)
- for member in $game_party.members
- member.clear_temp_stat_boosts
- end
- end
- end
- #===============================================================================
- #
- # PAC STICKY EQUIPMENT
- #
- #===============================================================================
- #===============================================================================
- # *** RPG
- #-------------------------------------------------------------------------------
- # Module for RPGVX data structures.
- #===============================================================================
- module RPG
- #===============================================================================
- # ** UsableItem
- #-------------------------------------------------------------------------------
- # Superclass for items and skills.
- #===============================================================================
- class UsableItem
- #--------------------------------------------------------------------------
- # * remove_sticky?
- #--------------------------------------------------------------------------
- def remove_sticky?
- @unsticky = !self.note[/\\UNSTICKY/i].nil? if @unsticky.nil?
- return @unsticky
- end
- end
- #===============================================================================
- # ** Weapon
- #-------------------------------------------------------------------------------
- # Data class for weapons.
- #===============================================================================
- class Weapon
- #--------------------------------------------------------------------------
- # * sticky?
- #--------------------------------------------------------------------------
- def sticky?
- @sticky = !self.note[/\\STICKY/i].nil? if @sticky.nil?
- return @sticky
- end
- end
- #===============================================================================
- # ** Armor
- #-------------------------------------------------------------------------------
- # Data class for armor.
- #===============================================================================
- class Armor
- #--------------------------------------------------------------------------
- # * sticky?
- #--------------------------------------------------------------------------
- def sticky?
- @sticky = !self.note[/\\STICKY/i].nil? if @sticky.nil?
- return @sticky
- end
- end
- end # RPG
- #==============================================================================
- # ** Game_Actor
- #------------------------------------------------------------------------------
- # This class handles actors. It's used within the Game_Actors class
- # ($game_actors) and referenced by the Game_Party class ($game_party).
- #==============================================================================
- class Game_Actor
- #--------------------------------------------------------------------------
- # alias listing
- #--------------------------------------------------------------------------
- alias pac_stky_eqp_skill_tst skill_test
- alias pac_stky_eqp_skill_effect skill_effect
- alias pac_stky_eqp_item_test item_test
- alias pac_stky_eqp_item_effect item_effect
- #--------------------------------------------------------------------------
- # * Skill Test
- #--------------------------------------------------------------------------
- def skill_test (user, skill, *args)
- if skill.remove_sticky?
- equips.each { |equip| return true if !equip.nil? && equip.sticky? }
- end
- return pac_stky_eqp_skill_tst(user, skill, *args) # Run Original Method
- end
- #--------------------------------------------------------------------------
- # * Skill Effect
- #--------------------------------------------------------------------------
- def skill_effect (user, skill, *args)
- unequip_sticky_equips if skill.remove_sticky?
- pac_stky_eqp_skill_effect(user, skill, *args) # Run Original Method
- end
- #--------------------------------------------------------------------------
- # * Item Test
- #--------------------------------------------------------------------------
- def item_test (user, item, *args)
- if item.remove_sticky?
- equips.each { |equip| return true if !equip.nil? && equip.sticky? }
- end
- return pac_stky_eqp_item_test(user, item, *args) # Run Original Method
- end
- #--------------------------------------------------------------------------
- # * Item Effect
- #--------------------------------------------------------------------------
- def item_effect(user, item, *args)
- pac_stky_eqp_item_effect(user, item, *args) # Run Original Method
- unequip_sticky_equips if item.remove_sticky?
- end
- #--------------------------------------------------------------------------
- # * Unequip sticky Items
- #--------------------------------------------------------------------------
- def unequip_sticky_equips
- for i in 0...equips.size
- change_equip(i, nil, false) if !equips[i].nil? && equips[i].sticky?
- end
- end
- end
- #==============================================================================
- # ** Scene_Equip
- #------------------------------------------------------------------------------
- # This class performs the equipment screen processing.
- #==============================================================================
- class Scene_Equip
- #--------------------------------------------------------------------------
- # alias listing
- #--------------------------------------------------------------------------
- alias pac_stky_eqp_update_equip_selection update_equip_selection
- #--------------------------------------------------------------------------
- # * Update Equip Region Selection
- #--------------------------------------------------------------------------
- def update_equip_selection(*args)
- if Input.trigger?(Input::C) && !@equip_window.item.nil? && @equip_window.item.sticky?
- Sound.play_buzzer
- return
- end
- pac_stky_eqp_update_equip_selection(*args) # Run Original Method
- end
- end
- #===============================================================================
- #
- # END OF SCRIPT
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement