#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Auto-Revive Status Effect by Blizzard
# Version: 1.25b
# Type: Game Experience Improvement
# Date: 5.6.2006
# Date v1.2b: 14.11.2006
# Date v1.21b: 12.1.2007
# Date v1.22b: 13.11.2007
# Date v1.23b: 19.11.2007
# Date v1.24b: 10.12.2007
# Date v1.25b: 19.10.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# new in v1.2b:
# - less and better code, much more compatible, easier to use
#
# new in v1.21b:
# - removed an obsolete constant
#
# new in v1.22b:
# - now possible to have more than one Auto-Revive status effect
#
# new in v1.23b:
# - fixed bug where game over would be automatically initiated when in battle
#
# new in v1.24b:
# - fixed bug due to typing mistake
#
# new in v1.25b:
# - fixed bug with RTAB
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
AUTO_REVIVE_IDS = [28] # IDs of status effects
REVIVE_ANIMATION_ID = 25 # ID of the Revive animation
REVIVE_TEXT = 'Schutzengel!' # text displayed
DEAD_ID = 1 # ID of the "dead" status effect
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# Game_Party
#==============================================================================
class Game_Party
alias all_dead_autorevive_later? all_dead?
def all_dead?
if $game_
system.AUTO_REVIVE && (@actors.any? {|a| AUTO_REVIVE_IDS.any? {|i|
a.states.include?(i)}})
return false
end
return all_dead_autorevive_later?
end
end
#==============================================================================
# Sprite
#==============================================================================
class RPG::Sprite
alias damage_regen_later damage
def damage(damage, critical, type = nil)
if damage == REVIVE_TEXT
dispose_damage
bitmap =
Bitmap.new(160, 48)
bitmap.font.name, bitmap.font.size = 'Kartika', 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text_shaded_later(-1, 12-1, 160, 36, REVIVE_TEXT, 1)
bitmap.draw_text_shaded_later(-1, 12+1, 160, 36, REVIVE_TEXT, 1)
bitmap.draw_text_shaded_later(1, 12-1, 160, 36, REVIVE_TEXT, 1)
bitmap.draw_text_shaded_later(1, 12+1, 160, 36, REVIVE_TEXT, 1)
bitmap.font.color.set(0, 192, 255)
bitmap.font.size = 32
bitmap.draw_text_shaded_later(0, 12, 160, 36, REVIVE_TEXT, 1)
@_damage_sprite = ::Sprite.new(self.viewport)
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox, @_damage_sprite.oy = 80, 20
@_damage_sprite.x, @_damage_sprite.y = self.x, self.y-self.oy/2
@_damage_sprite.z, @_damage_duration = 3000, 40
elsif type != nil
damage_regen_later(damage, critical, type)
else
damage_regen_later(damage, critical)
end
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
alias judge_autorevive_later judge
def judge
if $game_
system.AUTO_REVIVE
flag = false
$game_party.actors.each {|actor|
if actor.hp == 0 && AUTO_REVIVE_IDS.any? {|i| actor.states.include?(i)}
actor.hp += actor.maxhp / 5
(AUTO_REVIVE_IDS + [DEAD_ID]).each {|i| actor.remove_state(i)}
actor.animation_id, actor.damage = REVIVE_ANIMATION_ID, REVIVE_TEXT
actor.damage_pop = flag = true
end}
@status_window.refresh if flag
end
return judge_autorevive_later
end
end