Project1
标题:
RPGXP 有没有办法让一号角色不进入战斗??
[打印本页]
作者:
1243852
时间:
2014-7-25 15:17
标题:
RPGXP 有没有办法让一号角色不进入战斗??
就是说,进入战斗后,从第二个角色开始算。第一个角色永远不进入战斗。
作者:
芯☆淡茹水
时间:
2014-7-25 15:36
未测试
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
def index
return $game_party.actors.index(self) - 1
end
end
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
def make_action_orders
# 初始化序列 @action_battlers
@action_battlers = []
# 添加敌人到 @action_battlers 序列
for enemy in $game_troop.enemies
@action_battlers.push(enemy)
end
# 添加角色到 @action_battlers 序列
for actor in $game_party.actors
next if $game_party.actors.index(actor) == 0
@action_battlers.push(actor)
end
# 确定全体的行动速度
for battler in @action_battlers
battler.make_action_speed
end
# 按照行动速度从大到小排列
@action_battlers.sort! {|a,b|
b.current_action.speed - a.current_action.speed }
end
end
#=============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
def update
# 刷新角色的活动块 (对应角色的替换)
@actor_sprites[0].battler = $game_party.actors[1]
@actor_sprites[1].battler = $game_party.actors[2]
@actor_sprites[2].battler = $game_party.actors[3]
@actor_sprites[3].battler = $game_party.actors[4]
# 战斗背景的文件名与现在情况有差异的情况下
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 320)
end
# 刷新战斗者的活动块
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
# 刷新天气图形
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
# 刷新图片活动块
for sprite in @picture_sprites
sprite.update
end
# 刷新计时器活动块
@timer_sprite.update
# 设置画面的色调与震动位置
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
# 设置画面的闪烁色
@viewport4.color = $game_screen.flash_color
# 刷新显示端口
@viewport1.update
@viewport2.update
@viewport4.update
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1