This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
This script adds a status if someone's friend dies, and takes it away if they come back alive. Use statuses that are set to go away at the end of battle.
Script
Code:
#==========================================================================
# ** SG Friend Death Status
#==========================================================================
# sandgolem
# Version 1
# 9.10.06
#==========================================================================
#==========================================================================
#
# To use this script, copy it and insert it in a new section above "Main",
# but under the default scripts and the SDK if you're using it.
#
#==========================================================================
begin
SDK.log("SG Friend Death Status", "sandgolem", 1, "9.10.06")
if SDK.state("SG Friend Death Status") != true
@sg_friendfury_disabled = true
end
rescue
end
if !@sg_friendfury_disabled
#--------------------------------------------------------------------------
class Game_Battler
attr_accessor :sg_furyremove
attr_accessor :sg_furystates
def sg_furygive
if @sg_furystates != []
for i in 0...@sg_furystates.size
add_state(@sg_furystates[i])
end
end
if @sg_furyremove != []
for i in 0...@sg_furyremove.size
remove_state(@sg_furyremove[i])
end
end
@sg_furyremove = []; @sg_furystates = []
end
def sg_friendfury
if !$game_temp.in_battle
return
end
if @sg_friendfury && !self.exist?
if self.is_a?(Game_Enemy) && SG_Enemy_FriendDeathStatus.key?(@enemy_id)
for i in $game_troop.enemies
if i != self && SG_Enemy_FriendDeathStatus[@enemy_id].key?(i.id)
i.sg_furystates += [SG_Enemy_FriendDeathStatus[@enemy_id][i.id]]
end
end
elsif self.is_a?(Game_Actor) && SG_Actor_FriendDeathStatus.key?(@actor_id)
for i in $game_party.actors
if i != self && SG_Actor_FriendDeathStatus[@actor_id].key?(i.id)
i.sg_furystates += [SG_Actor_FriendDeathStatus[@actor_id][i.id]]
end
end
end
elsif self.exist? && !@sg_friendfury
if self.is_a?(Game_Enemy) && SG_Enemy_FriendDeathStatus.key?(@enemy_id)
for i in $game_troop.enemies
if i != self && SG_Enemy_FriendDeathStatus[@enemy_id].key?(i.id)
i.sg_furyremove += [SG_Enemy_FriendDeathStatus[@enemy_id][i.id]]
end
end
elsif self.is_a?(Game_Actor) && SG_Actor_FriendDeathStatus.key?(@actor_id)
for i in $game_party.actors
if i != self && SG_Actor_FriendDeathStatus[@actor_id].key?(i.id)
i.sg_furyremove += [SG_Actor_FriendDeathStatus[@actor_id][i.id]]
end
end
end
end
end
alias sandgolem_friendfury_battler_hp hp=
def hp=(hp)
@sg_friendfury = self.exist?
@sg_furycheck = true
sandgolem_friendfury_battler_hp(hp)
sg_friendfury
@sg_furycheck = nil
end
alias sandgolem_friendfury_battler_remstate remove_state
def remove_state(state_id, force = false)
if state?(state_id) && $data_states[state_id].zero_hp && !@sg_furycheck
@sg_friendfury = self.exist?
sandgolem_friendfury_battler_remstate(state_id,force)
sg_friendfury
else
sandgolem_friendfury_battler_remstate(state_id,force)
end
end
alias sandgolem_friendfury_battler_addstate add_state
def add_state(state_id, force = false)
if !state?(state_id) && $data_states[state_id].zero_hp && !@sg_furycheck
@sg_friendfury = self.exist?
sandgolem_friendfury_battler_addstate(state_id,force)
sg_friendfury
else
sandgolem_friendfury_battler_addstate(state_id,force)
end
end
end
class Scene_Battle
alias sandgolem_friendfury_battle_sp1 start_phase1
def start_phase1
$game_troop.enemies.each {|i| i.sg_furyremove = []; i.sg_furystates = []}
$game_party.actors.each {|i| i.sg_furyremove = []; i.sg_furystates = []}
sandgolem_friendfury_battle_sp1
end
alias sandgolem_friendfury_battle_up4s6 update_phase4_step6
def update_phase4_step6
$game_troop.enemies.each {|i| i.sg_furygive}
$game_party.actors.each {|i| i.sg_furygive}
sandgolem_friendfury_battle_up4s6
end
end
#--------------------------------------------------------------------------
end