#============================================================================== #¡¡£«£«¡¡¾×Ƽºê ŸÀÓ ¹èƲ¡¡ver. 2.10¡¡£«£« #¡¡¡¡Script by ÆÄ¶ó°³ #¡¡¡¡http://rpg.para.s3p.net/ #------------------------------------------------------------------------------ # CT°ÔÀÌÁö°¡ ¸ðÀÎ ¹öƲ·¯·ÎºÎÅÍ ¼ø¼­¿¡ Ä¿¸àµå ÀÔ·ÂÇÏ´Â ÀüÅõ Çü½Ä. # ¾µµ¥¾øÀÌ ¹«°Å¿î ÀüÅõÁßÀÇ ¹¦È­ 󸮸¦ °æ°¨½ÃÄÑ, # ¹èƲ ½ºÅ×ÀÌÅͽº È­¸éÀ» »çÀ̵åºäÀÎ°Í °°°Ô ÇÕ´Ï´Ù. # ¹öƲ·¯¸¦ »çÀ̵åºäŸÀÌÇÁ¿¡ Ç¥½ÃÇÏ´Â ½ºÅ©¸³Æ®´Â , ÁÁ¾ÆÇÏ´Â °ÍÀ» # ÁغñÇØ ÁÖ¼¼¿ä. # (ÀÌ ½ºÅ©¸³Æ®¸¦ À§¿¡ µÎ´Â ÆíÀÌ °æÇÕÀÇ À§Ç輺ÀÌ ÁÙ¾îµç´Ù°í »ý°¢ÇÏ´Â ) #------------------------------------------------------------------------------ #£ÛÁ¶ÀÛ£Ý #¡¤µµÁÖ #¡¡¾Æ±º ¹öƲ·¯ÀÇ ÇÑ ¸í ÀÌ»óÀÌ Ä¿¸àµå ÀÔ·Â ±â´Ù¸®´Â ¶§¿¡ ĵ½½ ¹öÆ°À» ´©¸£´Â °ÍÀ¸·Î #¡¡¡¸µµ¸ÁÄ£´Ù¡¹Ä¿¸àµå¸¦ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. #¡¡ÀûÀÇ ¼ö°¡ ¸¹±âµµ ÇÏ°í , Ä¿¸àµå ÀÔ·Â ±â´Ù¸®´Â ¹öƲ·¯°¡ ÀûÀ¸¸é #¡¡µµÁÖ ¼º°øÀ²ÀÌ ³·¾ÆÁý´Ï´Ù. # #¡¤Çൿ¼ø¼­ÀÇ ±³Ã¼ #¡¡º¹¼öÀÇ ¹öƲ·¯°¡ Çൿ °¡´É ¶§ , #¡¡R¹öÆ°(PageDownÅ°) À¸·Î ´ÙÀ½ÀÇ ¹öƲ·¯¿Í Â÷·Ê¸¦ ¹Ù²ã ³Ö¾î #¡¡L¹öÆ°(PageUpÅ°) À¸·Î Çൿ¼ø¼­¸¦ °¡Àå ¸¶Áö¸·¿¡ µ¹¸³´Ï´Ù. #============================================================================== module CTB # Ä¿¸àµå ÀԷ½ÿ¡CTÀÇ Ä«¿îÆ®¸¦ ¸ØÃâ±î (true:¸ØÃß´Â / false:¸ØÃã ¾ø´Ù ) COMMAND_WAIT = false # ¾ÆÀÌÅÛ , ½ºÅ³ , Ÿ°Ù ¼±Åýÿ¡CTÀÇ Ä«¿îÆ®¸¦ ¸ØÃâ±î (true:¸ØÃß´Â / false:¸ØÃã ¾ø´Ù ) SELECT_WAIT = true # ¾Ö´Ï¸ÞÀÌ¼Ç Ç¥½Ã½Ã¿¡CTÀÇ Ä«¿îÆ®¸¦ ¸ØÃâ±î (true:¸ØÃß´Â / false:¸ØÃã ¾ø´Ù ) ANIMATION_WAIT = false # ¹èƲ ½ºÇǵå(¼öÄ¡°¡ Å« ¸¸Å­CTÀÇ ±¯ÀÌ »¡¶óÁø´Ù ) BATTLE_SPEED = 3 # ¹èƲ ¸â¹öÀÇ ÃÖ´ë¼ö(¸¹Àº »ç¶÷PT½ºÅ©¸³Æ®¸¦ µµÀÔÇÏ°í ÀÖÀ» ¶§·Î ¼³Á¤) PARTY_SIZE = 4 # Çൿ Á¾·á½ÃÀÇCT°¨¼Ò ÆÛ¼¾Æ¼Áö ACT_ATTACK_CT = 100 # Åë»ó °ø°Ý ACT_GUARD_CT = 50 # ¹æ¾î ACT_ESCAPE_CT = 100 # µµÁÖ ½ÇÆÐ ACT_SKILL_CT = 100 # ½ºÅ³ ACT_ITEM_CT = 100 # ¾ÆÀÌÅÛ # µµÁÖ ½ÇÆнÃÀÇ ¸Þ¼¼Áö UNESCAPE_MES = "µµÁÖ ½ÇÆÐ" # CT¸¸ ź½ÃÀÇ ¹öƲ·¯ÀÇ »öÁ¶((0,0,0)·Î º¯È­ ¾øÀ½) FULL_CT_COLOR = Tone.new(32,0,0) # HP°ÔÀÌÁöÀÇ »ö(±×¶óµ¥ÀÌ¼Ç Á´Ü) HP_COLOR_LEFT = Color.new(128, 0, 0, 255) # HP°ÔÀÌÁöÀÇ »ö(±×¶óµ¥ÀÌ¼Ç ¿ì´Ü)£© HP_COLOR_RIGHT= Color.new(255, 0, 0, 255) # SP°ÔÀÌÁöÀÇ »ö(±×¶óµ¥ÀÌ¼Ç Á´Ü) SP_COLOR_LEFT = Color.new(0, 0, 128, 255) # SP°ÔÀÌÁöÀÇ »ö(±×¶óµ¥ÀÌ¼Ç ¿ì´Ü) SP_COLOR_RIGHT= Color.new(0, 0, 255, 255) # CT°ÔÀÌÁöÀÇ »ö(±×¶óµ¥ÀÌ¼Ç Á´Ü) COLOR_LEFT = Color.new(128, 128, 64, 255) # CT°ÔÀÌÁöÀÇ »ö(±×¶óµ¥ÀÌ¼Ç ¿ì´Ü) COLOR_RIGHT= Color.new(255, 255, 128, 255) # CTÀÌ °¡µæÇÏ°Ô µÇ¾úÀ» ¶§ÀÇ °ÔÀÌÁöÀÇ »ö COLOR_FULL = Color.new(255, 225, 128, 255) # °ÔÀÌÁö¹üÀ§ÀÇ »ö FRAME_COLOR = Color.new(192, 192, 192, 255) # °ÔÀÌÁö¹üÀ§ÀÇ ±½±â FRAME_BORDER = 1 # °ÔÀÌÁöÀÇ ¹è°æ»ö BACK_COLOR = Color.new(128, 128, 128, 128) # À̸§ÀÇ font size NAME_FONT_SIZE =16 # HP/SPÀÇ font size HPSP_FONT_SIZE =18 # ¿¡³Ê¹Ì¸íÀÇ font size ENEMY_FONT_SIZE =16 # ÃÖ´ëHP/SP¸¦ ¹¦È­ ÇÒ±î ( true / false ) MAX_DRAW = false # Ä¿¸àµå À©µµ¿ìÀÇ À§Ä¡¸¦ °­Á¦ ÁöÁ¤( true / false ) #(´Ù¸¥ (ºÐ)ÆíÀÇ »çÀ̵åºä½ºÅ©¸®ÇÁÆ®¸¦ º´¿ë ÇÏ°í ÀÖ¾î # Ä¿¸àµå À©µµ¿ìÀÇ À§Ä¡°¡ ¾Æ¹«·¡µµ ºÎÀÚ¿¬½º·´°Ô ¿Ï¸¸Çѵétrue¿¡°Ô ) # ¡Øtrue·Î ÇÏ´Â °æ¿ì , ÀÌ ½ºÅ©¸³Æ®¸¦ »çÀ̵åºäº¸´Ù ¾Æ·¡¿¡ µÎ¾î ÁÖ¼¼¿ä WINDOWPOS_CHANGE = false WINDOWPOS_X = 100 # XÁÂÇ¥ WINDOWPOS_Y = 320 # YÁÂÇ¥ end #============================================================================== # ¡á Scene_Battle #============================================================================== class Scene_Battle #-------------------------------------------------------------------------- # ¡Û CTÀÇ Ä«¿îÆ® #-------------------------------------------------------------------------- def update_ct # Ä«¿îÆ®¾÷ÀÌ Çã°¡µÇ°í ÀÖÀ» ¶§ if @countup for actor in $game_party.actors # ¿¢ÅÍ°¡ Çൿ °¡´É if actor.countup and actor.movable? # CTÀÌmax°¡ µÇ¾î ÀÖ¾î , Ä¿¸àµå ÀÔ·Â ´ë±â ¿¢ÅÍ¿¡°Ô Æ÷ÇÔµÇÁö ¾Ê´Â if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor)) # Ä¿¸àµå ÀÔ·Â ´ë±â ¿¢ÅÍ¿¡°Ô Ãß°¡ @pre_action_battlers.push(actor) # ±× ÀÌ»ó Ä«¿îÆ®¾÷ÇÏÁö ¾Ê´Â actor.countup = false actor.full_ct = true else # Ä«¿îÆ®¾÷ actor.make_action_speed actor.now_ct += actor.current_action.speed * CTB::BATTLE_SPEED end # ÀüÅõ ºÒ´ÉÀÌ µÇ¸éCTÀ»0¿¡ elsif actor.hp0? and actor.now_ct > 0 clear_ct(actor) end end for enemy in $game_troop.enemies # ¿¡³Ê¹Ì°¡ Çൿ °¡´É if enemy.countup and enemy.movable? # CTÀÌmax°¡ µÇ¾î ÀÖ¾î , Çൿ ´ë±â ¿¡³Ê¹Ì¿¡ Æ÷ÇÔµÇÁö ¾Ê´Â if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy) # Çൿ ´ë±â ¿¡³Ê¹Ì¿¡ Ãß°¡ @pre_action_battlers.push(enemy) # ±× ÀÌ»ó Ä«¿îÆ®¾÷ÇÏÁö ¾Ê´Â enemy.countup = false enemy.full_ct = true else # Ä«¿îÆ®¾÷ enemy.make_action_speed enemy.now_ct += enemy.current_action.speed * CTB::BATTLE_SPEED end end end # CT°ÔÀÌÁö¸¦ À繦ȭ @status_window.refresh_ct end end #-------------------------------------------------------------------------- # ¡Û ¹öƲ·¯ÀÇ °ÍCTÀ»0¿¡ #-------------------------------------------------------------------------- def clear_ct(battler) battler.countup = true battler.now_ct = 0 end #-------------------------------------------------------------------------- # ¡Û ¹öƲ·¯ÀÇ °ÍCTÀ» ÀÓÀÇÀÇ ÆÛ¼¾Æ¼Áö¿¡ #-------------------------------------------------------------------------- def declease_ct(battler,percent) battler.countup = true battler.now_ct = battler.now_ct * percent / 100 end #-------------------------------------------------------------------------- # ¡Û CTÀÇ ÃʱâÈ­ #-------------------------------------------------------------------------- def initialize_ct # CTÀÇ ±âÁØÄ¡¸¦ °áÁ¤ max_ct for battler in $game_party.actors + $game_troop.enemies if battler.movable? n = $game_party.actors.size + $game_troop.enemies.size # ÀüÅõ °³½Ã½Ã¿¡ ÀÖ´Â Á¤µµÀÇ °ÍCTÀ» ¸ð¾Æ µÎ´Â battler.now_ct = battler.agi * 60 * n else clear_ct(battler) end battler.countup = true battler.full_ct = false battler.max_ct = @max_ct end end #-------------------------------------------------------------------------- # ¡Û ¹öƲ·¯ Àü¿øÀÇ ¹ÎøÇÔÀ¸·ÎºÎÅÍCTÀÇ ±âÁØÄ¡¸¦ °áÁ¤ #-------------------------------------------------------------------------- def max_ct for battler in $game_party.actors + $game_troop.enemies @max_ct += battler.agi end @max_ct *= 100 end #-------------------------------------------------------------------------- # ¡Û ¹öƲ·¯ÀÇ Çൿ¼ø¼­¸¦ º¯°æ #-------------------------------------------------------------------------- def shift_activer(shift) # Çϳª ½¬ÇÁÆ® ÇÒ ¶§·Î µÚÀÇ ¿¢ÅÍ°¡2»ç¶÷ ÀÌ»ó if @pre_action_battlers != nil if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3 # ÇöÀçÀÇ ¿¢Å͸¦ Ãëµæ act = @pre_action_battlers[@actor_array_index] # ÇöÀçÀÇ ¿¢Å͸¦ µÎ °³ µÚ·Î »ðÀÔ @pre_action_battlers.insert(@actor_array_index+2, act) # ÇöÀç À§Ä¡¸¦ ¼Ò°Å @pre_action_battlers.delete_at(@actor_array_index) @actor_array_index -= 1 phase3_next_actor else act = @pre_action_battlers[@actor_array_index] # ÇöÀçÀÇ ¿¢Å͸¦ Á¦ÀÏ µÚ·Î Ãß°¡ @pre_action_battlers.push(act) # ÇöÀç À§Ä¡¸¦ ¼Ò°Å @pre_action_battlers.delete_at(@actor_array_index) @actor_array_index -= 1 phase3_next_actor end end end #-------------------------------------------------------------------------- # ¡Ü ¸ÞÀΠó¸® #-------------------------------------------------------------------------- alias main_ctb main def main # ¿¡³Ê¹Ì¸í À©µµ¿ì¸¦ ÀÛ¼º @status_window2 = Window_BattleStatus_enemy.new @action_battlers = [] @pre_action_battlers = [] @max_ct = 0 @countup = false @ct_wait = 0 main_ctb # ¿¡³Ê¹Ì¸í À©µµ¿ì¸¦ Æıâ @status_window2.dispose end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å #-------------------------------------------------------------------------- alias ctb_update update def update ctb_update update_ct end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹¹ÙÆ®¸£ÆäÁî °³½Ã #-------------------------------------------------------------------------- alias ctb_start_phase1 start_phase1 def start_phase1 # CT¸¦ ÃʱâÈ­ initialize_ct # Ä«¿îÆ®¾÷ °³½Ã @countup = true ctb_start_phase1 end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å (ÇÁ·¹¹ÙÆ®¸£ÆäÁî) #-------------------------------------------------------------------------- def update_phase1 # ¿¡³Ê¹Ì¸í ¸®½ºÆ®¸¦ °»½Å @status_window2.refresh # ã­ø¨÷÷ïÒ if judge # ½Â¸® ¶Ç´Â ÆйèÀÇ °æ¿ì : ¸Þ¼Òµå Á¾·á return end # ÆÄƼ Ä¿¸àµå ±¹¸éÀ» ³¯·Á ¿¢ÅÍ Ä¿¸àµå ±¹¸é °³½Ã start_phase3 end #-------------------------------------------------------------------------- # ¡Ü ÆÄƼ Ä¿¸àµå ±¹¸é °³½Ã #-------------------------------------------------------------------------- def start_phase2 # ±¹¸é 2 ¿¡ ÀÌÇà @phase = 2 # ¿¢Å͸¦ ºñ¼±Åà »óÅ·Π¼³Á¤ @actor_index = -1 @active_battler = nil # ÆÄƼ Ä¿¸àµå À©µµ¿ì¸¦ À¯È¿È­ @party_command_window.active = true @party_command_window.visible = true # ¿¢ÅÍ Ä¿¸àµå À©µµ¿ì¸¦ ¹«È¿È­ @actor_command_window.active = false @actor_command_window.visible = false # ¸ÞÀÎ ±¹¸é Ç÷¡±×¸¦ Ŭ¸®¾î $game_temp.battle_main_phase = false # Ä¿¸àµå ÀÔ·Â ºÒ°¡´ÉÇÑ °æ¿ì unless $game_party.inputable? # ¸ÞÀÎ ±¹¸é °³½Ã start_phase4 end end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å (ÆÄƼ Ä¿¸àµå ±¹¸é : µµ¸ÁÄ¡´Â) #-------------------------------------------------------------------------- def update_phase2_escape # ¿¡³Ê¹ÌÀÇ ¹ÎøÇÔ Çհ踦 °è»ê enemies_agi = 0 for enemy in $game_troop.enemies if enemy.exist? enemies_agi += enemy.agi end end # Çൿ °¡´É ¿¢ÅÍÀÇ ¹ÎøÇÔ Çհ踦 °è»ê actors_agi = 0 for actor in @pre_action_battlers if actor.exist? actors_agi += actor.agi end end # µµÁÖ ¼º°ø ÆÇÁ¤ success = rand(100) < 50 * actors_agi / enemies_agi # µµÁÖ ¼º°øÀÇ °æ¿ì if success # µµÁÖ SE ¸¦ ¿¬ÁÖ $game_system.se_play($data_system.escape_se) # ¹èƲ °³½ÃÀüÀÇ °Í BGM ¿¡ µÇµ¹¸®´Â $game_system.bgm_play($game_temp.map_bgm) # ¹èƲ Á¾·á battle_end(1) # µµÁÖ ½ÇÆÐÀÇ °æ¿ì else # ÇïÇÁ À©µµ¿ì¿¡ "µµÁÖ ½ÇÆÐ" ¸¦ ¼¼Æ® @help_window.set_text(CTB::UNESCAPE_MES, 1) # ¾×¼Ç°úCT¸¦ Ŭ¸®¾î for act in @pre_action_battlers declease_ct(act, 100-CTB::ACT_ESCAPE_CT) act.current_action.clear end # ÇïÇÁ À©µµ¿ì¸¦ Ç¥½Ã @help_window.visible = true @wait_count = 20 # ¸ÞÀÎ ±¹¸é °³½Ã start_phase4 end end #-------------------------------------------------------------------------- # ¡Ü ¿¢ÅÍ Ä¿¸àµå ±¹¸é °³½Ã #-------------------------------------------------------------------------- def start_phase3 # ±¹¸é 3 ¿¡ ÀÌÇà @phase = 3 # ¿¢Å͸¦ ºñ¼±Åà »óÅ·Π¼³Á¤ @actor_index = -1 @active_battler = nil @actor_array_index = -1 # ´ÙÀ½ÀÇ ¿¢ÅÍÀÇ Ä¿¸àµå ÀԷ¿¡ if @pre_action_battlers != [] phase3_next_actor else start_phase4 end end #-------------------------------------------------------------------------- # ¡Ü ´ÙÀ½ÀÇ ¿¢ÅÍÀÇ Ä¿¸àµå ÀԷ¿¡ #-------------------------------------------------------------------------- def phase3_next_actor # ·çÇÁ begin # ¿¢ÅÍÀÇ ¸í ¸ê¸Á È¿°ú OFF if @active_battler != nil @active_battler.blink = false end # ¸¶Áö¸· ¿¢ÅÍÀÇ °æ¿ì if @actor_array_index + 1 == @pre_action_battlers.size # ¸ÞÀÎ ±¹¸é °³½Ã start_phase4 return #´ÙÀ½ÀÌ ¿¡³Ê¹ÌÀÇ °æ¿ì elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1]) # ¸ÞÀÎ ±¹¸é °³½Ã start_phase4 return end # ¿¢ÅÍÀÇ À妽º¸¦ ÁøÇà½ÃÅ°´Â @actor_array_index += 1 @actor_index = @pre_action_battlers[@actor_array_index].index @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true @active_battler.current_action.clear # ¿¢ÅÍ°¡ Ä¿¸àµå ÀÔ·ÂÀ» ¹Þ¾ÆµéÀÌÁö ¾Ê´Â »óŶó¸é Çѹø ´õ end until @active_battler.inputable? # ¿¢ÅÍ Ä¿¸àµå À©µµ¿ì¸¦ ¼Â¾÷ phase3_setup_command_window end #-------------------------------------------------------------------------- # ¡Ü ÀüÀÇ ¿¢ÅÍÀÇ Ä¿¸àµå ÀԷ¿¡ #-------------------------------------------------------------------------- def phase3_prior_actor # «ë?«× begin # ¿¢ÅÍÀÇ ¸í ¸ê¸Á È¿°ú OFF if @active_battler != nil @active_battler.blink = false end # ÃÖÃÊÀÇ ¿¢ÅÍÀÇ °æ¿ì if @actor_array_index <= 0 # ¿¢ÅÍ Ä¿¸àµå ±¹¸é °³½Ã start_phase2 return end # ¿¢ÅÍÀÇ À妽º¸¦ µÇµ¹¸®´Â @actor_array_index -= 1 @actor_index = @pre_action_battlers[@actor_array_index].index @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true @active_battler.current_action.clear # ¿¢ÅÍ°¡ Ä¿¸àµå ÀÔ·ÂÀ» ¹Þ¾ÆµéÀÌÁö ¾Ê´Â »óŶó¸é Çѹø ´õ end until @active_battler.inputable? # ¿¢ÅÍ Ä¿¸àµå À©µµ¿ì¸¦ ¼Â¾÷ phase3_setup_command_window end #-------------------------------------------------------------------------- # ¡Ü ¿¢ÅÍ Ä¿¸àµå À©µµ¿ìÀÇ ¼Â¾÷ #-------------------------------------------------------------------------- alias phase3_setup_command_window_ctb phase3_setup_command_window def phase3_setup_command_window phase3_setup_command_window_ctb if CTB::WINDOWPOS_CHANGE # ¿¢ÅÍ Ä¿¸àµå À©µµ¿ìÀÇ À§Ä¡¸¦ ¼³Á¤ @actor_command_window.x = CTB::WINDOWPOS_X @actor_command_window.y = CTB::WINDOWPOS_Y # ½ºÅ×ÀÌÅͽº À©µµ¿ì¿¡ ¼ûÁö ¾Ê°Ô @actor_command_window.z = 9999 end end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å (¿¢ÅÍ Ä¿¸àµå ±¹¸é) #-------------------------------------------------------------------------- def update_phase3 # ¿¡³×¹Ì¾Æ·Î°¡ À¯È¿ÀÇ °æ¿ì if @enemy_arrow != nil @countup = CTB::SELECT_WAIT ? false : true update_phase3_enemy_select # ¾ÆũŸ¾Æ·Î°¡ À¯È¿ÀÇ °æ¿ì elsif @actor_arrow != nil @countup = CTB::SELECT_WAIT ? false : true update_phase3_actor_select # ½ºÅ³ À©µµ¿ì°¡ À¯È¿ÀÇ °æ¿ì elsif @skill_window != nil @countup = CTB::SELECT_WAIT ? false : true update_phase3_skill_select # ¾ÆÀÌÅÛ À©µµ¿ì°¡ À¯È¿ÀÇ °æ¿ì elsif @item_window != nil @countup = CTB::SELECT_WAIT ? false : true update_phase3_item_select # ¿¢ÅÍ Ä¿¸àµå À©µµ¿ì°¡ À¯È¿ÀÇ °æ¿ì elsif @actor_command_window.active @countup = CTB::COMMAND_WAIT ? false : true update_phase3_basic_command end end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å (¿¢ÅÍ Ä¿¸àµå ±¹¸é : ±âº» Ä¿¸àµå) #-------------------------------------------------------------------------- alias ctb_update_phase3_basic_command update_phase3_basic_command def update_phase3_basic_command ctb_update_phase3_basic_command # LR¹öÆ°À¸·Î Çൿ¼ø¼­¸¦ º¯°æ if Input.trigger?(Input::R) shift_activer(1) end if Input.trigger?(Input::L) shift_activer(-1) end end #-------------------------------------------------------------------------- # ¡Ü ¸ÞÀÎ ±¹¸é °³½Ã #-------------------------------------------------------------------------- def start_phase4 # ±¹¸é 4 ¿¡ ÀÌÇà @phase = 4 if @pre_action_battlers != [] # ¹èƲ À̺¥Æ®ÀÇ Àü ÆäÀÌÁö¸¦ °Ë»ö 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 # «¿?«ó?«««¦«ó«È $game_temp.battle_turn += 1 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 = [] if @pre_action_battlers != [] i = 0 for i in 0..@actor_array_index # ¿¢Å͸¦ ¹è¿­ @action_battlers ¿¡ Ãß°¡ @action_battlers.push(@pre_action_battlers[0]) @pre_action_battlers[0].full_ct = false @pre_action_battlers.shift end if @pre_action_battlers.size != 0 loop do if $game_troop.enemies.include?(@pre_action_battlers[0]) # «¨«Í«ß?ªòÛÕÖª @action_battlers ªËõÚÊ¥ @action_battlers.push(@pre_action_battlers[0]) @pre_action_battlers[0].full_ct = false @pre_action_battlers.shift else break end end end end end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å (¸ÞÀÎ ±¹¸é ½ºÅÜ 1 : ¾×¼Ç Áغñ) #-------------------------------------------------------------------------- alias ctb_update_phase4_step1 update_phase4_step1 def update_phase4_step1 @countup = true # ÇïÇÁ À©µµ¿ì¸¦ ¼û±â´Â @help_window.visible = false # ã­ø¨÷÷ïÒ if judge # ½Â¸® ¶Ç´Â ÆйèÀÇ °æ¿ì : ¸Þ¼Òµå Á¾·á return end # ¹ÌÇൿ ¹öƲ·¯°¡ Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì (Àü¿ø ÇൿÇÑ) if @action_battlers.size == 0 # ¿¢ÅÍ Ä¿¸àµå ±¹¸é °³½Ã start_phase3 return end ctb_update_phase4_step1 end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å (¸ÞÀÎ ±¹¸é ½ºÅÜ 2 : ¾×¼Ç °³½Ã) #-------------------------------------------------------------------------- alias ctb_update_phase4_step2 update_phase4_step2 def update_phase4_step2 # ¾Ö´Ï¸ÞÀÌ¼Ç Àç»ýÁß¿¡CT¸¦ Ä«¿îÆ® ÇÒ±î @countup = CTB::ANIMATION_WAIT ? false : true ctb_update_phase4_step2 end #-------------------------------------------------------------------------- # ¡Ü ½ºÅ³ ¾×¼Ç °á°ú ÀÛ¼º #-------------------------------------------------------------------------- def make_skill_action_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 # CT¸¦ Ŭ¸®¾î clear_ct(@active_battler) # ½ºÅÜ 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 #-------------------------------------------------------------------------- # ¡Ü ¾ÆÀÌÅÛ ¾×¼Ç °á°ú ÀÛ¼º #-------------------------------------------------------------------------- alias ctb_make_item_action_result make_item_action_result def make_item_action_result # «¢«¤«Æ«àªòö¢Ôð @item = $data_items[@active_battler.current_action.item_id] # «¢«¤«Æ«àï·ªìªÊªÉªÇÞÅéĪǪ­ªÊª¯ªÊªÃª¿íÞùê unless $game_party.item_can_use?(@item.id) # CTªò«¯«ê«¢ clear_ct(@active_battler) # «¹«Æ«Ã«× 1 ªËì¹ú¼ @phase4_step = 1 return end ctb_make_item_action_result end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å (¸ÞÀÎ ±¹¸é ½ºÅÜ 5 : µ¥¹ÌÁö Ç¥½Ã) #-------------------------------------------------------------------------- alias ctb_update_phase4_step5 update_phase4_step5 def update_phase4_step5 # «Ø«ë«×«¦«£«ó«É«¦ªò?ª¹ @help_window.visible = false # «¹«Æ?«¿«¹«¦«£«ó«É«¦ªò«ê«Õ«ì«Ã«·«å @status_window.refresh @status_window.refresh_ct # «À«á?«¸øúãÆ for target in @target_battlers if target.damage != nil target.damage_pop = true end end # «¹«Æ«Ã«× 6 ªËì¹ú¼ @phase4_step = 6 end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å (¸ÞÀÎ ±¹¸é ½ºÅÜ 6 : ¸®ÇÁ·¹½¬) #-------------------------------------------------------------------------- alias update_phase4_step6_ctb update_phase4_step6 def update_phase4_step6 case @active_battler.current_action.basic # ÐñÜâ when 0 case @active_battler.current_action.kind # Íô? when 0 declease_ct(@active_battler,100-CTB::ACT_ATTACK_CT) # «¹«­«ë when 1 declease_ct(@active_battler,100-CTB::ACT_SKILL_CT) # «¢«¤«Æ«à when 2 declease_ct(@active_battler,100-CTB::ACT_ITEM_CT) else clear_ct(@active_battler) end # ÛÁåÙ when 1 declease_ct(@active_battler,100-CTB::ACT_GUARD_CT) else clear_ct(@active_battler) end # «¨«Í«ß?Ù£«ê«¹«ÈªòÌÚãæ @status_window2.refresh update_phase4_step6_ctb end #-------------------------------------------------------------------------- # ¡Ü ¾ÖÇÁÅÍ ¹èƲ ±¹¸é °³½Ã #-------------------------------------------------------------------------- alias ctb_start_phase5 start_phase5 def start_phase5 @countup = false ctb_start_phase5 end end #============================================================================== # ¡á Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize super(160, 320, 480, 160) self.contents = Bitmap.new(width - 32, height - 32) @level_up_flags = [false, false, false, false] @before_hp = [] @before_sp = [] @before_states = [] @now_hp = [] @now_sp = [] @now_states = [] refresh end #-------------------------------------------------------------------------- # ¡Ü «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh @item_max = $game_party.actors.size for i in 0...$game_party.actors.size actor = $game_party.actors[i] line_height = 120 / CTB::PARTY_SIZE actor_y = i * line_height + 4 # úÞΫ¹«Æ?«¿«¹ªòÛÕÖªªË @now_hp[i] = actor.hp @now_sp[i] = actor.sp @now_states[i] = actor.states # «ì«Ù«ë«¢«Ã«× if @level_up_flags[i] self.contents.fill_rect(344, actor_y+14, 100, 8, Color.new(0, 0, 0, 0)) self.contents.font.color = normal_color self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!") end end # «Ð«È«ë«¹«Æ?«¿«¹ªÎ?Õáûù?×â # «¹«Æ?«¿«¹ªÎÛÕÖªª¬?ûùª·ª¿ªÈª­ªÎªßÙÚ??×â if @before_hp == nil or @before_sp == nil or @before_states == nil or @before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states self.contents.clear for i2 in 0...$game_party.actors.size actor = $game_party.actors[i2] line_height = 120 / CTB::PARTY_SIZE actor_y = i2 * line_height + 4 self.contents.font.size = CTB::NAME_FONT_SIZE # Ù£îñªòÙÚ? draw_actor_name(actor, 4, actor_y+16-CTB::NAME_FONT_SIZE) # HPªòÙÚ? hp_color1 = CTB::HP_COLOR_LEFT hp_color2 = CTB::HP_COLOR_RIGHT draw_meter(actor.hp, actor.maxhp, 125, actor_y+14, 80, 8, hp_color1, hp_color2) draw_actor_hp(actor, 102, actor_y+16-CTB::HPSP_FONT_SIZE, 100) # SPªòÙÚ? sp_color1 = CTB::SP_COLOR_LEFT sp_color2 = CTB::SP_COLOR_RIGHT draw_meter(actor.sp, actor.maxsp, 245, actor_y+14, 80, 8, sp_color1, sp_color2) draw_actor_sp(actor, 222, actor_y+16-CTB::HPSP_FONT_SIZE, 100) # ?ûùý­ªÎ«¹«Æ?«¿«¹ªòÛÕÖªªË @before_hp[i2] = actor.hp @before_sp[i2] = actor.sp @before_states[i2] = actor.states # «ì«Ù«ë«¢«Ã«× if @level_up_flags[i2] self.contents.fill_rect(344, actor_y, 100, 8, Color.new(0, 0, 0, 0)) self.contents.font.color = normal_color self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!") end end end end #-------------------------------------------------------------------------- # ¡Ü CT«²?«¸ªÎ«ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh_ct for i in 0...$game_party.actors.size actor = $game_party.actors[i] line_height = 120 / CTB::PARTY_SIZE actor_y = i * line_height + 4 # CTª¬?«¿«óªËªÊªÃª¿ªÈª­ªÎ«²?«¸ªÎßä ct_color_full = CTB::COLOR_FULL # CT«²?«¸ªÎß䣨ñ§Ó®£© ct_color_start = actor.full_ct ? ct_color_full : CTB::COLOR_LEFT # CT«²?«¸ªÎß䣨éÓÓ®£© ct_color_end = actor.full_ct ? ct_color_full : CTB::COLOR_RIGHT draw_meter(actor.now_ct, actor.max_ct, 344, actor_y+14, 100, 8, ct_color_start, ct_color_end) end end #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- def update super end #-------------------------------------------------------------------------- # ¡Ü HP ªÎÙÚ? # actor : «¢«¯«¿? # x : ÙÚ?à» X ñ¨øö # y : ÙÚ?à» Y ñ¨øö # width : ÙÚ?໪Îøë #-------------------------------------------------------------------------- def draw_actor_hp(actor, x, y, width = 144) # Ùþí®Öª "HP" ªòÙÚ? self.contents.font.color = system_color self.contents.font.size = 16 self.contents.draw_text(x, y+2, 32, 32, $data_system.words.hp) self.contents.font.color = normal_color self.contents.font.size = CTB::HPSP_FONT_SIZE if CTB::MAX_DRAW # MaxHP ªòÙÚ? self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2) text_size = self.contents.text_size(actor.maxhp.to_s) text_x = x + width - text_size.width - 12 self.contents.draw_text(text_x, y, 12, 32, "/", 1) # HP ªòÙÚ? self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color text_x = text_x - text_size.width self.contents.draw_text(text_x, y, text_size.width, 32, actor.hp.to_s, 2) else self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.draw_text(x, y, width, 32, actor.hp.to_s, 2) end end #-------------------------------------------------------------------------- # ¡Ü SP ªÎÙÚ? # actor : «¢«¯«¿? # x : ÙÚ?à» X ñ¨øö # y : ÙÚ?à» Y ñ¨øö # width : ÙÚ?໪Îøë #-------------------------------------------------------------------------- def draw_actor_sp(actor, x, y, width = 144) # Ùþí®Öª "SP" ªòÙÚ? self.contents.font.color = system_color self.contents.font.size = 16 self.contents.draw_text(x, y+2, 32, 32, $data_system.words.sp) self.contents.font.color = normal_color self.contents.font.size = CTB::HPSP_FONT_SIZE if CTB::MAX_DRAW # MaxSP ªòÙÚ? self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2) text_size = self.contents.text_size(actor.maxsp.to_s) text_x = x + width - text_size.width - 12 self.contents.draw_text(text_x, y, 12, 32, "/", 1) # SP ªòÙÚ? self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color text_x = text_x - text_size.width self.contents.draw_text(text_x, y, text_size.width, 32, actor.sp.to_s, 2) else self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.draw_text(x, y, width, 32, actor.sp.to_s, 2) end end end #============================================================================== # ¡à Window_BattleStatus_enemy #============================================================================== class Window_BattleStatus_enemy < Window_Base #-------------------------------------------------------------------------- # ¡Û «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- def initialize super(0, 320, 160, 160) self.contents = Bitmap.new(width - 32, height - 32) refresh end #-------------------------------------------------------------------------- # ¡Û «ê«Õ«ì«Ã«·«å #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = normal_color self.contents.font.size = CTB::ENEMY_FONT_SIZE if $game_troop.enemies != nil # «¨«Í«ß?ªÎÙ£îñªòÙÚ? enemy_index = 0 for i in 0...$game_troop.enemies.size enemy = $game_troop.enemies[i] if enemy.hp != 0 enemy_y = enemy_index * (CTB::ENEMY_FONT_SIZE+6) + 4 self.contents.draw_text(4, enemy_y, 160, 20, enemy.name) enemy_index += 1 end end end end end #============================================================================== # ¡á Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ¡Û «²?«¸ªòÙÚ? #-------------------------------------------------------------------------- def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color ) self.contents.fill_rect(x, y, width, height, CTB::FRAME_COLOR) self.contents.fill_rect(x+CTB::FRAME_BORDER, y+CTB::FRAME_BORDER, width-CTB::FRAME_BORDER*2, height-CTB::FRAME_BORDER*2, CTB::BACK_COLOR) now = now > max ? max : now percentage = max != 0 ? (width-2) * now / max.to_f : 0 if start_color == end_color self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color) else for i in 1..percentage r = start_color.red + (end_color.red - start_color.red) / percentage * i g = start_color.green + (end_color.green - start_color.green) / percentage * i b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a)) end end end end #============================================================================== # ¡á Game_Battler #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ¡Ü ÍëËÒ«¤«ó«¹«¿«ó«¹?? #-------------------------------------------------------------------------- attr_accessor :max_ct attr_accessor :now_ct attr_accessor :full_ct attr_accessor :countup #-------------------------------------------------------------------------- # ¡Ü «ª«Ö«¸«§«¯«ÈôøÑ¢ûù #-------------------------------------------------------------------------- alias ctb_initialize initialize def initialize ctb_initialize @max_ct = 0 @now_ct = 0 @full_ct = false @countup = true end end #============================================================================== # ¡á Sprite_Battler #============================================================================== class Sprite_Battler < RPG::Sprite #-------------------------------------------------------------------------- # ¡Ü «Õ«ì?«àÌÚãæ #-------------------------------------------------------------------------- alias ctb_update update def update ctb_update if @battler != nil if @battler.full_ct # CTª¬×¶ªÞªÃª¿«Ð«È«é?ªÎßäðàªò?ûùªµª»ªë fullct_color = CTB::FULL_CT_COLOR self.tone = fullct_color else fullct_color = Tone.new(0,0,0) self.tone = fullct_color end end end end