![]() | 您是本帖的第 169 个阅读者 ![]() |
| 页次:1/1页 每页50 帖子数4 | 分页:[1] |
| * 贴子主题:[转帖]传说中的真·Scene_Battle 4! | ![]() |
|---|
[转帖]传说中的真·Scene_Battle 4!
在使用这个脚本时,请注意几点:要完全按着修改哦- -,不然必死!这个主要是脚本修改以实现犯贱特技效果,保护效果,随机攻击范围效果(注意Game_Party和Game_Troop里的修改),连续恢复生命效果。。。这个脚本的随机攻击范围效果和连续恢复生命效果是由英文网www.phylomortis.com所教的哦!(我只是把这些和我自己的整合了而已,经测试没有问题)第一步:打开传说中的Game_Party,然后找到这一段:
#--------------------------------------------------------------------------
# ● 对像角色的随机确定 (HP 0)
#--------------------------------------------------------------------------
def random_target_actor_hp0
return random_target_actor(true)
end
在这段的下方加入:
def multi_random_target_actor(hp0 = false)
max_targets = 0
num_targets = 0
selected_targets = []
if hp0
for actor in $game_party.actors
if actor.hp == 0
max_targets += 1
end
end
else
for actor in $game_party.actors
if actor.hp > 0
max_targets += 1
end
end
end
if max_targets == 0
return nil
end
targz = rand(max_targets) + 1
max_targets = targz
while num_targets < max_targets
t = $game_party.actors[rand($game_party.actors.size)]
if selected_targets.include?(t)
next
end
if hp0
if t.hp == 0
selected_targets.push(t)
num_targets += 1
end
else
if t.hp > 0
selected_targets.push(t)
num_targets += 1
end
end
end
return selected_targets
end
然后再打开传说中的Game_Troop,然后找到这一段:
#--------------------------------------------------------------------------
# ● 对像敌人的随机确定 (HP 0)
#--------------------------------------------------------------------------
def random_target_enemy_hp0
return random_target_enemy(true)
end
在这段下方加入:
def multi_random_target_enemy(hp0 = false)
max_targets = 0
num_targets = 0
selected_targets = []
if hp0
for monster in $game_troop.enemies
if monster.hp == 0
max_targets += 1
end
end
else
for monster in $game_troop.enemies
if monster.hp > 0
max_targets += 1
end
end
end
if max_targets == 0
return nil
end
targz = rand(max_targets) + 1
max_targets = targz
while num_targets < max_targets
t = $game_troop.enemies[rand($game_troop.enemies.size)]
if selected_targets.include?(t)
next
end
if hp0
if t.hp == 0
selected_targets.push(t)
num_targets += 1
end
else
if t.hp > 0
selected_targets.push(t)
num_targets += 1
end
end
end
return selected_targets
end
好了,现在就请使用这整个真·Scene_Battle 4替换原来的Scene_Battle 4吧!
#==============================================================================
# 真·Scene_Battle 4 ! 制作者:LE,RPG Advocate(www.phylomortis.com)
#------------------------------------------------------------------------------
# 附带效果:犯贱特技效果,保护效果,
# 随机攻击范围效果(注意Game_Party和Game_Troop里的修改),
# 连续恢复HP/SP效果,本脚本不能单独使用哦~~~
#------------------------------------------------------------------------------
# 注明:如果使用或转载时不加作者名将会受到烂毛神的惩罚~~~~
#------------------------------------------------------------------------------
# ■ Scene_Battle (分割定义 4)
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle
#$data_skills[57].scope = 8 #这个是脚本调用式,请在Scene_Battle 1设置随机攻击范围的特技
#以上脚本表示特技57号十字斩将攻击随机数量的敌人
#Scope 8: 随机数量的敌人
#Scope 9: 随机数量的同伴
#Scope 10: 一个随机敌人
#Scope 11: 一个随机同伴
Protect = [91,139,149] #这里是设置哪些特技带有保护效果,为了方便,单独搞到最前头定义了
#--------------------------------------------------------------------------
# ● 开始主回合
#--------------------------------------------------------------------------
def start_phase4
# 转移到回合 4
@phase = 4
# 回合数计数
$game_temp.battle_turn += 1
# 搜索全页的战斗事件
for index in 0...$data_troops[@troop_id].pages.size
# 获取事件页
page = $data_troops[@troop_id].pages[index]
# 本页的范围是 [回合] 的情况下
if page.span == 1
# 设置已经执行标志
$game_temp.battle_event_flags[index] = false
end
end
# 设置角色为非选择状态
@actor_index = -1
@active_battler = nil
# 有效化同伴指令窗口
@party_command_window.active = false
@party_command_window.visible = false
# 无效化角色指令窗口
@actor_command_window.active = false
@actor_command_window.visible = false
# 设置主回合标志
$game_temp.battle_main_phase = true
# 生成敌人行动
for enemy in $game_troop.enemies
enemy.make_action
end
# 生成行动顺序
make_action_orders
# 移动到步骤 1
@phase4_step = 1
end
#--------------------------------------------------------------------------
# ● 生成行动循序
#--------------------------------------------------------------------------
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
@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
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合)
#--------------------------------------------------------------------------
def update_phase4
case @phase4_step
when 1
update_phase4_step1
when 2
update_phase4_step2
when 3
update_phase4_step3
when 4
update_phase4_step4
when 5
update_phase4_step5
when 6
update_phase4_step6
end
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 1 : 准备行动)
#--------------------------------------------------------------------------
def update_phase4_step1
# 隐藏帮助窗口
@help_window.visible = false
# 判定胜败
if judge
# 胜利或者失败的情况下 : 过程结束
return
end
# 强制行动的战斗者不存在的情况下
if $game_temp.forcing_battler == nil
# 设置战斗事件
setup_battle_event
# 执行战斗事件中的情况下
if $game_system.battle_interpreter.running?
return
end
end
# 强制行动的战斗者存在的情况下
if $game_temp.forcing_battler != nil
# 在头部添加后移动
@action_battlers.delete($game_temp.forcing_battler)
@action_battlers.unshift($game_temp.forcing_battler)
end
# 未行动的战斗者不存在的情况下 (全员已经行动)
if @action_battlers.size == 0
# 开始同伴命令回合
start_phase2
return
end
# 初始化动画 ID 和公共事件 ID
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
# 未行动的战斗者移动到序列的头部
@active_battler = @action_battlers.shift
# 如果已经在战斗之外的情况下
if @active_battler.index == nil
return
end
# 连续伤害
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
#####################################################
if @active_battler.state?(30)
@active_battler.damage=/10
@active_battler.damage=@active_battler.damage.to_i
@active_battler.hp-=@active_battler.damage
@active_battler.animation_id = 21
@active_battler.damage_pop = true
end
#####################################################
# 自然解除状态
@active_battler.remove_states_auto
# 刷新状态窗口
@status_window.refresh
# 移至步骤 2
@phase4_step = 2
end
#--------------------------------------------------------------------------
# ● 刷新画面 (主回合步骤 2 : 开始行动)
#--------------------------------------------------------------------------
def update_phase4_step2
# 如果不是强制行动
unless @active_battler.current_action.forcing
# 限制为 [敌人为普通攻击] 或 [我方为普通攻击] 的情况下
if @active_battler.restriction == 2 or @active_battler.restriction == 3
# 设置行动为攻击
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
# 限制为 [不能行动] 的情况下
if @active_battler.restriction == 4
# 清除行动强制对像的战斗者
$game_temp.forcing_battler = nil
# 移至步骤 1
@phase4_step = 1
return
end
end
# 清除对像战斗者
@target_battlers = []
# 行动种类分支
case @active_battler.current_action.kind
when 0 # 基本
make_basic_action_result
when 1 # 特技
make_skill_action_result
when 2 # 物品
make_item_action_result
end
# 移至步骤 3
if @phase4_step == 2
@phase4_step = 3
end
end
2006-5-10 19:19:23
不玩这个的,呵呵

----------------------------------------------
欢迎进入竹零论坛:www.zlzc.net,竹零字幕组恭候您的到来!字幕组正招收字幕成员中~新进成员将有FTP资源的共享图片已遗失当年存过这张图吗?请帮忙找回
2006-5-10 19:46:27
2006-5-10 22:51:09
这是一个制作RPG的脚本。。。这可是真正的技术精华啊。。。


2006-5-13 16:27:34
| 页次:1/1页 每页50 帖子数4 | 分页:[1] |






