1 => [[LEFT,RIGHT], 0, 129],
# 入力æˆåŠŸæ™‚ã«å¯¾è±¡ã‚’全体化ã™ã‚‹
ALL_ATK = true
# 全体化ã™ã‚‹ã‚¹ã‚ルID
ALL_ATK_SK = [57, 61]
#==============================================================================
# â– Tactical Skills Ver.1.4.0 by Claimh
#------------------------------------------------------------------------------
# Skill is made to move with command input.
# When it fails in command input, power decrease (& animation change)
#==============================================================================
module TacticalSkill
#==============================================================================
# â–¡ Customizing START
#==============================================================================
# Keys
A = Input::A # Keyboard:Z
B = Input::B # Keyboard:X
C = Input::C # Keyboard:C
X = Input::X # Keyboard:A
Y = Input::Y # Keyboard:S
Z = Input::Z # Keyboard:D
L = Input::L # Keyboard:Q
R = Input::R # Keyboard:W
UP = Input::UP
DOWN = Input::DOWN
LEFT = Input::LEFT
RIGHT = Input::RIGHT
# Time to input a key
KEY_SEC = 0.3
# Graphics/Windowskins
T_BAR_NAME = "bar"
# ã‚ータイプを切り替ãˆã‚‹ã‚¹ã‚¤ãƒƒãƒID(表示ã®åˆ‡ã‚Šæ›¿ãˆãŒå‡ºæ¥ã¾ã™)
# I'm not entirely sure, but I think this switches it from keyboard input to gamepad input.
# ON ï¼šã‚²ãƒ¼ãƒ ãƒ‘ãƒƒãƒ‰å¼ (Gamepad)
#  OFF:ã‚ãƒ¼ãƒœãƒ¼ãƒ‰å¼ (Keyboard)
KEY_TYPE_ID = 4
# 入力æˆåŠŸæ™‚ã«å¯¾è±¡ã‚’全体化ã™ã‚‹
ALL_ATK = true
# Skills that, when completed, will attack all enemies
ALL_ATK_SK = []
# Skill Settings
T_SKILL = {
#SkillID => [[Key1,Key2,etc],Percent(ï¼…)(,Success AnimationID)]
1 => [[LEFT,LEFT,LEFT,LEFT], 200],
2 => [[UP,LEFT,DOWN,LEFT], 200],
10 => [[DOWN,DOWN,RIGHT,LEFT], 110],
11 => [[LEFT,DOWN,RIGHT,LEFT], 115],
24 => [[UP, C], 200],
}
# ※失敗時ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’変ãˆã‚‹å ´åˆã¯æ•°ç®‡æ‰€ã‚³ãƒ¡ãƒ³ãƒˆã‚’外ã™å¿…è¦ãŒã‚りã¾ã™ã€‚
#==============================================================================
# â–¡ Customizing 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)
# ゲームパッドタイプ
if $game_switches[TacticalSkill::KEY_TYPE_ID]
case key
when A
return ""
when B
return ""
when C
return ""
when X
return ""
when Y
return ""
when Z
return ""
when L #R
return ""
when R #L
return ""
end
# ã‚ーボードタイプ
else
case key
when A #Z
return ""
when B #X
return ""
when C #C
return ""
when X #A
return ""
when Y #S
return ""
when Z #D
return ""
when L #Q
return ""
when R #W
return "W"
end
end
case key
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
@tact_skill_ok = false
end
#--------------------------------------------------------------------------
# ◠スã‚ルã®åŠ¹æžœé©ç”¨
# user : スã‚ルã®ä½¿ç”¨è€… (ãƒãƒˆãƒ©ãƒ¼)
# skill : スã‚ル
#--------------------------------------------------------------------------
alias skill_effect_tactical skill_effect
def skill_effect(user, skill)
if $scene.is_a?(Scene_Battle) and user.tact_flag
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 # å¨åŠ›0ã§å‘½ä¸ã—ãªã„補æ£
end
ret = skill_effect_tactical(user, skill)
if $scene.is_a?(Scene_Battle) and user.tact_flag
user.tact_flag = false
$data_skills[skill.id] = skill_copy.dup
end
return ret
end
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias update_phase4_step2_tactical update_phase4_step2
def update_phase4_step2
update_phase4_step2_tactical
# åˆæœŸåŒ–
@active_battler.tact_flag = false
#@miss_flag = false # Miss時ã«ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’変ãˆã‚‹æ™‚ã«ã‚³ãƒ¡ãƒ³ãƒˆå¤–ã™
end
#--------------------------------------------------------------------------
# ◠スã‚ルアクション çµæžœä½œæˆ
#--------------------------------------------------------------------------
alias make_skill_action_result_tactical make_skill_action_result
def make_skill_action_result
# å…ˆã«åˆ¤å®š
# 強制アクションã§ãªã‘れã°
unless @active_battler.current_action.forcing
# 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?
# タクティカルスã‚ル発動
make_tactical_skill_result
end
end
if TacticalSkill::ALL_ATK and @tact_skill_ok
if TacticalSkill::ALL_ATK_SK.include?(@skill.id)
skill_copy = @skill.dup
@skill.scope = 2
end
end
make_skill_action_result_tactical # 原物
if TacticalSkill::ALL_ATK and @tact_skill_ok
if TacticalSkill::ALL_ATK_SK.include?(@skill.id)
@tact_skill_ok = false
@skill = $data_skills[skill_copy.id] = skill_copy.dup
end
end
# Miss時ã«ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’変ãˆã‚‹æ™‚ã«ã‚³ãƒ¡ãƒ³ãƒˆå¤–ã™
#if @miss_flag
# @miss_flag = false
# unless TacticalSkill::T_SKILL[@skill.id][2].nil?
# @animation2_id = TacticalSkill::T_SKILL[@skill.id][2]
# end
#end
end
#--------------------------------------------------------------------------
# ◠タクティカルスã‚ル çµæžœä½œæˆ
#--------------------------------------------------------------------------
def make_tactical_skill_result
# é–ƒãæ™‚コマンドãªã—
#return if @active_battler.flash_flag
tact_skill = TacticalSkill::T_SKILL[@active_battler.current_action.skill_id][0]
time = TacticalSkill::KEY_SEC * tact_skill.size * Graphics.frame_rate
key_count = 0
@active_battler.tact_flag = false
# ã‚ー入力&カウントウィンドウ作æˆ
window_keycount = Window_KeyCount.new(tact_skill)
window_counter = Window_KeyCounter.new
#「戦闘ä½ç½®è£œæ£ã€ä½µç”¨æ™‚ã«ã‚³ãƒ¡ãƒ³ãƒˆå¤–ã™
#case $game_party.actors.size
#when 1
# actor_x = 240
#when 2
# actor_x = @active_battler.index * 240 + 120
#when 3
# actor_x = @active_battler.index * 200 + 40
#when 4
actor_y = 328 + (@active_battler.index * 24)
#end
window_keycount.y = window_counter.y = actor_y
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]) # é•ã†ã‚ーを押ã—ãŸ
#@miss_flag = true # Miss時ã«ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’変ãˆã‚‹æ™‚ã«ã‚³ãƒ¡ãƒ³ãƒˆå¤–ã™
# Miss時 SEæ¼”å¥
#Audio.se_play("Audio/SE/" + "ファイルå")
break
end
# å…¨ã‚ー入力完了
if key_count >= tact_skill.size
window_keycount.text_in("")
# Complete時 SEæ¼”å¥
$game_system.se_play($data_system.decision_se)
@active_battler.tact_flag = true
@tact_skill_ok = false if TacticalSkill::ALL_ATK
break
end
# 進æ—ãƒãƒ¼ã®æ›´æ–°
window_counter.refresh((i*100/time).truncate)
Graphics.update
Input.update
end
# 何も入力ã—ãªã‹ã£ãŸ => ミス
if @active_battler.tact_flag
window_keycount.text_in("")
end
# Missã€Complete表示用ã®ã‚¦ã‚§ã‚¤ãƒˆ
for i in 0...10
Graphics.update
@spriteset.update
end
window_keycount.dispose
window_counter.dispose
end
end
#==============================================================================
# â– Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# â— ãƒãƒ¼è¡¨ç¤º
# x : x表示ä½ç½®
# y : y表示ä½ç½®
# current : 進æ—率(ï¼…)
#--------------------------------------------------------------------------
def draw_counter_bar(x, y, current)
bitmap = RPG::Cache.windowskin(TacticalSkill::T_BAR_NAME, 0)
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
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# key :ã‚ーé…列
#--------------------------------------------------------------------------
def initialize
super(0, 228, 150, 200)
self.contents = Bitmap.new(width - 24, height - 32)
self.opacity = 0
self.z = 999 # ãƒãƒˆãƒ©ãƒ¼ã‚ˆã‚Šã‚‚奥ã«è¡¨ç¤º
self.x = 64 + 82+181+39
refresh(0)
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
# current = 進æ—率(ï¼…)
#--------------------------------------------------------------------------
def refresh(current)
self.contents.clear
#draw_counter_bar(0, 0, 100-current) # é€²æ—æ–¹å‘:â†
draw_counter_bar(0, 0, current) # é€²æ—æ–¹å‘:→
end
end
#==============================================================================
# â– Window_KeyCount
#------------------------------------------------------------------------------
#  入力ã™ã‚‹ã‚ーを表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã€‚
#==============================================================================
class Window_KeyCount < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# key :ã‚ーé…列
#--------------------------------------------------------------------------
def initialize(key)
super(0, 220, 150, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0 # åŠé€æ˜Ž
self.z = 299 # 進æ—ãƒãƒ¼ã‚ˆã‚Šã‚‚奥ã«è¡¨ç¤º
@key = key
@key_count = 0
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@key.size
x = i * 32 # æ–‡å—é–“ã®é–“隔:32
if i < @key_count
self.contents.font.color = knockout_color
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x, 0, 100, 32, Input.key_converter(@key[i]))
end
end
#--------------------------------------------------------------------------
# â— ã‚ーカウント
#--------------------------------------------------------------------------
def key_in
@key_count += 1
refresh
end
#--------------------------------------------------------------------------
# ◠テã‚スト表示
# text : テã‚スト
#--------------------------------------------------------------------------
def text_in(text)
self.contents.clear
self.contents.draw_text(0, 0, 100, 32, text, 1)
end
end
DerVVulfman;101243 said:#==============================================================================
# â– Tactical Skills Ver.1.4.0 by Claimh
#------------------------------------------------------------------------------
# Skill is made to move with command input.
# When it fails in command input, power decrease (& animation change)
#==============================================================================
Altavista's Babelfish translator is a wonderful thing.
And so are people who find such scripts. :D
uzumakishade;148609 said:this can be really helpful for an idea i have if pictures can be shown when it asks what to be input instead of the letters/arrows
#==============================================================================
# â– Tactical Skills Ver.1.4.0 by Claimh
#------------------------------------------------------------------------------
# Skill is made to move with command input.
# When it fails in command input, power decrease (& animation change)
#==============================================================================
module TacticalSkill
#==============================================================================
# â–¡ Customizing START
#==============================================================================
# Keys
A = Input::A # Keyboard:Z
B = Input::B # Keyboard:X
C = Input::C # Keyboard:C
X = Input::X # Keyboard:A
Y = Input::Y # Keyboard:S
Z = Input::Z # Keyboard:D
L = Input::L # Keyboard:Q
R = Input::R # Keyboard:W
UP = Input::UP
DOWN = Input::DOWN
LEFT = Input::LEFT
RIGHT = Input::RIGHT
# Time to input a key
KEY_SEC = 1.0
# Graphics/Windowskins
T_BAR_NAME = "bar"
# ã‚ータイプを切り替ãˆã‚‹ã‚¹ã‚¤ãƒƒãƒID(表示ã®åˆ‡ã‚Šæ›¿ãˆãŒå‡ºæ¥ã¾ã™)
# I'm not entirely sure, but I think this switches it from keyboard input to gamepad input.
# ON (Gamepad)
# OFF (Keyboard)
KEY_TYPE_ID = 4
# Allow skills that will attack all enemies when completed
ALL_ATK = true
# Skills that, when completed, will attack all enemies
ALL_ATK_SK = [57, 61]
# Skill Settings
T_SKILL = {
#SkillID => [[Key1,Key2,etc],Percent(%)(,Fail AnimationID)]
1 => [[LEFT,RIGHT], 0, 129], # Heal
2 => [[LEFT, RIGHT, UP, UP], 10],# Greater Heal
3 => [[LEFT, RIGHT, UP, UP, LEFT, RIGHT], 10],# Mass Heal
4 => [[DOWN, UP], 0],#Remedy
5 => [[DOWN, UP, UP, UP], 0], # Greater Remedy
6 => [[UP, UP, UP, DOWN, RIGHT, UP], 0], #Raise
7 => [[UP, RIGHT], 10], #Fire
8 => [[UP, RIGHT], 10],#Greater Fire
9 => [[UP, RIGHT], 10], # Mass Fire
10 => [[DOWN, LEFT], 10],#Ice
11 => [[DOWN, LEFT], 10],#Greater Ice
12 => [[DOWN, LEFT], 10],#Mass Ice
13 => [[UP, LEFT], 10],#Lightning
14 => [[UP, LEFT], 10],#Greater Lightning
15 => [[UP, LEFT], 10],#Mass Lightning
16 => [[DOWN, RIGHT], 10],#Water
17 => [[DOWN, RIGHT], 10],#Greater Water
18 => [[DOWN, RIGHT], 10],#Mass Water
19 => [[DOWN, DOWN], 10],#Earth
20 => [[DOWN, DOWN], 10],#Greater Earth
21 => [[DOWN, DOWN], 10],#Mass Earth
22 => [[UP,UP], 10],#Wind
23 => [[UP,UP], 10],#Greater Wind
24 => [[UP,UP], 10],#Mass Wind
25 => [[RIGHT, RIGHT], 10],#Light
26 => [[RIGHT, RIGHT], 10],#Greater Light
27 => [[RIGHT, RIGHT], 10],#Mass Light
28 => [[LEFT, LEFT], 10],#Shadow
29 => [[LEFT, LEFT], 10],#Greater Shadow
30 => [[LEFT, LEFT], 10],#Mass Shadow
}
# ※失敗時ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’変ãˆã‚‹å ´åˆã¯æ•°ç®‡æ‰€ã‚³ãƒ¡ãƒ³ãƒˆã‚’外ã™å¿…è¦ãŒã‚りã¾ã™ã€‚
#==============================================================================
# â–¡ Customizing 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)
# ゲームパッドタイプ
if $game_switches[TacticalSkill::KEY_TYPE_ID]
case key
when A
return "A"
when B
return "B"
when C
return "C"
when X
return "X"
when Y
return "Y"
when Z
return "Z"
when L
return "R"
when R
return "L"
end
# ã‚ーボードタイプ
else
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"
end
end
case key
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
@tact_skill_ok = false
end
#--------------------------------------------------------------------------
# ◠スã‚ルã®åŠ¹æžœé©ç”¨
# user : スã‚ルã®ä½¿ç”¨è€… (ãƒãƒˆãƒ©ãƒ¼)
# skill : スã‚ル
#--------------------------------------------------------------------------
alias skill_effect_tactical skill_effect
def skill_effect(user, skill)
if $scene.is_a?(Scene_Battle) and user.tact_flag
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 # å¨åŠ›0ã§å‘½ä¸ã—ãªã„補æ£
end
ret = skill_effect_tactical(user, skill)
if $scene.is_a?(Scene_Battle) and user.tact_flag
user.tact_flag = false
$data_skills[skill.id] = skill_copy.dup
end
return ret
end
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias update_phase4_step2_tactical update_phase4_step2
def update_phase4_step2
update_phase4_step2_tactical
# åˆæœŸåŒ–
@active_battler.tact_flag = false
#@miss_flag = false # Miss時ã«ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’変ãˆã‚‹æ™‚ã«ã‚³ãƒ¡ãƒ³ãƒˆå¤–ã™
end
#--------------------------------------------------------------------------
# ◠スã‚ルアクション çµæžœä½œæˆ
#--------------------------------------------------------------------------
alias make_skill_action_result_tactical make_skill_action_result
def make_skill_action_result
# å…ˆã«åˆ¤å®š
# 強制アクションã§ãªã‘れã°
unless @active_battler.current_action.forcing
# 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?
# タクティカルスã‚ル発動
make_tactical_skill_result
end
end
if TacticalSkill::ALL_ATK and @tact_skill_ok
if TacticalSkill::ALL_ATK_SK.include?(@skill.id)
skill_copy = @skill.dup
@skill.scope = 2
end
end
make_skill_action_result_tactical # 原物
if TacticalSkill::ALL_ATK and @tact_skill_ok
if TacticalSkill::ALL_ATK_SK.include?(@skill.id)
@tact_skill_ok = false
@skill = $data_skills[skill_copy.id] = skill_copy.id
end
end
# Miss時ã«ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’変ãˆã‚‹æ™‚ã«ã‚³ãƒ¡ãƒ³ãƒˆå¤–ã™
#if @miss_flag
# @miss_flag = false
# unless TacticalSkill::T_SKILL[@skill.id][2].nil?
# @animation2_id = TacticalSkill::T_SKILL[@skill.id][2]
# end
#end
end
#--------------------------------------------------------------------------
# ◠タクティカルスã‚ル çµæžœä½œæˆ
#--------------------------------------------------------------------------
def make_tactical_skill_result
# é–ƒãæ™‚コマンドãªã—
#return if @active_battler.flash_flag
tact_skill = TacticalSkill::T_SKILL[@active_battler.current_action.skill_id][0]
time = TacticalSkill::KEY_SEC * tact_skill.size * Graphics.frame_rate
key_count = 0
@active_battler.tact_flag = true
# ã‚ー入力&カウントウィンドウ作æˆ
window_keycount = Window_KeyCount.new(tact_skill)
window_counter = Window_KeyCounter.new
#「戦闘ä½ç½®è£œæ£ã€ä½µç”¨æ™‚ã«ã‚³ãƒ¡ãƒ³ãƒˆå¤–ã™
#case $game_party.actors.size
#when 1
# actor_x = 240
#when 2
# actor_x = @active_battler.index * 240 + 120
#when 3
# actor_x = @active_battler.index * 200 + 40
#when 4
actor_x = @active_battler.index * 1
#end
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]) # é•ã†ã‚ーを押ã—ãŸ
#@miss_flag = true # Miss時ã«ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’変ãˆã‚‹æ™‚ã«ã‚³ãƒ¡ãƒ³ãƒˆå¤–ã™
# Miss時 SEæ¼”å¥
#Audio.se_play("Audio/SE/" + "ファイルå")
break
end
# å…¨ã‚ー入力完了
if key_count >= tact_skill.size
window_keycount.text_in("Complete")
# Complete時 SEæ¼”å¥
#Audio.se_play("Audio/SE/" + "ファイルå")
@active_battler.tact_flag = false
@tact_skill_ok = true if TacticalSkill::ALL_ATK
break
end
# 進æ—ãƒãƒ¼ã®æ›´æ–°
window_counter.refresh((i*100/time).truncate)
Graphics.update
Input.update
end
# 何も入力ã—ãªã‹ã£ãŸ => ミス
if @active_battler.tact_flag
window_keycount.text_in("Miss")
end
# Missã€Complete表示用ã®ã‚¦ã‚§ã‚¤ãƒˆ
for i in 0...10
Graphics.update
@spriteset.update
end
window_keycount.dispose
window_counter.dispose
end
end
#==============================================================================
# â– Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# â— ãƒãƒ¼è¡¨ç¤º
# x : x表示ä½ç½®
# y : y表示ä½ç½®
# current : 進æ—率(ï¼…)
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# key :ã‚ーé…列
#--------------------------------------------------------------------------
# THIS DEFINES THE WINDOW DISPLAYED
def initialize
super(0, 256, 150, 80)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.z = 1 # ãƒãƒˆãƒ©ãƒ¼ã‚ˆã‚Šã‚‚奥ã«è¡¨ç¤º
refresh(0)
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
# current = 進æ—率(ï¼…)
#--------------------------------------------------------------------------
def refresh(current)
self.contents.clear
#draw_counter_bar(0, 0, 100-current) # é€²æ—æ–¹å‘:â†
draw_counter_bar(0, 0, current) # é€²æ—æ–¹å‘:→
end
end
#==============================================================================
# â– Window_KeyCount
#------------------------------------------------------------------------------
#  入力ã™ã‚‹ã‚ーを表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã€‚
#==============================================================================
class Window_KeyCount < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# key :ã‚ーé…列
#--------------------------------------------------------------------------
def initialize(key)
super(0, 220, 300, 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 0...@key.size
x = i * 32 # æ–‡å—é–“ã®é–“隔:32
if i < @key_count
self.contents.font.color = knockout_color
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x, 0, 100, 32, Input.key_converter(@key[i]))
end
end
#--------------------------------------------------------------------------
# â— ã‚ーカウント
#--------------------------------------------------------------------------
def key_in
@key_count += 1
refresh
end
#--------------------------------------------------------------------------
# ◠テã‚スト表示
# text : テã‚スト
#--------------------------------------------------------------------------
def text_in(text)
self.contents.clear
self.contents.draw_text(0, 0, 100, 32, text, 1)
end
end