08-12-2005, 01:00 PM
AutoLife
posted by Dark Akiko
by XRXS
Aug 12 2005
Instructions
Based on the below sample from the script:
Make an attriubute and call it (whatever you put as RERAISE_STATE_NAME ) then give the atrribute to a skill and then thats it
If an actor dies with the statues effect "AutoLife" (or whatever you name it) they will be automatically risen from the dead
posted by Dark Akiko
by XRXS
Aug 12 2005
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.
No support is given. If you are the owner of the thread, please contact administration.
Instructions
Based on the below sample from the script:
Make an attriubute and call it (whatever you put as RERAISE_STATE_NAME ) then give the atrribute to a skill and then thats it
Code:
class Game_Battler
RERAISE_STATE_NAME = "AutoLife" # 「 リレイズ 」ステートの名称
end
class Scene_Battle
RERAISE_STATE_NAME = "AutoLife" # 「 リレイズ 」ステートの名称
RERAISE_HP = 1 # 「 リレイズ 」復活時のHP (加算値)
RERAISE_HP_PERCENT = 0 # 「 リレイズ 」復活時のHP%(割合値)
RERAISE_ANIMATION_ID = 26 # 「 リレイズ 」復活時のアニメーション
Code:
# ▼▲▼ XRXS27. 特殊効果 SuperEX「リレイズ」 ▼▲▼
# by シムナフ
#==============================================================================
# □ カスタマイズポイント
#==============================================================================
class Game_Battler
RERAISE_STATE_NAME = "AutoLife" # 「 リレイズ 」ステートの名称
end
class Scene_Battle
RERAISE_STATE_NAME = "AutoLife" # 「 リレイズ 」ステートの名称
RERAISE_HP = 1 # 「 リレイズ 」復活時のHP (加算値)
RERAISE_HP_PERCENT = 0 # 「 リレイズ 」復活時のHP%(割合値)
RERAISE_ANIMATION_ID = 26 # 「 リレイズ 」復活時のアニメーションID
end
#=============================================================================
# ◇ リレイズステート by シムナフ
#=============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ● HP の変更
#--------------------------------------------------------------------------
def hp=(hp)
@hp = [[hp, maxhp].min, 0].max
# 戦闘不能を付加または解除
for i in 1...$data_states.size
if $data_states[i].zero_hp
if self.dead?
# 追加
for x in 1...$data_states.size
# ステート名は変更可。
if $data_states[x].name[RERAISE_STATE_NAME] != nil
reraise_id = $data_states[x].id
break
end
end
# リレイズ復活
if reraise_id != nil && self.state?(reraise_id)
self.remove_state(reraise_id)
@reraised = true
@reraise_state = 0
# 戦闘不能マイナスステートに設定されているものを解除
if $data_states[i].minus_state_set != []
for j in $data_states[i].minus_state_set
remove_state(j)
end
end
elsif
# ここまで
add_state(i)
end
else
remove_state(i)
end
end
end
end
end
class Game_Battler
#--------------------------------------------------------------------------
# ● 追加公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :reraise_state
attr_accessor :reraised # リレイズしたかどうか
end
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias reraise_initialize initialize
def initialize(troop_id, member_index)
reraise_initialize(troop_id, member_index)
@reraised = false
@reraise_state = 0
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias reraise_update_phase4_step2 update_phase4_step2
def update_phase4_step2
#リレイズ判定
next_phase_ok = true
next_phase_ok = update_reraise_effect(@active_battler)
if next_phase_ok
# ステップ 2 へ
reraise_update_phase4_step2
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 6 : リレイズ表示→リフレッシュ)
#--------------------------------------------------------------------------
alias reraise_update_phase4_step6 update_phase4_step6
def update_phase4_step6
next_phase_ok = true
#リレイズ判定
for enemy in $game_troop.enemies
next_phase_ok = update_reraise_effect(enemy)
if !next_phase_ok
return
end
end
for actor in $game_party.actors
next_phase_ok = update_reraise_effect(actor)
if !next_phase_ok
return
end
end
reraise_update_phase4_step6
end
#===================================================
#リレイズエフェクト
#===================================================
def update_reraise_effect(battler)
if battler.reraised
case battler.reraise_state
when 0
battler.reraise_state = 1 # コラプス待ち
@wait_count = 16
return false
when 1
battler.reraise_state = 2 # 復活アニメーション
##IDは好きなアニメーションIDを指定
battler.animation_id = RERAISE_ANIMATION_ID
@wait_count = 8
return false#
when 2
#復活処理
battler.hp = battler.maxhp * RERAISE_HP_PERCENT / 100 + RERAISE_HP
battler.reraise_state = 3 #アピアーアニメーション
@wait_count = 8
return false#
when 3
battler.reraise_state = 0 #終了・通常処理に戻る
battler.reraised = false #フラグを初期値へ
@status_window.refresh
return true
end
else
return true
end
end
end
If an actor dies with the statues effect "AutoLife" (or whatever you name it) they will be automatically risen from the dead