09-14-2016, 04:26 AM
I hope this helps. Right now, this script has the first map set to just put damage on two areas of tiles. Yep, map coordinates CAN overlap without accidentally causing double damage.
Code:
#==============================================================================
# ** Map Coordinate Slip Damage
#------------------------------------------------------------------------------
# by your Friendly Neighborhood Werewolf (aka DerVVulfman)
#------------------------------------------------------------------------------
#
# This lets you create a set of coordinates within a map that performs slip
# damage separate from the normal 'status ailment' created damage.
#
# NOTE: Slip Damage is based on the character's Max HP, subtracting 1% of
# their max HP every step.... set on line 58.
# If you want to have actor HP reduced by a flat 10HP each step, just
# set line 58 to: actor.hp -= 10
#
#==============================================================================
module MapCoordSlip
# -------------------------------------------------------------------------
MAP = {} # Do Not Touch
# -------------------------------------------------------------------------
# MAP ARRAY
#
MAP[1] = [
[3,3,16,11], # Sets an area from (3,3) to (16,20)
[2,5,2,15] # Sets an area from (2,5) to (2,15)
]
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Slip Damage Check (for map)
#--------------------------------------------------------------------------
def extra_slip_damage
# Get the map coord list for that map
return unless MapCoordSlip::MAP.has_key?($game_map.map_id)
# Create list of array coordinates
coord_list = []
coord_list = MapCoordSlip::MAP[$game_map.map_id]
# Cycle through map coordinates for map
for coord in coord_list
# If the player is in matching coordinates
if ($game_player.x).between?(coord[0],coord[2]) &&
($game_player.y).between?(coord[1],coord[3])
# Cycle through actors
for actor in @actors
# As long as actor has HP
if actor.hp > 0
# Apply Slip Damage
actor.hp -= [actor.maxhp / 100, 1].max
# If Actor HP reaches 0
if actor.hp == 0
# Perform Collapse
$game_system.se_play($data_system.actor_collapse_se)
end
# Flash
$game_screen.start_flash(Color.new(255,0,0,128), 4)
# Got to game over if all dead
$game_temp.gameover = $game_party.all_dead?
end
end
# Exit as player was in area and damage was applied
return
end
end
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Increaase Steps
#--------------------------------------------------------------------------
alias waahaa increase_steps
def increase_steps
waahaa
# If move route is not forcing
$game_party.extra_slip_damage unless @move_route_forcing
end
end