
#===============================================================================
# * Desert Heat (and map regeneration)
#
# By Wyatt, version 1.1
# www.vengeance-rpg.co.nr!
#
# To turn on desert heat change $in_desert to true
# To turn it off again change $in_desert to false
#
# When you enter a desert area, call a script with:
# $desert_left = x
# Where "x" is the amount of steps you want before you start losing health
#
# License:
# It's only a small script, feel free to use in free or commercial games.
# But please give credit.
#
# Updates:
# 1.1 - - Used attr_accessor and aliased methods
#===============================================================================
class Game_Party
# obtain variables
attr_accessor :in_desert
attr_accessor :desert_left
# alias methods
alias desert_steps increase_steps
alias desert_initialize initialize
# initialize
def initialize
desert_initialize
@desert_left = 250
@in_desert = false
end
# increase steps
def increase_steps
desert_steps
# if you are in the desert...
if @in_desert == true
if @desert_left > 0
# drain water
@desert_left -= 1
# raise health
for i in 0...$game_party.actors.size
$game_party.actors[i].hp += 1 unless $game_party.actors[i].hp ==
$game_party.actors[i].maxhp
end
else
# drain health (if you have no water left)
for i in 0...$game_party.actors.size
$game_party.actors[i].hp -= 1 unless $game_party.actors[i].hp <= 0
end
end
else
# raise health
for i in 0...$game_party.actors.size
$game_party.actors[i].hp += 1 unless $game_party.actors[i].hp ==
$game_party.actors[i].maxhp
end
end
end
end
$game_party.actors.each each do {|actor|} do
#stuff in here like p actor.name
$game_party.actors.each { |actor| #stuff }
for actor in $game_party.actors
use Class Variables
class Game_Map
[...]
DESERT_MAPS = [3,231,42]
def setup(map_id)
[...]
@desert_map = DESERT_MAPS.include?(map_id)
[...]
def in_desert
return @desert_map
end
[...]