Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- #==============================================================================
- ** Effect: Share the pain
- Author: Estriole
- Date: Nov 2, 2012
- revised: Apr 30, 2021
- Effect Manager Version : 2.6
- ------------------------------------------------------------------------------
- ** Change log
- ------------------------------------------------------------------------------
- ** Terms of Use
- * Free to use in commercial/non-commercial projects
- * No real support. The script is provided as-is
- * Will do bug fixes, but no compatibility patches
- * Features may be requested but no guarantees, especially if it is non-trivial
- * Preserve this header
- ------------------------------------------------------------------------------
- if anyone damage actor/enemy with this state. all the party member/ troop member
- that have the same state will suffer the same damage.
- tag the state with this:
- <eff: share_the_pain x>
- Where x is the percentage of damage that should be shared.
- By default it is 1, which means 100%
- to make every 1hp damage deal 10hp damage to other share the pain... change it to 10
- to make only 20% just change to 0.2
- #==============================================================================
- =end
- $imported = {} if $imported.nil?
- $imported["Effect_ShareThePain"] = true
- #==============================================================================
- # ** Rest of the script
- #==============================================================================
- module Effect
- module Share_The_Pain
- Effect_Manager.register_effect(:share_the_pain,2.6)
- end
- end
- class Game_Battler < Game_BattlerBase
- def state_effect_share_the_pain_guard(user, state, effect)
- return if user == self
- return if @result.hp_damage <=0
- mod = eval(effect.value1[0]) rescue 1
- hp_damage = (@result.hp_damage * mod).to_i
- for member in $game_party.battle_members
- next if !member.state?(state.id)
- next if member == self
- member.hp -= hp_damage if hp_damage >0
- member.perform_collapse_effect if member.dead?
- @result.effect_results.push("%s shared the pain and received %d damage" %[member.name, hp_damage.to_i])
- end
- for enemy in $game_troop.members
- next if !enemy.state?(state.id)
- next if enemy == self
- enemy.hp -= hp_damage if hp_damage >0
- enemy.perform_collapse_effect if enemy.dead?
- @result.effect_results.push("%s shared the pain and received %d damage" %[enemy.name, hp_damage.to_i])
- end
- @result.success = true
- end
- end
Add Comment
Please, Sign In to add comment