以下引用卓越大白痴于2008-12-8 20:15:59的发言:
可不可以实现替补出场后不改变菜单中的人物顺序 (无论如何不想让第一个脚色更改位置)
或者其他方法也行
比如如何用事件脚本更改角色排列顺序等等 谢谢了
以下引用卓越大白痴于2008-12-8 21:47:32的发言:
谢谢 龙皇兄
我的水平还没只有小虾米的境界,还需要exp 10000000才能升小强(苦啊~~~~~~)
大侠们表笑我 . . .
召唤大侠 求解谢谢
#==============================================================================
# ■ Game_Party
#------------------------------------------------------------------------------
# 追加後補判定方法。
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# ● 後補判定
#--------------------------------------------------------------------------
def replacement_need?
# 同伴中無人 HP 在 0 以上
for actor in @actors
if actor.rest_hp > 0
return false
end
end
# 後補
return true
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 追加後補動作。
#==============================================================================
class Scene_Battle
alias replacement_judge judge
def judge
# 判斷战斗人物死亡后是否使待机人物替补出场
if $game_party.replacement_need?
# 待命成員復帰
$game_party.actors[$game_party.actors.size,0] = $game_party.backword_actors
$game_party.backword_actors.clear
#--------------------------------------------------------------------------
# ● 泡沫式排序法
#--------------------------------------------------------------------------
for i in 1..$game_party.actors.size
for j in 1..$game_party.actors.size
if $game_party.actors[i-1].hp > $game_party.actors[j-1].hp
temp = $game_party.actors[i-1]
$game_party.actors[i-1] = $game_party.actors[j-1]
$game_party.actors[j-1] = temp
temp = @rank
@rank = @rank[j]
@rank[j] = temp
end
end
end
atb_setup
@status_window.refresh
# 待命成員退避
$game_party.backword_actors[0,0] = $game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT]
$game_party.actors[FRONT_MEMBER_LIMIT, BACKWARD_MEMBER_LIMIT] = nil
$game_party.actors.compact!
end
replacement_judge
end
#--------------------------------------------------------------------------
# ● 还原泡沫式排序法
#--------------------------------------------------------------------------
alias ranking_main main
def main
# 存取队伍顺序数字
@rank = []
for i in 1..$game_party.actors.size
@rank = i
end
# メイン処理
ranking_main
# 还原排序
for i in 1..$game_party.actors.size
for j in 1..$game_party.actors.size
if @rank < @rank[j]
temp = $game_party.actors[i-1]
$game_party.actors[i-1] = $game_party.actors[j-1]
$game_party.actors[j-1] = temp
temp = @rank
@rank = @rank[j]
@rank[j] = temp
end
end
end
end
end
以下引用卓越大白痴于2008-12-9 20:38:18的发言:
太感谢了 小弟拜服 龙兄神威 天下无双
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |