Multiple Floor Damage Types

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
Found this script by Kio Kurashi and added more to it for the request that was made on another site here

Damage for more types of floors v1.1
Kio Kurashi
Introduction

Allows you to specify different damage amounts for different tiles.

Features
Original script just specified how much damage was to be received when walking on that tile.
I modified it so that the damage will repeat when standing on the same tile without moving.
Effectively making the script a continuous floor damage script

How to Use
Place script below materials and above main.
Configure in the script your terrain tags and damage amounts.
Go into you tilesets and set the damage floor tile and terrain tags, matching what you configured in the script.
This script will check every map not just specific maps so repeating the terrain tags for
non floor damage tiles will cause them to be damage tiles.

Included is a switch that when turned on will stop the continuous damage effect.
(if you know how you can swap this so that it only works when the switch is on)
You also can specify the time interval for when the damage will reoccur. 60 = 1 second

Script
Ruby:
=begin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
=end


#~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~     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

DAMAGE_INT = 60        # interval at which the damage effect will apply again.
DAMAGE_SWITCH = 1

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::DAMAGE_SWITCH]
      @standingtime += 1 if !$game_map.interpreter.running?
      actor.check_floor_effect if @standingtime > R2_Floor_Damage::DAMAGE_INT
      @standingtime = 0 if @standingtime > R2_Floor_Damage::DAMAGE_INT
    end
    r2_fdr_update_nonmoving(last_moving)
  end
end

Credit and Thanks
- Kio Kurashi

Terms of use
None Specified and script was provided in an open capacity so,
Free for commercial and non commercial with credit
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top