Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ==============================================================================
- # ▼▼▼▼▼▼ TroyZ - Slip Damage Mods ▼▼▼▼▼▼
- # ==============================================================================
- # Script by : Agung Prasetyo(TroyZ)
- # Contact me by : - Email agung.endisnear.xyz@gmail.com
- # - Forum RPGMakerID, username TroyZ
- # - Handphone 085756289121
- # Engine : VXAce
- # Level : Easy
- # Version : 1.0
- # ------------------------------------------------------------------------------
- # Change Logs :
- # 5 October 2014 : Version 1.0 released
- # ------------------------------------------------------------------------------
- # How this work :
- # Inspired by DotA hero Lesale Deathbringer - The Venomancer, where he have
- # 3 skills for poisoning the enemy. 2 of his skills (Venomous Gale and Poison
- # Sting) have slip damage that can kill the enemy, whether 1 of his skills
- # (Poison Nova, his ultimate skill), also have slip damage but can't kill the
- # enemy (the damage stops at 1 hp). This script allows you to create states
- # that have both possibilities.
- # ------------------------------------------------------------------------------
- # How to use :
- # Place it between material and main. Use this notetag inside states :
- #
- # <death on slip>
- #
- # The states that have this notetag will kill the target that get slipped by
- # the damage. States that don't have this notetag won't kill the target (the
- # damage stops at 1 hp). Make sure that the states that have killing slip damage
- # properties being set at higher priority than the states that doesn't have
- # killing slip damage properties.
- # ------------------------------------------------------------------------------
- # Compatibility issues :
- # - Theo In Map Slip Damage : put this script below that script.
- # - Theo State Damage Using Skill : put this script below Theo Basic Modules and
- # Theo State Damage Using Skill (needs both
- # scripts to work).
- # Also, this script overwrite the def regenerate_hp method, so KO by Slip Damage
- # option at the system tab of Database won't have any effects anymore.
- # ------------------------------------------------------------------------------
- # Who to credit :
- # - Allah swt. : For the chance of living that he has given to me.
- # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
- # I'm proud to be your follower. :)
- # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
- # ------------------------------------------------------------------------------
- # License :
- # - Free Game : Just credit those names above.
- # - Commercial Game : Same as free game's license.
- # ------------------------------------------------------------------------------
- $imported = {} if $imported.nil?
- $imported[:TroyZ_SlipDamageMods] = true
- # ------------------------------------------------------------------------------
- # There is nothing to config beyond this line
- # ------------------------------------------------------------------------------
- class RPG::State < RPG::BaseItem
- def slip_damage_death?
- self.note.include?("<death on slip>")
- end
- end
- class Game_Battler < Game_BattlerBase
- def base_damage(user, item)
- value = item.damage.eval(user, self, $game_variables)
- states.each do |state|
- return value if state.slip_damage_death?
- return [value, [hp - 1, 0].max].min
- end
- value
- end
- def regenerate_hp
- states.each do |state|
- return slip_kill if state.slip_damage_death?
- return slip_doesnt_kill
- end
- return slip_doesnt_kill
- end
- def slip_kill
- damage = -(mhp * hrg).to_i
- perform_map_damage_effect if $game_party.in_battle && damage > 0
- @result.hp_damage = [damage, hp].min
- self.hp -= @result.hp_damage
- end
- def slip_doesnt_kill
- damage = -(mhp * hrg).to_i
- perform_map_damage_effect if $game_party.in_battle && damage > 0
- @result.hp_damage = [damage, [hp - 1, 0].max].min
- self.hp -= @result.hp_damage
- end
- end
- class Game_Actor < Game_Battler
- def perform_hp_damage(state)
- return unless slip_hp?(state)
- states.each do |state|
- if state.slip_damage_death?
- self.hp -= state.hp_slip_con
- self.hp -= mhp * state.hp_slip_per
- else
- self.hp -= [state.hp_slip_con, [hp - 1, 0].max].min
- self.hp -= [mhp * state.hp_slip_per, [hp - 1, 0].max].min
- end
- perform_flash_hp_damage
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement