赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 163587 |
最后登录 | 2020-5-5 |
在线时间 | 41 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 41 小时
- 注册时间
- 2008-3-5
- 帖子
- 2072
|
V还在吗?
{/cy}
- #====================================================
- # 按键威力加成 Ver.1.3.0 by Claimh sphinger汉化修改
- # 本脚本来自www.66rpg.com,转载和使用请保留注释,方便来者
- #--------------------------------------------------------------------
- # 功能添加:柳柳
- #
- # 添加修改说明:1、在T_SKILL设置技能的加成按键和威力的加成比例。
- # 威力加成可以使用随机数
- # 2、窗口目前是可以输入很多内容,并且会自动滚动
- # 3、添加困难指令个数的数量限制
- # 4、添加随机生成指令的功能,指令处直接给定一个数字就是随机出来的指令个数
- # 如果给定一个字符串的数字,比如 "15" 这样,则是只有上下左右构成的随机指令15个。
- #
- # 范例研究方法:用默认工程,给希露达(魔法师)学会7、8、9号技能(也就是火系的三招)
- # 然后使用这三招就知道了。
- #
- # 可能会用到的窗口修改:class Window_KeyCounter,描绘血槽的窗口
- # class Window_KeyCount,描绘按键的窗口。你可以恶搞地把它弄成跳舞机
- #====================================================
- #==============================================================================
- # 按键威力加成 Ver.1.3.0 by Claimh sphinger汉化修改
- # 本脚本来自www.66rpg.com,转载和使用请保留注释,方便来者
- #------------------------------------------------------------------------------
- # 功能添加:柳柳
- #
- # 添加修改说明:1、在T_SKILL设置技能的加成按键和威力的加成比例。
- # 威力加成可以使用随机数
- # 2、窗口目前是可以输入很多内容,并且会自动滚动
- # 3、添加困难指令个数的数量限制
- # 4、添加随机生成指令的功能,指令处直接给定一个数字就是随机出来的指令个数
- # 如果给定一个字符串的数字,比如 "15" 这样,则是只有上下左右构成的随机指令15个。
- #
- # 范例研究方法:用默认工程,给希露达(魔法师)学会7、8、9号技能(也就是火系的三招)
- # 然后使用这三招就知道了。
- #
- # 可能会用到的窗口修改:class Window_KeyCounter,描绘血槽的窗口
- # class Window_KeyCount,描绘按键的窗口。你可以恶搞地把它弄成跳舞机
- #==============================================================================
- module TacticalSkill
- #==============================================================================
- # START
- #==============================================================================
- # 按键设定
- A = Input::A # 对应按键:Z
- B = Input::B # 对应按键:X
- C = Input::C # 对应按键:C
- X = Input::X # 对应按键:A
- Y = Input::Y # 对应按键:S
- Z = Input::Z # 对应按键:D
- L = Input::L # 对应按键:Q
- R = Input::R # 对应按键:W
- UP = Input::UP
- DOWN = Input::DOWN
- LEFT = Input::LEFT
- RIGHT = Input::RIGHT
- # 时间的快慢调整,越大越慢
- KEY_SEC = 0.5
- # 时间条显示自己放个150*10的就可以了,放在(Graphics/Windowskins/)下就可以拉
- T_BAR_NAME = "bar"
-
- T_HARD_NUMBER = 10 # 确定输入多少个的时候开始算做困难指令
- # 困难指令给的时间不会按照按键数量增多而增长
- # 技能设定
- T_SKILL = {
- #技能ID => [[按键1,按键2,……?,按键N],技能攻击力加成]
- 57 => [[align=left,RIGHT], rand(150)+100],
- 8 => [12, 200],
- 9 => ["15", 250],
- 85 => [[align=left,UP], 50],
- 86 => [[L,X,R], 50],
- 12 => [[X,C,RIGHT,R], 50],
- 13 => [[UP,RIGHT], 50],
- 14 => [[L,Z,A], 50],
- 15 => [[R,X,X,DOWN], 50],
- 16 => [[DOWN, RIGHT], 50],
- 17 => [[A,B,C], 50],
- 18 => [[Y,X,DOWN,B], 50],
- 19 => [[align=left,DOWN], 50],
- 20 => [[Z,Y,A], 50],
- 21 => [[B,C,X,L], 50],
- 22 => [[align=right,DOWN], 50],
- 23 => [[A,B,R], 50],
- 24 => [[X,Y,LEFT,R], 50],
- 25 => [[align=left,RIGHT], 50],
- 26 => [[X,L,B], 50],
- 27 => [[align=left,X,C,Z], 50],
- 28 => [[align=left,DOWN], 50],
- 29 => [[C,X,A], 50],
- 30 => [[X,Z,C,UP], 50],
- 31 => [[UP,DOWN,X], 0],
- 32 => [[align=left,RIGHT,L,R], 50],
- 7 => [[A, C], 50],
- 58 => [[C, X, UP], 50],
- 59 => [[A, UP, RIGHT, A], 50],
- 60 => [[Z, C, A, B], 50],
- 61 => [[X, C], 50],
- 62 => [[UP, X, DOWN], 50],
- 63 => [[align=left, C, Y, A], 50],
- 64 => [[X, C, Y, A], 50],
- 65 => [[Y, A], 50],
- 66 => [[align=right, B, A], 50],
- 67 => [[align=left, UP, Z, A], 50],
- 68 => [[Y, B, Y, A], 50],
- 69 => [[align=left, A], 50],
- 70 => [[A, C, A], 50],
- 71 => [[B, B, A, A], 50],
- 72 => [[A, B, X, Y], 50],
- 73 => [[X, A], 50],
- 74 => [[Y, A, B], 50],
- 75 => [[align=left, RIGHT, Y, A], 50],
- 76 => [[A, C, L, A], 50],
- 77 => [[R, X], 50],
- 78 => [[L, C, R], 50],
- 79 => [[align=left, L, RIGHT, R], 50],
- 80 => [[C, C, Z, RIGHT], 50]
- }
-
- L_SKILL = {
- 57 => [[UP,DOWN], rand(150)+100,57]
-
-
- }
- #
- #==============================================================================
- # END
- #==============================================================================
- end
- #==============================================================================
- # Input
- #==============================================================================
- module Input
- module_function
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def n_trigger?(num)
- if trigger?(num)
- return false
- elsif trigger?(A) or trigger?(B) or trigger?(C) or
- trigger?(X) or trigger?(Y) or trigger?(Z) or
- trigger?(L) or trigger?(R) or
- trigger?(UP) or trigger?(DOWN) or trigger?(RIGHT) or trigger?(LEFT)
- return true
- end
- return false
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def key_converter(key)
- # 按键对应的字母或文字
- case key
- when A
- return "Z"
- when B
- return "X"
- when C
- return "C"
- when X
- return "A"
- when Y
- return "S"
- when Z
- return "D"
- when L
- return "Q"
- when R
- return "W"
- when UP
- return "上"
- when DOWN
- return "下"
- when LEFT
- return "左"
- when RIGHT
- return "右"
- end
- end
- end
- #==============================================================================
- # Game_Battler
- #==============================================================================
- class Game_Battler
- attr_accessor :tact_flag
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- alias initialize_tactical initialize
- def initialize
- initialize_tactical #
- @tact_flag = false
- end
- #--------------------------------------------------------------------------
- # user :
- # skill :
- #--------------------------------------------------------------------------
- alias skill_effect_tactical skill_effect
- def skill_effect2(user, skill)
- skill_copy = $data_skills[skill.id].dup
- skill.power = skill.power * TacticalSkill::T_SKILL[skill.id][1] / 100
- skill.hit = 0 if skill.power == 0
- ret = skill_effect_tactical(user, skill)
- user.tact_flag = false
- $data_skills[skill.id] = skill_copy.dup
- return ret
- end
- end
- #==============================================================================
- # Scene_Battle
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- alias update_phase4_step2_tactical update_phase4_step2
- def update_phase4_step2
- update_phase4_step2_tactical
- @active_battler.tact_flag = false
- end
-
-
- alias update_e :update
- def update
- @l_skill = false if @l_skill == nil
- if @phase4_step == 5 && @active_battler.current_action.kind == 1
- @use = @active_battler.current_action.kind == 1 && TacticalSkill::L_SKILL[@active_battler.current_action.skill_id] != nil
- if @use == true
- @use = $data_skills[TacticalSkill::L_SKILL[@active_battler.current_action.skill_id][2]].sp_cost <= @active_battler.sp
- end
- if @l_skill == false and @use == true and @phase == 4 and @phase4_step == 5 and @active_battler.current_action.kind == 1
- if make_tactical_skill_result(1)
- @active_battler.current_action.kind = 1
- a = TacticalSkill::L_SKILL[@active_battler.current_action.skill_id][2]
- @active_battler.current_action.skill_id = a
- @l_skill = [@active_battler,a]
- else
- @l_skill = true
- end
- end
- end
- if @phase == 4 and @phase4_step > 5 and @l_skill != false and @l_skill != true
- @active_battler.current_action.kind = 1
- @active_battler.current_action.skill_id = @l_skill[1]
- @action_battlers.unshift(@l_skill[0])
- update_phase4_step1
- end
- update_e
- 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
- # 开始同伴命令回合
- @l_skill = false
- 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
- # 自然解除状态
- @active_battler.remove_states_auto
- # 刷新状态窗口
- @status_window.refresh
- # 移至步骤 2
- @phase4_step = 2
- end
- #--------------------------------------------------------------------------
- def make_skill_action_result
- unless @active_battler.current_action.forcing || @l_skill != false
- # SP
- unless @active_battler.skill_can_use?(@active_battler.current_action.skill_id)
- $game_temp.forcing_battler = nil
- # 移至步奏1
- @phase4_step = 1
- return
- end
- end
-
- if @active_battler.is_a?(Game_Actor)
- if !TacticalSkill::T_SKILL[@active_battler.current_action.skill_id].nil?
- if make_tactical_skill_result
- # 获取特技
- @skill = $data_skills[@active_battler.current_action.skill_id]
- # 如果不是强制行动
- unless @active_battler.current_action.forcing
- # 因为 SP 耗尽而无法使用的情况下
- unless @active_battler.skill_can_use?(@skill.id)
- # 清除强制行动对像的战斗者
- $game_temp.forcing_battler = nil
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- end
- @l_skill = false
- # 消耗 SP
- @active_battler.sp -= @skill.sp_cost
- # 刷新状态窗口
- @status_window.refresh
- # 在帮助窗口显示特技名
- @help_window.set_text(@skill.name, 1)
- # 设置动画 ID
- @animation1_id = @skill.animation1_id
- @animation2_id = @skill.animation2_id
- # 设置公共事件 ID
- @common_event_id = @skill.common_event_id
- # 设置对像侧战斗者
- set_target_battlers(@skill.scope)
- # 应用特技效果
- for target in @target_battlers
- target.skill_effect2(@active_battler, @skill)
- end
- else
- # 获取特技
- @skill = $data_skills[@active_battler.current_action.skill_id]
- # 如果不是强制行动
- unless @active_battler.current_action.forcing
- # 因为 SP 耗尽而无法使用的情况下
- unless @active_battler.skill_can_use?(@skill.id)
- # 清除强制行动对像的战斗者
- $game_temp.forcing_battler = nil
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- end
- @l_skill = false
- # 消耗 SP
- @active_battler.sp -= @skill.sp_cost
- # 刷新状态窗口
- @status_window.refresh
- # 在帮助窗口显示特技名
- @help_window.set_text(@skill.name, 1)
- # 设置动画 ID
- @animation1_id = @skill.animation1_id
- @animation2_id = @skill.animation2_id
- # 设置公共事件 ID
- @common_event_id = @skill.common_event_id
- # 设置对像侧战斗者
- set_target_battlers(@skill.scope)
- # 应用特技效果
- for target in @target_battlers
- target.skill_effect(@active_battler, @skill)
- end
- end
- else
- # 获取特技
- @skill = $data_skills[@active_battler.current_action.skill_id]
- # 如果不是强制行动
- unless @active_battler.current_action.forcing || @l_skill != false
- # 因为 SP 耗尽而无法使用的情况下
- unless @active_battler.skill_can_use?(@skill.id)
- # 清除强制行动对像的战斗者
- $game_temp.forcing_battler = nil
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- end
- @l_skill = false
- #@l_skill = false
- # 消耗 SP
- @active_battler.sp -= @skill.sp_cost
- # 刷新状态窗口
- @status_window.refresh
- # 在帮助窗口显示特技名
- @help_window.set_text(@skill.name, 1)
- # 设置动画 ID
- @animation1_id = @skill.animation1_id
- @animation2_id = @skill.animation2_id
- # 设置公共事件 ID
- @common_event_id = @skill.common_event_id
- # 设置对像侧战斗者
- set_target_battlers(@skill.scope)
- # 应用特技效果
- for target in @target_battlers
- target.skill_effect(@active_battler, @skill)
- end
- end
- else
- # 获取特技
- @skill = $data_skills[@active_battler.current_action.skill_id]
- # 如果不是强制行动
- unless @active_battler.current_action.forcing
- # 因为 SP 耗尽而无法使用的情况下
- unless @active_battler.skill_can_use?(@skill.id)
- # 清除强制行动对像的战斗者
- $game_temp.forcing_battler = nil
- # 移至步骤 1
- @phase4_step = 1
- return
- end
- end
- # 消耗 SP
- @active_battler.sp -= @skill.sp_cost
- # 刷新状态窗口
- @status_window.refresh
- # 在帮助窗口显示特技名
- @help_window.set_text(@skill.name, 1)
- # 设置动画 ID
- @animation1_id = @skill.animation1_id
- @animation2_id = @skill.animation2_id
- # 设置公共事件 ID
- @common_event_id = @skill.common_event_id
- # 设置对像侧战斗者
- set_target_battlers(@skill.scope)
- # 应用特技效果
- for target in @target_battlers
- target.skill_effect(@active_battler, @skill)
- end
- end
- end
- def make_rand_tact(ini)
- b = []
- for i in 0...ini
- case rand(12).to_i
- when 0
- b.push(Input::A)
- when 1
- b.push(Input::B)
- when 2
- b.push(Input::C)
- when 3
- b.push(Input::X)
- when 4
- b.push(Input::Y)
- when 5
- b.push(Input::Z)
- when 6
- b.push(Input::L)
- when 7
- b.push(Input::R)
- when 8
- b.push(Input::RIGHT)
- when 9
- b.push(Input::UP)
- when 10
- b.push(Input::LEFT)
- when 11
- b.push(Input::DOWN)
- end
- end
- return b
- end
- def make_rand_tact4(ini)
- b = []
- for i in 0...ini
- case rand(4).to_i
- when 0
- b.push(Input::RIGHT)
- when 1
- b.push(Input::UP)
- when 2
- b.push(Input::LEFT)
- when 3
- b.push(Input::DOWN)
- end
- end
- return b
- end
-
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def make_tactical_skill_result(t=0)
-
- tact_skill = TacticalSkill::T_SKILL[@active_battler.current_action.skill_id][0]
- tact_skill = TacticalSkill::L_SKILL[@active_battler.current_action.skill_id][0] if t == 1
- if tact_skill.is_a?(Numeric)
- a = tact_skill
- tact_skill = make_rand_tact(a)
- elsif tact_skill.is_a?(String)
- a = tact_skill.to_i
- tact_skill = make_rand_tact4(a)
- end
-
- time = TacticalSkill::KEY_SEC * [tact_skill.size,TacticalSkill::T_HARD_NUMBER].min * Graphics.frame_rate
- key_count = 0
- @active_battler.tact_flag = true
- window_keycount = Window_KeyCount.new(tact_skill)
- window_counter = Window_KeyCounter.new
- actor_x = @active_battler.index * 160
- window_keycount.x = window_counter.x = actor_x
- for i in 0...time
- if Input.trigger?(tact_skill[key_count])
- key_count += 1
- window_keycount.key_in
- elsif Input.n_trigger?(tact_skill[key_count])
- break
- end
- # 如果成功
- if key_count >= tact_skill.size
- window_keycount.text_in("成功")
- # 成功提示音
- Audio.se_play("Audio/SE/056-Right02")
- @active_battler.tact_flag = false
- # 成功与失败后的处理
- for i in 0...10
- Graphics.update
- @spriteset.update
- end
- window_keycount.dispose
- window_counter.dispose
- return true
- end
- # 刷新
- window_counter.refresh((i*100/time).truncate)
- Graphics.update
- Input.update
- end
- # 如果失败
- if @active_battler.tact_flag
- #失败提示音
- Audio.se_play("Audio/SE/057-Wrong01")
- window_keycount.text_in("失败")
- end
- # 成功与失败后的处理
- for i in 0...10
- Graphics.update
- @spriteset.update
- end
- window_keycount.dispose
- window_counter.dispose
- return false
- end
- end
- #==============================================================================
- # Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def draw_counter_bar(x, y, current)
- bitmap = RPG::Cache.windowskin(TacticalSkill::T_BAR_NAME)
- cw = bitmap.width * current / 100
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(x, y, bitmap, src_rect)
- end
- end
- #==============================================================================
- # Window_KeyCounter
- #==============================================================================
- class Window_KeyCounter < Window_Base
- #--------------------------------------------------------------------------
- # 输入窗口的描绘
- #--------------------------------------------------------------------------
- def initialize
- super(0, 256, 180, 80)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- self.z = 1
- refresh(0)
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def refresh(current)
- self.contents.clear
- draw_counter_bar(0, 0, current)
- end
- end
- #==============================================================================
- # Window_KeyCount
- #------------------------------------------------------------------------------
- #
- #==============================================================================
- class Window_KeyCount < Window_Base
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def initialize(key)
- super(0, 230, 180, 80)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 160
- self.z = 0
- @key = key
- @key_count = 0
- refresh
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in [email protected]
- if @key.size > 4
- if @key_count >= 3
- x = (i-@key_count+2)*32
- else
- x = i *32
- end
- else
- x = i * 32
- end
- if i < @key_count
- self.contents.font.color = knockout_color
- self.contents.font.size = 16
- elsif i== @key_count
- self.contents.font.color = normal_color
- self.contents.font.size = 25
- else
- self.contents.font.color = disabled_color
- self.contents.font.size = 18
- end
- self.contents.draw_text(x, 0, 100, 32, Input.key_converter(@key[i]))
- end
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def key_in
- @key_count += 1
- refresh
- end
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- def text_in(text)
- self.contents.clear
- self.contents.font.size = 20
- self.contents.draw_text(0, 0, 130, 32, text, 1)
- end
- end
复制代码 |
|