Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #Damage for more types of Floors Script v 1.1
- #Author = Kio Kurashi
- #Credit = Kio Kurashi
- #Modded by Roninator2
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #Notes:
- # Currently this script only works for three types of Floor damage. It doesn't
- # nessesarly need to be Poison, Lava, and Shock, however. If more than the
- # provided number of Floors are needed I can add more.
- #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #Instructions:
- # The editable section is directly bellow. For each you will have a Terrain tag,
- # and a Damage ammount. The Terrain tag will be a number between 0 and 7.
- # as the number on the tiles. Damage will be the Base damage that is
- # applied for each number.
- #Important:
- # The map tileset must be properly configured.
- # The tile that will be a damage tile must be marked as a damage tile. go figure
- # The tile must also have the terrain tag matching the settings below.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #Update:
- # The script will now apply a damage effect at the specified interval
- # 60 = 1 second
- # Also available is a switch to turn the interval damage off.
- # Turn switch on to stop interval damage.
- #~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #~ BEGINING OF EDITABLE SECTION
- #~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- module R2_Floor_Damage
- NORMAL_TERRAIN_REGION = 0 # This is rather useless since I doubt that
- NORMAL_TERRAIN_DAMAGE = 0 # any normal Terrain would be checking for this.
- POISON_TERRAIN_REGION = 1
- POISON_TERRAIN_DAMAGE = 10
- LAVA_TERRAIN_REGION = 2
- LAVA_TERRAIN_DAMAGE = 20
- SHOCK_TERRAIN_REGION = 3
- SHOCK_TERRAIN_DAMAGE = 30
- FDR_DAMAGE_INT = 60 # interval at which the damage effect will apply again.
- FDR_DAMAGE_SWITCH = 1 # Turn switch on to turn off interval damage
- end
- #~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #~ END OF EDITABLE SECTION
- #~ Editing beyond this point without prior knowledge is dangerous!!
- #~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- class Game_Actor
- def basic_floor_damage
- case $game_map.terrain_tag($game_player.x, $game_player.y)
- when R2_Floor_Damage::NORMAL_TERRAIN_REGION
- return R2_Floor_Damage::NORMAL_TERRAIN_DAMAGE
- when R2_Floor_Damage::POISON_TERRAIN_REGION
- return R2_Floor_Damage::POISON_TERRAIN_DAMAGE
- when R2_Floor_Damage::LAVA_TERRAIN_REGION
- return R2_Floor_Damage::LAVA_TERRAIN_DAMAGE
- when R2_Floor_Damage::SHOCK_TERRAIN_REGION
- return R2_Floor_Damage::SHOCK_TERRAIN_DAMAGE
- when nil
- return 10
- end
- end
- end
- class Game_Player < Game_Character
- alias r2_fdr_initialize initialize
- def initialize
- @standingtime = 0
- r2_fdr_initialize
- end
- alias r2_input_move_fdr move_by_input
- def move_by_input
- @standingtime = 0 if $game_player.moving?
- r2_input_move_fdr
- end
- alias r2_fdr_update_nonmoving update_nonmoving
- def update_nonmoving(last_moving)
- if !$game_switches[R2_Floor_Damage::FDR_DAMAGE_SWITCH]
- @standingtime += 1 if !$game_map.interpreter.running?
- actor.check_floor_effect if @standingtime > R2_Floor_Damage::FDR_DAMAGE_INT
- @standingtime = 0 if @standingtime > R2_Floor_Damage::FDR_DAMAGE_INT
- end
- r2_fdr_update_nonmoving(last_moving)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement