Project1
标题:
【改动渣】仿《小径分叉的花园》战斗攻击合并选项
[打印本页]
作者:
yangjunyin2002
时间:
2014-1-29 10:27
标题:
【改动渣】仿《小径分叉的花园》战斗攻击合并选项
这个效果基本上脚本废也会改。就是选项变成三个:
【发动攻击】
【暂时待机】
【打开背包】
不过我加了个设置功能,可以直接设置三个选项。
不过这个也挺难改的,还要改Game_BattleAction等等等等……
好了,贴脚本:
=begin
仿《小径分叉的花园》战斗选项
By.小y
=end
#设置部分:
ActorCommand1 = "发动攻击"
ActorCommand2 = "暂时待机"
ActorCommand3 = "打开背包"
class Scene_Battle < Scene_Base
def update_actor_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
prior_actor
elsif Input.trigger?(Input::C)
case @actor_command_window.index
when 0 # 特技
Sound.play_decision
start_skill_selection
when 1 # 防御
Sound.play_decision
#~ @active_battler.action.set_guard
@active_battler.action.skill
#~ execute_action_skill
next_actor
when 2 # 物品
Sound.play_decision
start_item_selection
end
end
end
def execute_action
case @active_battler.action.kind
when 0 # 基本
case @active_battler.action.basic
when 0 # 防御
execute_action_guard
when 1 # 逃走
execute_action_escape
when 2 # 待机
execute_action_wait
end
when 1 # 特技
execute_action_skill
when 2 # 物品
execute_action_item
end
end
end
class Window_ActorCommand < Window_Command
def initialize
super(128, [], 1, 3)
self.active = false
end
def setup(actor)
s1 = ActorCommand1
s2 = ActorCommand2
s3 = ActorCommand3
if actor.class.skill_name_valid # 特技指令名是否有效
s2 = actor.class.skill_name # 替换指令名
end
@commands = [s1, s2, s3]
@item_max = 3
refresh
self.index = 0
end
end
class Game_BattleAction
def set_guard
@kind = 0
@basic = 0
end
def set_skill(skill_id)
@kind = 1
@skill_id = skill_id
end
def set_item(item_id)
@kind = 2
@item_id = item_id
end
def guard?
return (@kind == 0 and @basic == 0)
end
end
复制代码
作者:
stars小星
时间:
2014-1-31 22:16
师傅好牛逼
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1