Tutoriaux événements
Death Switch
- Script de Vash.
- Aucune démo n'est disponible pour ce script.
Un script qui permet, lorsqu'un heros meurt, de remplacer son charset sur la map par celui du héros suivant.
#==============================================================================
# ** Game_Player (Death Switch)
#------------------------------------------------------------------------------
# By Vash (or rmxp.org)
# Posted on: 27.8.06
# Updated on: 4.9.06
# Version 1.3
# Description:
# - When the lead player dies the sprite on the map switchs to the next person
# in line thats alive.
# - When you switch a character around the map sprite is updated.
#==============================================================================
class Game_Player < Game_Character
alias vash_tos_switch_refresh refresh
def refresh
vash_tos_switch_refresh
#------------------------------------------------------------------------------
# If lead character is dead
#------------------------------------------------------------------------------
for actor in $game_party.actors
lead = actor unless actor.hp == 0
break unless lead.nil?
end
#------------------------------------------------------------------------------
@character_name = lead.character_name
@character_hue = lead.character_hue
@opacity = 255
@blend_type = 0
end
end
class Game_Player < Game_Character
alias vash_tos_switch_update update
def update
vash_tos_switch_update
#------------------------------------------------------------------------------
# If lead character is dead
#------------------------------------------------------------------------------
for actor in $game_party.actors
lead = actor unless actor.hp == 0
break unless lead.nil?
end
#------------------------------------------------------------------------------
# If all characters are dead
#------------------------------------------------------------------------------
if $game_party.all_dead? or $game_party.actors.size == 0
$scene = Scene_Gameover.new
return
end
$game_temp.gameover unless !lead.nil?
@character_name = lead.character_name
@character_hue = lead.character_hue
end
end