|
|||||||
![]() |
|
|
Herramientas | Desplegado |
|
#1
|
||||
|
||||
|
Bueno, en este tema, iremos recopilando todos los scripts que hay hasta el momento, Qu les parece?
Bueno, aqu los traigo mi primer aporte: Descripcin de las secciones:
Spoiler
Custom Battle Systems: Son sistemas completos de batalla que sustituyen al sistema por defecto.
Custom Battle Add-ons: Son caractersticas que se pueden aadir al sistema de batalla por defecto y, en muchas ocasiones, a algn Custom Battle System. Custom Menu Systems: Son sistemas completos de men que sustituyen al sistema por defecto Custom Menu Add-ons: Son caractersticas que se pueden aadir al sistema de men por defecto y, a veces, a algn Custom Menu System. Custom Movement Systems: Son scripts que permiten cambiar la forma de moverse del chara (8 direcciones, pixel a pixel, etc) Custom Map Add-ons: Son caractersticas que pueden ser visualizadas en el mapa, como por ejemplo efectos nuevos de clima. Custom Message Systems: Son sistemas de mensajes que aaden muchas funciones al sistema por defecto. Mdulos: Son scripts especiales que son necesarios para que otros scripts funcionen correctamente. Minijuegos: Son scripts que permiten jugar al tetris, la ruleta, etc. Titles/Game Overs: Son scripts que permiten cambiar o la pantalla de ttulo (Title) o la de fin de juego (Game Over). Item Systems & Add-ons: Son scripts que cambian la forma de actuar de todos o algunos objetos. Skill Systems & Add-ons: Son scripts que cambian la forma de actuar de todas o algunas habilidades. Enemy/Troop: Son scripts que sustituyen o aaden caractersticas al comportamiento de los enemigos o las tropas de enemigos. Actor/Party: Son scripts que sustituyen o aaden caractersticas al comportamiento del protagonista o de su grupo de aliados. Otros: Son scripts que cuya descripcin no concuerda con ninguna de las anteriores, por ejemplo sistemas independientes y scripts avanzados. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Sistemas de batallas: 1-Nombre: Cogwheel Active Time Battle Autor: Cogwheel Script:
Spoiler
DESCRIPCIN:
Una Sistema de Batalla, con varias funciones, tales como Camara, que se mueve dependiendo a el enemigo a atacar, barra de turnos, entre otros, en mi opinin es muy bueno para usar una de tipo Default. Script:
[codebox] # http://members.jcom.home.ne.jp/cogwheel/ class Scene_Battle attr_reader :status_window attr_reader :spriteset attr_reader :scroll_time attr_reader :zoom_rate attr_reader :drive attr_accessor :force attr_accessor :camera def atb_setup speed = 150 @active = 1 @action = 2 @anime_wait = false @damage_wait = 10 @after_wait = [80, 0] @enemy_speed = 40 @force = 2 @drive = true @scroll_time = 15 @zoom_rate = [0.2, 1.0] @help_time = 40 @escape == false @camera = nil @max = 0 @turn_cnt = 0 @help_wait = 0 @action_battlers = [] @synthe = [] @spell_p = {} @spell_e = {} @command_a = false @command = [] @party = false for battler in $game_party.actors + $game_troop.enemies spell_reset(battler) battler.at = battler.agi * rand(speed / 2) battler.damage_pop = {} battler.damage = {} battler.damage_sp = {} battler.critical = {} battler.recover_hp = {} battler.recover_sp = {} battler.state_p = {} battler.state_m = {} battler.animation = [] if battler.is_a?(Game_Actor) @max += battler.agi end end @max *= speed @max /= $game_party.actors.size for battler in $game_party.actors + $game_troop.enemies battler.atp = 100 * battler.at / @max end end def fullat_se Audio.se_play("Audio/SE/033-switch02", 80, 100) end def levelup_se Audio.se_play("Audio/SE/056-Right02", 80, 100) end def skill_se Audio.se_play("Audio/SE/056-Right02", 80, 150) end end class Window_Base < Window def draw_actor_atg(actor, x, y, width = 144) if @at_gauge == nil # plus_x:XÀ•W‚̈ʒu•â³ rate_x:XÀ•W‚̈ʒu•â³(%) plus_y:YÀ•W‚̈ʒu•â³ # plus_width:•‚̕Ⳡrate_width:•‚Ì•â³(%) height:c• # align1:•`‰æ'^'C'v1 0:¶‹l‚ß 1:’ ‰›‘µ‚¦ 2:‰E‹l‚ß # align2:•`‰æ'^'C'v2 0:ã‹l‚ß 1:’ ‰›‘µ‚¦ 2:‰º‹l‚ß # align3:'Q['W'^'C'v 0:¶‹l‚ß 1:‰E‹l‚ß @plus_x = 0 @rate_x = 0 @plus_y = 16 @plus_width = 0 @rate_width = 100 @width = @plus_width + width * @rate_width / 100 @height = 16 @align1 = 0 @align2 = 1 @align3 = 0 # 'O'‰'f['V'‡'“Ý’è grade1:‹ó'Q['W grade2:ŽÀ'Q['W # (0:‰¡‚É'O'‰'f['V'‡'“ 1:c‚É'O'‰'f['V'‡'“ 2:ŽÎ‚ß‚É'O'‰'f['V'‡'“j grade1 = 1 grade2 = 0 # FÝ’èBcolor1:Å O˜gCcolor2:’ ˜g # color3:‹ó˜g'_['N'J'‰[Ccolor4:‹ó˜g'‰'C'g'J'‰[ color1 = Color.new(0, 0, 0) color2 = Color.new(255, 255, 192) color3 = Color.new(0, 0, 0, 192) color4 = Color.new(0, 0, 64, 192) # 'Q['W‚ÌFÝ’è # ’ÊŽž‚ÌFÝ’è color5 = Color.new(0, 64, 80) color6 = Color.new(0, 128, 160) # 'Q['W‚ªMAX‚ÌŽž‚ÌFÝ’è color7 = Color.new(80, 0, 0) color8 = Color.new(240, 0, 0) # ˜A'g'X'L'‹Žg"pŽž‚ÌFÝ’è color9 = Color.new(80, 64, 32) color10 = Color.new(240, 192, 96) # 'X'L'‹‰r¥Žž‚ÌFÝ’è color11 = Color.new(80, 0, 64) color12 = Color.new(240, 0, 192) # 'Q['W‚Ì•`‰æ gauge_rect_at(@width, @height, @align3, color1, color2, color3, color4, color5, color6, color7, color8, color9, color10, color11, color12, grade1, grade2) end # •Ï”at‚É•`‰æ‚·‚é'Q['W‚Ì•‚ð‘ã“ü if actor.rtp == 0 at = (width + @plus_width) * actor.atp * @rate_width / 10000 else at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100 end if at > width at = width end # 'Q['W‚̶‹lE’ ‰›\‚¦“™‚̕Ⳡcase @align1 when 1 x += (@rect_width - width) / 2 when 2 x += @rect_width - width end case @align2 when 1 y -= @height / 2 when 2 y -= @height end self.contents.blt(x + @plus_x + width * @rate_x / 100, y + @plus_y, @at_gauge, Rect.new(0, 0, @width, @height)) if @align3 == 0 rect_x = 0 else x += @width - at - 1 rect_x = @width - at - 1 end # 'Q['W‚ÌFÝ’è if at == width # MAXŽž‚Ì'Q['W•`‰æ self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y, @at_gauge, Rect.new(rect_x, @height * 2, at, @height)) else if actor.rtp == 0 # ’ÊŽž‚Ì'Q['W•`‰æ self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y, @at_gauge, Rect.new(rect_x, @height, at, @height)) else if actor.spell == true # ˜A'g'X'L'‹Žg"pŽž‚Ì'Q['W•`‰æ self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y, @at_gauge, Rect.new(rect_x, @height * 3, at, @height)) else # 'X'L'‹‰r¥Žž‚Ì'Q['W•`‰æ self.contents.blt(x + @plus_x + @width * @rate_x / 100, y + @plus_y, @at_gauge, Rect.new(rect_x, @height * 4, at, @height)) end end end end end #================================================= ============================= # ¡ Scene_Battle (•ª „’è‹` 1) #------------------------------------------------------------------------------ # @'o'g'‹‰æ"ʂ̈"‚ðs‚ 'N'‰'X‚Å‚·B #================================================= ============================= class Scene_Battle #-------------------------------------------------------------------------- # " ''C'“ˆ" #-------------------------------------------------------------------------- def main # “¬"p‚Ì eŽˆêŽž'f['^‚ð‰ ú‰» $game_temp.in_battle = true $game_temp.battle_turn = 0 $game_temp.battle_event_flags.clear $game_temp.battle_abort = false $game_temp.battle_main_phase = false $game_temp.battleback_name = $game_map.battleback_name $game_temp.forcing_battler = nil # 'o'g'‹'C'x'“'g"p'C'“'^'v' '^‚ð‰ ú‰» $game_system.battle_interpreter.setup(nil, 0) # 'g'‹['v‚ð€”õ @troop_id = $game_temp.battle_troop_id $game_troop.setup(@troop_id) atb_setup # 'A'N'^['R'}'“'h'E'B'“'h'E‚ðì¬ s1 = $data_system.words.attack s2 = $data_system.words.skill s3 = $data_system.words.guard s4 = $data_system.words.item @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4]) @actor_command_window.y = 160 @actor_command_window.back_opacity = 160 @actor_command_window.active = false @actor_command_window.visible = false # ‚»‚Ì‘¼‚Ì'E'B'“'h'E‚ðì¬ @party_command_window = Window_PartyCommand.new @help_window = Window_Help.new @help_window.back_opacity = 160 @help_window.visible = false @status_window = Window_BattleStatus.new @message_window = Window_Message.new # 'X'v'‰'C'g'Z'b'g‚ðì¬ @spriteset = Spriteset_Battle.new # 'E'F'C'g'J'E'“'g‚ð‰ ú‰» @wait_count = 0 # 'g'‰'“'W'V'‡'“ŽÀs if $data_system.battle_transition == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $data_system.battle_transition) end # 'v'''o'g'‹'t'F['Y JŽn start_phase1 # ''C'“'‹['v loop do # 'Q['€‰æ"Ê‚ðXV Graphics.update # “ü"Íî•ñ‚ðXV Input.update # 't''['€XV update # ‰æ"Ê‚ªØ‚è‘-‚‚Á‚½‚ç'‹['v‚ð’ ’f if $scene != self break end end # '}'b'v‚ð' 't'''b'V'… $game_map.refresh # 'g'‰'“'W'V'‡'“€”õ Graphics.freeze # 'E'B'“'h'E‚ð‰ð•ú @actor_command_window.dispose @party_command_window.dispose @help_window.dispose @status_window.dispose @message_window.dispose if @skill_window != nil @skill_window.dispose end if @item_window != nil @item_window.dispose end if @result_window != nil @result_window.dispose end # 'X'v'‰'C'g'Z'b'g‚ð‰ð•ú @spriteset.dispose # '^'C'g'‹‰æ"Ê‚ÉØ‚è‘-‚¦’ ‚Ìê‡ if $scene.is_a?(Scene_Title) # ‰æ"Ê‚ð't'F['h'A'E'g Graphics.transition Graphics.freeze end # “¬'e'X'g‚©‚ç'Q['€'I['o[‰æ"ÊˆÈ O‚ÉØ‚è‘-‚¦’ ‚Ìê‡ if $BTEST and not $scene.is_a?(Scene_Gameover) $scene = nil end end #-------------------------------------------------------------------------- # " Ÿ”s”»’è #-------------------------------------------------------------------------- def judge # ‘S"Å”»’肪^A‚Ü‚½‚Í'p['e'Bl”‚ª 0 l‚Ìê‡ if $game_party.all_dead? or $game_party.actors.size == 0 # ”s"k‰Â”\‚Ìê‡ if $game_temp.battle_can_lose # 'o'g'‹ JŽn‘O‚Ì BGM ‚É"ß‚· $game_system.bgm_play($game_temp.map_bgm) # 'o'g'‹I"¹ battle_end(2) # true ‚ð•"‚· return true end # 'Q['€'I['o['t'‰'O‚ð'Z'b'g $game_temp.gameover = true # true ‚ð•"‚· return true end # 'G'l'~[‚ª 1 ‘̂ł ‘¶Ý‚·‚ê‚Î false ‚ð•"‚· for enemy in $game_troop.enemies if enemy.exist? return false end end # 'A't'^['o'g'‹'t'F['Y JŽn (Ÿ"˜) start_phase5 # true ‚ð•"‚· return true end #-------------------------------------------------------------------------- # " 't''['€XV #-------------------------------------------------------------------------- def update # 'o'g'‹'C'x'“'gŽÀs’ ‚Ìê‡ if $game_system.battle_interpreter.running? if @command.size > 0 @command_a = false @command = [] command_delete end @status_window.at_refresh # 'C'“'^'v' '^‚ðXV $game_system.battle_interpreter.update # 'A'N'V'‡'“‚ð‹§‚³‚ê‚Ä‚ ¢‚é'o'g'‰[‚ª‘¶Ý‚µ‚È‚¢ê‡ if $game_temp.forcing_battler == nil # 'o'g'‹'C'x'“'g‚ÌŽÀs‚ªI‚ Á‚½ê‡ unless $game_system.battle_interpreter.running? # 'o'g'‹'C'x'“'g‚Ì'Z'b'g'A'b'v ðÄŽÀs @status_window.refresh setup_battle_event end end end # 'V'X'e'€ ('^'C'}[)A‰æ"Ê‚ðXV $game_system.update $game_screen.update # '^'C'}[‚ª 0 ‚ɂȂÁ‚½ê‡ if $game_system.timer_working and $game_system.timer == 0 # 'o'g'‹’ ’f $game_temp.battle_abort = true end # 'E'B'“'h'E‚ðXV @help_window.update @party_command_window.update @actor_command_window.update @status_window.update @message_window.update # 'X'v'‰'C'g'Z'b'g‚ðXV @spriteset.update # 'g'‰'“'W'V'‡'“ˆ"’ ‚Ìê‡ if $game_temp.transition_processing # 'g'‰'“'W'V'‡'“ˆ"’ 't'‰'O‚ð'N' 'A $game_temp.transition_processing = false # 'g'‰'“'W'V'‡'“ŽÀs if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # ''b'Z['W'E'B'“'h'E•\ަ’ ‚Ìê‡ if $game_temp.message_window_showing return end # 'Q['€'I['o[‚Ìê‡ if $game_temp.gameover # 'Q['€'I['o[‰æ"Ê‚ÉØ‚è‘-‚¦ $scene = Scene_Gameover.new return end # '^'C'g'‹‰æ"Ê‚É"ß‚·ê‡ if $game_temp.to_title # '^'C'g'‹‰æ"Ê‚ÉØ‚è‘-‚¦ $scene = Scene_Title.new return end # 'o'g'‹’ ’f‚Ìê‡ if $game_temp.battle_abort # 'o'g'‹ JŽn‘O‚Ì BGM ‚É"ß‚· $game_system.bgm_play($game_temp.map_bgm) # 'o'g'‹I"¹ battle_end(1) return end # 'w'‹'v'E'B'“'h'E•\ަ’ ‚Ìê‡ if @help_wait > 0 @help_wait -= 1 if @help_wait == 0 # 'w'‹'v'E'B'“'h'E‚ð‰B‚· @help_window.visible = false end end # 't'F['Y‚É‚æ‚Á‚Ä•ª ò case @phase when 0 # AT'Q['WXV't'F['Y if anime_wait_return update_phase0 end when 1 # 'v'''o'g'‹'t'F['Y update_phase1 return when 2 # 'p['e'B'R'}'“'h't'F['Y update_phase2 return when 5 # 'A't'^['o'g'‹'t'F['Y update_phase5 return end if $scene != self return end if @phase == 0 if @command.size != 0 # 'A'N'^['R'}'“'h't'F['Y if @command_a == false start_phase3 end update_phase3 end # 'E'F'C'g’ ‚Ìê‡ if @wait_count > 0 # 'E'F'C'g'J'E'“'g‚ð'¸‚ç‚· @wait_count -= 1 return end update_phase4 end end #================================================= ============================= # ¡ Scene_Battle (•ª „’è‹` 2) #------------------------------------------------------------------------------ # @'o'g'‹‰æ"ʂ̈"‚ðs‚ 'N'‰'X‚Å‚·B #================================================= ============================= #-------------------------------------------------------------------------- # " 't''['€XV (AT'Q['WXV't'F['Y) #-------------------------------------------------------------------------- def update_phase0 if $game_temp.battle_turn == 0 $game_temp.battle_turn = 1 end # B '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if @command_a == false and @party == false if Input.trigger?(Input::B) # 'L'''“'Z'‹ SE ‚ð‰‰‘t $game_system.se_play($data_system.cancel_se) @party = true end end if @party == true and ((@action > 0 and @action_battlers.empty?) or (@action == 0 and (@action_battlers.empty? or @action_battlers[0].phase == 1))) # 'p['e'B'R'}'“'h't'F['Y‚- start_phase2 return end # AT'Q['W‘‰Áˆ" cnt = 0 for battler in $game_party.actors + $game_troop.enemies active?(battler) if battler.rtp == 0 if battler.at >= @max if battler.is_a?(Game_Actor) if battler.inputable? unless @action_battlers.include?(battler) or @command.include?(battler) or @escape == true if battler.current_action.forcing fullat_se force_action(battler) action_start(battler) else fullat_se @command.push(battler) end end else unless @action_battlers.include?(battler) or battler == @command[0] battler.current_action.clear if @command.include?(battler) @command.delete(battler) else if battler.movable? fullat_se end end action_start(battler) end end else unless @action_battlers.include?(battler) if battler.current_action.forcing force_action(battler) action_start(battler) else if @enemy_speed != 0 if rand(@enemy_speed) == 0 number = cnt - $game_party.actors.size enemy_action(number) end else number = cnt - $game_party.actors.size enemy_action(number) end end end end else battler.at += battler.agi if battler.guarding? battler.at += battler.agi end if battler.movable? battler.atp = 100 * battler.at / @max end end else if battler.rt >= battler.rtp speller = synthe?(battler) if speller != nil battler = speller[0] end unless @action_battlers.include?(battler) if battler.is_a?(Game_Actor) fullat_se end battler.rt = battler.rtp action_start(battler) end else battler.rt += battler.agi speller = synthe?(battler) if speller != nil for spell in speller if spell != battler spell.rt += battler.agi end end end end end cnt += 1 end # AT'Q['W‚ð' 't'''b'V'… @status_window.at_refresh # “¦‘"ˆ" if @escape == true and ((@action > 0 and @action_battlers.empty?) or (@action == 0 and (@action_battlers.empty? or @action_battlers[0].phase == 1))) temp = false for battler in $game_party.actors if battler.inputable? temp = true end end if temp == true for battler in $game_party.actors if battler.at < @max and battler.inputable? temp = false break end end if temp == true @escape = false for battler in $game_party.actors battler.at %= @max end $game_temp.battle_main_phase = false update_phase2_escape end end end end #-------------------------------------------------------------------------- # " 'p['e'B'R'}'“'h't'F['Y JŽn #-------------------------------------------------------------------------- def start_phase2 # 't'F['Y 2 ‚ɈÚs @phase = 2 @party = false # 'p['e'B'R'}'“'h'E'B'“'h'E‚ð"L'ø ‰» @party_command_window.active = true @party_command_window.visible = true # 'A'N'^[‚ð”ñ‘I‘ðó‘"‚ÉÝ’è @actor_index = -1 # 'A'N'^['R'}'“'h'E'B'“'h'E‚ð"³'ø‰» @actor_command_window.active = false @actor_command_window.visible = false if @command.size != 0 # 'A'N'^[‚Ì"¾"Å'G't'F'N'g OFF if @active_actor != nil @active_actor.blink = false end end # 'J''‰'Z'b'g @camera == "party" @spriteset.screen_target(0, 0, 1) # ''C'“'t'F['Y't'‰'O‚ð'N' 'A $game_temp.battle_main_phase = false end #-------------------------------------------------------------------------- # " 't''['€XV ('p['e'B'R'}'“'h't'F['Y) #-------------------------------------------------------------------------- def update_phase2 # C '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::C) # 'p['e'B'R'}'“'h'E'B'“'h'E‚Ì'J['\'‹ˆÊ’u‚Å•ª ò case @party_command_window.index when 0 # ‚¤ # 'p['e'B'R'}'“'h'E'B'“'h'E‚ð"³' ‰» @party_command_window.active = false @party_command_window.visible = false # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) @escape = false @phase = 0 if $game_temp.battle_turn == 0 $game_temp.battle_turn = 1 end if @command_a == true # 'A'N'^['R'}'“'h't'F['Y JŽn start_phase3 else $game_temp.battle_main_phase = true end when 1 # “¦‚°‚é # “¦‘"‰Â”\‚ł͂Ȃ¢ê‡ if $game_temp.battle_can_escape == false # 'u'U[ SE ‚ð‰‰‘t $game_system.se_play($data_system.buzzer_se) return end # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) @phase = 0 # 'p['e'B'R'}'“'h'E'B'“'h'E‚ð"³' ‰» @party_command_window.active = false @party_command_window.visible = false $game_temp.battle_main_phase = true if $game_temp.battle_turn == 0 update_phase2_escape $game_temp.battle_turn = 1 for battler in $game_party.actors battler.at -= @max / 2 end return end # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) @escape = true for battler in $game_party.actors @command_a = false @command.delete(battler) @action_battlers.delete(battler) skill_reset(battler) end end return end end #-------------------------------------------------------------------------- # " 't''['€XV ('p['e'B'R'}'“'h't'F['Y : “¦‚°‚é) #-------------------------------------------------------------------------- def update_phase2_escape # 'G'l'~[‚Ì‘f‘‚³•½‹Ï’l‚ð'vŽZ enemies_agi = 0 enemies_number = 0 for enemy in $game_troop.enemies if enemy.exist? enemies_agi += enemy.agi enemies_number += 1 end end if enemies_number > 0 enemies_agi /= enemies_number end # 'A'N'^[‚Ì‘f‘‚³•½‹Ï’l‚ð'vŽZ actors_agi = 0 actors_number = 0 for actor in $game_party.actors if actor.exist? actors_agi += actor.agi actors_number += 1 end end if actors_number > 0 actors_agi /= actors_number end # “¦‘"¬'÷”»’è success = rand(100) < 50 * actors_agi / enemies_agi # “¦‘"¬'÷‚Ìê‡ if success # “¦‘" SE ‚ð‰‰‘t $game_system.se_play($data_system.escape_se) # 'o'g'‹ JŽn‘O‚Ì BGM ‚É"ß‚· $game_system.bgm_play($game_temp.map_bgm) # 'o'g'‹I"¹ battle_end(1) # “¦‘"ޏ”s‚Ìê‡ else @help_wait = @help_time # 'p['e'B‘Sˆõ‚Ì'A'N'V'‡'“‚ð'N' 'A $game_party.clear_actions # ''C'“'t'F['Y JŽn start_phase4 end end #-------------------------------------------------------------------------- # " 'A't'^['o'g'‹'t'F['Y JŽn #-------------------------------------------------------------------------- def start_phase5 # 't'F['Y 5 ‚ɈÚs @phase = 5 # 'o'g'‹I"¹ ME ‚ð‰‰‘t $game_system.me_play($game_system.battle_end_me) # 'o'g'‹ JŽn‘O‚Ì BGM ‚É"ß‚· $game_system.bgm_play($game_temp.map_bgm) # EXPA'S['‹'hA'g'''W''[‚ð‰ ú‰» exp = 0 gold = 0 treasures = [] if @active_actor != nil @active_actor.blink = false end # ''C'“'t'F['Y't'‰'O‚ð'Z'b'g $game_temp.battle_main_phase = true # 'p['e'B'R'}'“'h'E'B'“'h'E‚ð"³' ‰» @party_command_window.active = false @party_command_window.visible = false # 'A'N'^['R'}'“'h'E'B'“'h'E‚ð"³'ø‰» @actor_command_window.active = false @actor_command_window.visible = false if @skill_window != nil # 'X'L'‹'E'B'“'h'E‚ð‰ð•ú @skill_window.dispose @skill_window = nil end if @item_window != nil # 'A'C'e'€'E'B'“'h'E‚ð‰ð•ú @item_window.dispose @item_window = nil end # 'w'‹'v'E'B'“'h'E‚ð‰B‚· @help_window.visible = false # '‹['v for enemy in $game_troop.enemies # 'G'l'~[‚ª‰B‚êó‘"‚łȂ¢ê‡ unless enemy.hidden # l“¾ EXPA'S['‹'h‚ð’ljÁ exp += enemy.exp gold += enemy.gold # 'g'''W''[o'»”»’è if rand(100) < enemy.treasure_prob if enemy.item_id > 0 treasures.push($data_items[enemy.item_id]) end if enemy.weapon_id > 0 treasures.push($data_weapons[enemy.weapon_id]) end if enemy.armor_id > 0 treasures.push($data_armors[enemy.armor_id]) end end end end # 'g'''W''[‚Ì”‚ð 6 '‚܂łÉ'À’è treasures = treasures[0..5] # EXP l“¾ for i in 0...$game_party.actors.size actor = $game_party.actors[i] if actor.cant_get_exp? == false last_level = actor.level actor.exp += exp if actor.level > last_level @status_window.level_up(i) actor.damage[[actor, -1]] = "¡Sube Nivel!" actor.up_level = actor.level - last_level end end end # 'S['‹'h l“¾ $game_party.gain_gold(gold) # 'g'''W''[ l“¾ for item in treasures case item when RPG::Item $game_party.gain_item(item.id, 1) when RPG::Weapon $game_party.gain_weapon(item.id, 1) when RPG::Armor $game_party.gain_armor(item.id, 1) end end # 'o'g'‹' 'U'‹'g'E'B'“'h'E‚ðì¬ @result_window = Window_BattleResult.new(exp, gold, treasures) # 'E'F'C'g'J'E'“'g‚ðÝ’è @phase5_wait_count = 100 end #-------------------------------------------------------------------------- # " 't''['€XV ('A't'^['o'g'‹'t'F['Y) #-------------------------------------------------------------------------- def update_phase5 # 'E'F'C'g'J'E'“'g‚ª 0 ‚æ‚è‘å‚«‚¢ê‡ if @phase5_wait_count > 0 # 'E'F'C'g'J'E'“'g‚ð'¸‚ç‚· @phase5_wait_count -= 1 # 'E'F'C'g'J'E'“'g‚ª 0 ‚ɂȂÁ‚½ê‡ if @phase5_wait_count == 0 # ' 'U'‹'g'E'B'“'h'E‚ð•\ަ @result_window.visible = true # ''C'“'t'F['Y't'‰'O‚ð'N' 'A $game_temp.battle_main_phase = false # 'X'e['^'X'E'B'“'h'E‚ð' 't'''b'V'… @status_window.refresh for actor in $game_party.actors if actor.damage.include?([actor, 0]) @phase5_wait_count = 20 actor.damage_pop[[actor, 0]] = true end if actor.damage.include?([actor, -1]) @phase5_wait_count = 20 actor.damage_pop[[actor, -1]] = true for level in actor.level - actor.up_level + 1..actor.level for skill in $data_classes[actor.class_id].learnings if level == skill.level and not actor.skill_learn?(skill.id) actor.damage[[actor, 0]] = "Nueva Habilidad" break end end end end end end return end # C '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::C) # 'o'g'‹I"¹ battle_end(0) end end #================================================= ============================= # ¡ Scene_Battle (•ª „’è‹` 3) #------------------------------------------------------------------------------ # @'o'g'‹‰æ"ʂ̈"‚ðs‚ 'N'‰'X‚Å‚·B #================================================= ============================= #-------------------------------------------------------------------------- # " 'A'N'^['R'}'“'h't'F['Y JŽn #-------------------------------------------------------------------------- def start_phase3 if victory? return end # ''C'“'t'F['Y't'‰'O‚ð'N' 'A $game_temp.battle_main_phase = false @command_a = true @active_actor = @command[0] cnt = 0 for actor in $game_party.actors if actor == @active_actor @actor_index = cnt end cnt += 1 end @active_actor.blink = true unless @active_actor.inputable? @active_actor.current_action.clear phase3_next_actor return end phase3_setup_command_window # 'J''‰‚ÌÝ’è @camera = "command" plus = ($game_party.actors.size - 1) / 2.0 - @actor_index y = [(plus.abs - 1.5) * 10 , 0].min @spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002) end #-------------------------------------------------------------------------- # " 'A'N'^[‚Ì'R'}'“'h“ü"ÍI"¹ #-------------------------------------------------------------------------- def phase3_next_actor @command.shift @command_a = false # ''C'“'t'F['Y't'‰'O‚ð'Z'b'g $game_temp.battle_main_phase = true # 'A'N'^['R'}'“'h'E'B'“'h'E‚ð"³'ø‰» @actor_command_window.active = false @actor_command_window.visible = false # 'A'N'^[‚Ì"¾"Å'G't'F'N'g OFF if @active_actor != nil @active_actor.blink = false end action_start(@active_actor) # 'J''‰‚ð'³‚É"ß‚· if @camera == "command" @spriteset.screen_target(0, 0, 1) end return end #-------------------------------------------------------------------------- # " 'A'N'^['R'}'“'h'E'B'“'h'E‚Ì'Z'b'g'A' b'v #-------------------------------------------------------------------------- def phase3_setup_command_window # 'p['e'B'R'}'“'h'E'B'“'h'E‚ð"³' ‰» @party_command_window.active = false @party_command_window.visible = false # 'A'N'^['R'}'“'h'E'B'“'h'E‚ð"L'ø‰» @actor_command_window.active = true @actor_command_window.visible = true # 'A'N'^['R'}'“'h'E'B'“'h'E‚̈ʒu‚ð Ý’è @actor_command_window.x = @actor_index * 160 + (4 - $game_party.actors.size) * 80 # 'C'“'f'b'N'X‚ð 0 ‚ÉÝ’è @actor_command_window.index = 0 end #-------------------------------------------------------------------------- # " 'G'l'~['A'N'V'‡'“ì¬ #-------------------------------------------------------------------------- def enemy_action(number) enemy = $game_troop.enemies[number] unless enemy.current_action.forcing enemy.make_action end action_start(enemy) end #-------------------------------------------------------------------------- # " 't''['€XV ('A'N'^['R'}'“'h't'F['Y) #-------------------------------------------------------------------------- def update_phase3 if victory? and @command_a command_delete @command.push(@active_actor) return end # 'G'l'~['A'[‚ª"L'ø‚Ìê‡ if @enemy_arrow != nil update_phase3_enemy_select # 'A'N'^['A'[‚ª"L'ø‚Ìê‡ elsif @actor_arrow != nil update_phase3_actor_select # 'X'L'‹'E'B'“'h'E‚ª"L'ø‚Ìê ‡ elsif @skill_window != nil update_phase3_skill_select # 'A'C'e'€'E'B'“'h'E‚ª"L'ø‚Ì ê‡ elsif @item_window != nil update_phase3_item_select # 'A'N'^['R'}'“'h'E'B'“'h'E‚ª"L'ø‚Ì ê‡ elsif @actor_command_window.active update_phase3_basic_command end end #-------------------------------------------------------------------------- # " 't''['€XV ('A'N'^['R'}'“'h't'F['Y : î"{'R'}'“'h) #-------------------------------------------------------------------------- def update_phase3_basic_command unless @active_actor.inputable? @active_actor.current_action.clear phase3_next_actor return end # B '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::B) and @party == false # 'L'''“'Z'‹ SE ‚ð‰‰‘t $game_system.se_play($data_system.cancel_se) @party = true end if @party == true and ((@action > 0 and @action_battlers.empty?) or (@action == 0 and (@action_battlers.empty? or @action_battlers[0].phase == 1))) # 'p['e'B'R'}'“'h't'F['Y‚- start_phase2 return end # C '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::C) @party = false # 'A'N'^['R'}'“'h'E'B'“'h'E‚Ì'J['\'‹ˆÊ’u‚Å•ª ò case @actor_command_window.index when 0 # U'‚ # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) # 'G'l'~[‚Ì‘I‘ð‚ð JŽn start_enemy_select when 1 # 'X'L'‹ # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) # 'X'L'‹‚Ì‘I‘ð‚ð JŽn start_skill_select when 2 # "h'ä # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) # 'A'N'V'‡'“‚ðÝ’è @active_actor.current_action.kind = 0 @active_actor.current_action.basic = 1 # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor when 3 # 'A'C'e'€ # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) # 'A'C'e'€‚Ì‘I‘ð‚ð JŽn start_item_select end return end # 'L'''‰'`'F'“'W if @command.size > 1 # R '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::R) $game_system.se_play($data_system.cursor_se) @party = false # 'A'N'^[‚Ì"¾"Å'G't'F'N'g OFF if @active_actor != nil @active_actor.blink = false end @command.push(@command[0]) @command.shift @command_a = false # V‚½‚È'R'}'“'h'E'B'“'h'E‚Ì "§‚¿ã‚° start_phase3 end # L '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @party = false # 'A'N'^[‚Ì"¾"Å'G't'F'N'g OFF if @active_actor != nil @active_actor.blink = false end @command.unshift(@command[@command.size - 1]) @command.delete_at(@command.size - 1) @command_a = false # V‚½‚È'R'}'“'h'E'B'“'h'E‚Ì "§‚¿ã‚° start_phase3 end # ‰E '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) @party = false # 'A'N'^[‚Ì"¾"Å'G't'F'N'g OFF if @active_actor != nil @active_actor.blink = false end actor = $game_party.actors[@actor_index] while actor == @command[0] or (not @command.include?(actor)) @actor_index += 1 @actor_index %= $game_party.actors.size actor = $game_party.actors[@actor_index] if actor == @command[0] break end end while actor != @command[0] @command.push(@command.shift) end @command_a = false # V‚½‚È'R'}'“'h'E'B'“'h'E‚Ì "§‚¿ã‚° start_phase3 end # ¶ '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::LEFT) $game_system.se_play($data_system.cursor_se) @party = false # 'A'N'^[‚Ì"¾"Å'G't'F'N'g OFF if @active_actor != nil @active_actor.blink = false end actor = $game_party.actors[@actor_index] while actor == @command[0] or (not @command.include?(actor)) @actor_index -= 1 @actor_index %= $game_party.actors.size actor = $game_party.actors[@actor_index] if actor == @command[0] break end end while actor != @command[0] @command.push(@command.shift) end @command_a = false # V‚½‚È'R'}'“'h'E'B'“'h'E‚Ì "§‚¿ã‚° start_phase3 end end end #-------------------------------------------------------------------------- # " 't''['€XV ('A'N'^['R'}'“'h't'F['Y : 'X'L'‹‘I‘ð) #-------------------------------------------------------------------------- def update_phase3_skill_select # 'R'}'“'h‘I‘ð’ ‚És“®•s”\‚ɂȂÁ‚½ê‡ unless @active_actor.inputable? @active_actor.current_action.clear command_delete # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor return end # 'X'L'‹'E'B'“'h'E‚ð‰ÂŽ‹ó‘ "‚É‚·‚é @skill_window.visible = true # 'X'L'‹'E'B'“'h'E‚ðXV @skill_window.update # B '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::B) # 'L'''“'Z'‹ SE ‚ð‰‰‘t $game_system.se_play($data_system.cancel_se) # 'X'L'‹‚Ì‘I‘ð‚ðI"¹ end_skill_select return end # C '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::C) # 'X'L'‹'E'B'“'h'E‚Å'»Ý‘I‘ð ‚³‚ê‚Ä‚¢‚é'f['^‚ðŽæ“¾ @skill = @skill_window.skill # Žg"p‚Å‚«‚È‚¢ê‡ if @skill == nil or not @active_actor.skill_can_use?(@skill.id) # 'u'U[ SE ‚ð‰‰‘t $game_system.se_play($data_system.buzzer_se) return end # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) # 'A'N'V'‡'“‚ðÝ’è @active_actor.current_action.skill_id = @skill.id # 'X'L'‹'E'B'“'h'E‚ð•s‰ÂŽ‹ ‘"‚É‚·‚é @skill_window.visible = false # 'ø‰Ê”͈͂ª“G’P‘Ì‚Ìê‡ if @skill.scope == 1 # 'G'l'~[‚Ì‘I‘ð‚ð JŽn start_enemy_select # 'ø‰Ê”͈͂ª"¡•û’P‘Ì‚Ì ‡ elsif @skill.scope == 3 or @skill.scope == 5 # 'A'N'^[‚Ì‘I‘ð‚ð JŽn start_actor_select # 'ø‰Ê”͈͂ª’P‘̂ł͂Ȃ ¢ê‡ else # 'A'N'V'‡'“‚ðÝ’è @active_actor.current_action.kind = 1 # 'X'L'‹‚Ì‘I‘ð‚ðI"¹ end_skill_select # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor end return end end #-------------------------------------------------------------------------- # " 't''['€XV ('A'N'^['R'}'“'h't'F['Y : 'A'C'e'€‘I‘ð) #-------------------------------------------------------------------------- def update_phase3_item_select # 'R'}'“'h‘I‘ð’ ‚És“®•s”\‚ɂȂÁ‚½ê‡ unless @active_actor.inputable? @active_actor.current_action.clear command_delete # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor return end # 'A'C'e'€'E'B'“'h'E‚ð‰ÂŽ‹ó ‘"‚É‚·‚é @item_window.visible = true # 'A'C'e'€'E'B'“'h'E‚ðXV @item_window.update # B '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::B) # 'L'''“'Z'‹ SE ‚ð‰‰‘t $game_system.se_play($data_system.cancel_se) # 'A'C'e'€‚Ì‘I‘ð‚ðI"¹ end_item_select return end # C '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::C) # 'A'C'e'€'E'B'“'h'E‚Å'»Ý‘I ð‚³‚ê‚Ä‚¢‚é'f['^‚ðŽæ“¾ @item = @item_window.item # Žg"p‚Å‚«‚È‚¢ê‡ unless $game_party.item_can_use?(@item.id) # 'u'U[ SE ‚ð‰‰‘t $game_system.se_play($data_system.buzzer_se) return end # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) # 'A'N'V'‡'“‚ðÝ’è @active_actor.current_action.item_id = @item.id # 'A'C'e'€'E'B'“'h'E‚ð•s‰ÂŽ‹ ó‘"‚É‚·‚é @item_window.visible = false # 'ø‰Ê”͈͂ª“G’P‘Ì‚Ìê‡ if @item.scope == 1 # 'G'l'~[‚Ì‘I‘ð‚ð JŽn start_enemy_select # 'ø‰Ê”͈͂ª"¡•û’P‘Ì‚Ì ‡ elsif @item.scope == 3 or @item.scope == 5 # 'A'N'^[‚Ì‘I‘ð‚ð JŽn start_actor_select # 'ø‰Ê”͈͂ª’P‘̂ł͂Ȃ ¢ê‡ else # 'A'N'V'‡'“‚ðÝ’è @active_actor.current_action.kind = 2 # 'A'C'e'€‚Ì‘I‘ð‚ðI"¹ end_item_select # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor end return end end #-------------------------------------------------------------------------- # " 't''['€XV ('A'N'^['R'}'“'h't'F['Y : 'G'l'~[‘I‘ð) #-------------------------------------------------------------------------- def update_phase3_enemy_select # 'R'}'“'h‘I‘ð’ ‚És“®•s”\‚ɂȂÁ‚½ê‡ unless @active_actor.inputable? # 'J''‰‚ð'³‚É"ß‚· if @camera == "select" @spriteset.screen_target(0, 0, 1) end @active_actor.current_action.clear command_delete # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor return end # 'G'l'~['A'[‚ðXV @enemy_arrow.update # B '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::B) # 'L'''“'Z'‹ SE ‚ð‰‰‘t $game_system.se_play($data_system.cancel_se) # 'J''‰‚ð'³‚É"ß‚· if @camera == "select" # 'J''‰‚ÌÝ’è @camera = "command" plus = ($game_party.actors.size - 1) / 2.0 - @actor_index y = [(plus.abs - 1.5) * 10 , 0].min @spriteset.screen_target(plus * 50, y, 1.0 + y * 0.002) end # 'G'l'~[‚Ì‘I‘ð‚ðI"¹ end_enemy_select return end # C '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::C) # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) # 'A'N'V'‡'“‚ðÝ’è @active_actor.current_action.kind = 0 @active_actor.current_action.basic = 0 @active_actor.current_action.target_index = @enemy_arrow.index # 'X'L'‹'E'B'“'h'E•\ަ’ ‚Ìê‡ if @skill_window != nil # 'A'N'V'‡'“‚ðÄÝ’è @active_actor.current_action.kind = 1 # 'X'L'‹‚Ì‘I‘ð‚ðI"¹ end_skill_select end # 'A'C'e'€'E'B'“'h'E•\ަ’ ‚Ìê‡ if @item_window != nil # 'A'N'V'‡'“‚ðÄÝ’è @active_actor.current_action.kind = 2 # 'A'C'e'€‚Ì‘I‘ð‚ðI"¹ end_item_select end # 'G'l'~[‚Ì‘I‘ð‚ðI"¹ end_enemy_select # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor end end #-------------------------------------------------------------------------- # " 't''['€XV ('A'N'^['R'}'“'h't'F['Y : 'A'N'^[‘I‘ð) #-------------------------------------------------------------------------- def update_phase3_actor_select # 'R'}'“'h‘I‘ð’ ‚És“®•s”\‚ɂȂÁ‚½ê‡ unless @active_actor.inputable? @active_actor.current_action.clear command_delete # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor return end # 'A'N'^['A'[‚ðXV @actor_arrow.update # B '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::B) # 'L'''“'Z'‹ SE ‚ð‰‰‘t $game_system.se_play($data_system.cancel_se) # 'A'N'^[‚Ì‘I‘ð‚ðI"¹ end_actor_select return end # C '{'^'“‚ª‰Ÿ‚³‚ê‚½ê‡ if Input.trigger?(Input::C) # 'ˆ’è SE ‚ð‰‰‘t $game_system.se_play($data_system.decision_se) # 'A'N'V'‡'“‚ðÝ’è @active_actor.current_action.kind = 0 @active_actor.current_action.basic = 0 @active_actor.current_action.target_index = @actor_arrow.index # 'A'N'^[‚Ì‘I‘ð‚ðI"¹ end_actor_select # 'X'L'‹'E'B'“'h'E•\ަ’ ‚Ìê‡ if @skill_window != nil # 'A'N'V'‡'“‚ðÄÝ’è @active_actor.current_action.kind = 1 # 'X'L'‹‚Ì‘I‘ð‚ðI"¹ end_skill_select end # 'A'C'e'€'E'B'“'h'E•\ަ’ ‚Ìê‡ if @item_window != nil # 'A'N'V'‡'“‚ðÄÝ’è @active_actor.current_action.kind = 2 # 'A'C'e'€‚Ì‘I‘ð‚ðI"¹ end_item_select end # ŽŸ‚Ì'A'N'^[‚Ì'R'}'“'h“ü"Í‚- phase3_next_actor end end #-------------------------------------------------------------------------- # " 'G'l'~[‘I‘ð JŽn #-------------------------------------------------------------------------- alias :start_enemy_select_rtab :start_enemy_select def start_enemy_select @camera = "select" for enemy in $game_troop.enemies if enemy.exist? zoom = 1 / enemy.zoom @spriteset.screen_target(enemy.attack_x(zoom) * 0.75, enemy.attack_y(zoom) * 0.75, zoom) break end end # 'I' 'W'i'‹‚̈" start_enemy_select_rtab end #-------------------------------------------------------------------------- # " 'G'l'~[‘I‘ðI"¹ #-------------------------------------------------------------------------- alias :end_enemy_select_rtab :end_enemy_select def end_enemy_select # 'I' 'W'i'‹‚̈" end_enemy_select_rtab if (@action == 0 and not @action_battlers.empty?) or (@camera == "select" and (@active_actor.current_action.kind != 0 or @active_actor.animation1_id != 0)) @spriteset.screen_target(0, 0, 1) end end #-------------------------------------------------------------------------- # " 'X'L'‹‘I‘ð JŽn #-------------------------------------------------------------------------- def start_skill_select # 'X'L'‹'E'B'“'h'E‚ðì¬ @skill_window = Window_Skill.new(@active_actor) # 'w'‹'v'E'B'“'h'E‚ð -˜A•t‚¯ @skill_window.help_window = @help_window # 'A'N'^['R'}'“'h'E'B'“'h'E‚ð"³'ø‰» @actor_command_window.active = false @actor_command_window.visible = false end #================================================= ============================= # ¡ Scene_Battle (•ª „’è‹` 4) #------------------------------------------------------------------------------ # @'o'g'‹‰æ"ʂ̈"‚ðs‚ 'N'‰'X‚Å‚·B #================================================= ============================= #-------------------------------------------------------------------------- # " ''C'“'t'F['Y JŽn #-------------------------------------------------------------------------- def start_phase4 $game_temp.battle_main_phase = true end #-------------------------------------------------------------------------- # " 't''['€XV (''C'“'t'F['Y) #-------------------------------------------------------------------------- def update_phase4 # 'A'N'V'‡'“‚ð‹§‚³‚ê‚Ä‚ ¢‚é'o'g'‰[‚ª‘¶Ý‚·‚éê‡ if $game_temp.forcing_battler != nil battler = $game_temp.forcing_battler if battler.current_action.forcing == false if @action_battlers.include?(battler) if @action > 0 or @action_battlers[0].phase == 1 @action_battlers.delete(battler) @action_battlers.push(battler) end if battler.phase == 1 battler.current_action.forcing = true force_action(battler) end else battler.current_action.forcing = true force_action(battler) action_start(battler) @action_battlers.delete(battler) @action_battlers.push(battler) end battler.at = @max battler.atp = 100 * battler.at / @max end end # action ‚ª1ˆÈã‚Ìê‡AˆêÄ‚És“ ®‚ð‹N‚±‚· for battler in @action_battlers.reverse # 'E'F'C'g’ ‚Ìê‡ if battler.wait > 0 # 'E'F'C'g'J'E'“'g‚ð'¸‚ç‚· battler.wait -= 1 break if @action == 0 next end unless fin? and battler.phase < 3 and not $game_system.battle_interpreter.running? action_phase(battler) end break if @action == 0 end # 'A'N'V'‡'“‚ð‹§‚³‚ê‚Ä‚ ¢‚é'o'g'‰[‚ª‘¶Ý‚µ‚È‚¢ê‡ if $game_temp.forcing_battler == nil # 'o'g'‹'C'x'“'g‚ð'Z'b'g'A'b'v setup_battle_event # 'o'g'‹'C'x'“'gŽÀs’ ‚Ìê‡ if $game_system.battle_interpreter.running? return end end # Ÿ”s‚ð'ˆ‚µ‚½Û‚̈" if fin? # ”s"kŽžAŽw’莞 "'E'F'C'g if $game_party.all_dead? and @after_wait[0] > 0 @after_wait[0] -= 1 return end # Ÿ"˜ŽžAŽw’莞 "'E'F'C'g if victory? and @after_wait[1] > 0 @after_wait[1] -= 1 return end # “¬‚ªI"¹‚µA‚©‚Â'A'N'^[‚ªs“®’¼‘O‚ÌꇂÍ'A'N'^ [‚Ìs“®‚ðÁ‹Ž for battler in @action_battlers.reverse if battler.phase < 3 and not $game_system.battle_interpreter.running? @action_battlers.delete(battler) end end # Ÿ”s”»’è if @action_battlers.empty? and not $game_system.battle_interpreter.running? judge end end end #-------------------------------------------------------------------------- # " 'A'N'V'‡'“XV (''C'“'t'F['Y) #-------------------------------------------------------------------------- def action_phase(battler) # action ‚ª 1 ‚Ìê‡A'o'g'‰[‚ªs“®’ ‚©‚Ç‚¤‚© m”F if @action == 1 and battler.phase <= 3 for target in battler.target speller = synthe?(target) if speller == nil # '^['Q'b'g‚ª’Ês“®’ ‚Ìê‡ if @action_battlers.include?(target) if target.phase > 2 return end end else # '^['Q'b'g‚ª˜A'g'X'L'‹”“®’ ‚Ìê‡ for spell in speller if @action_battlers.include?(spell) if spell.phase > 2 return end end end end end end case battler.phase when 1 update_phase4_step1(battler) when 2 update_phase4_step2(battler) when 3 update_phase4_step3(battler) when 4 update_phase4_step4(battler) when 5 update_phase4_step5(battler) when 6 update_phase4_step6(battler) end end #-------------------------------------------------------------------------- # " 't''['€XV (''C'“'t'F['Y 'X'e'b'v 1 : 'A'N'V'‡'“€”õ) #-------------------------------------------------------------------------- def update_phase4_step1(battler) # ‚·‚łɓ¬‚©‚ç O‚³‚ê‚Ä‚¢‚éê‡ if battler.index == nil @action_battlers.delete(battler) anime_wait_return return end speller = synthe?(battler) if speller == nil # '_'['WH‚ç‚¢’ ‚Ìê‡ unless battler.damage.empty? or @action > 2 return end # s“®‰Â”\‚©‚Ç‚¤‚©”»’è unless battler.movable? battler.phase = 6 return end else # '_'['WH‚ç‚¢’ ‚Ìê‡ for spell in speller unless spell.damage.empty? or @action > 2 return end # s“®‰Â”\‚©‚Ç‚¤‚©”»’è unless spell.movable? battler.phase = 6 return end end end # 'X'L'‹Žg"pŽžA‰r¥Žž "Ý’è # ‹§'A'N'V'‡'“‚©‚ @force ‚ª 2 ‚ÌŽž‚Í'X'L'‹‚𑦎ž”“® if battler.current_action.kind == 1 and (not battler.current_action.forcing or @force != 2) if battler.rtp == 0 # 'X'L'‹‰r¥’ ‚È‚ç‚ÎA‰ð" skill_reset(battler) # 'X'L'‹‰r¥Žž "Ý’è recite_time(battler) # ˜A'g‹ZÝ’è synthe_spell(battler) # 'X'L'‹‚ð‰r¥‚·‚éê‡ if battler.rtp > 0 # ‹§'A'N'V'‡'“‚©‚ @force ‚ª 1 ‚ÌŽž‚͘A'g'X'L'‹‚̂ݑ¦Žž ”“® speller = synthe?(battler) if battler.current_action.forcing and @force > 0 and speller != nil for spell in speller spell.rt = spell.rtp end else battler.blink = true if battler.current_action.forcing $game_temp.forcing_battler = nil battler.current_action.forcing = false end @action_battlers.delete(battler) return end end end end # 'A'N'^[‚Ì"¾"Å'G't'F'N'g OFF if battler != nil battler.blink = false end speller = synthe?(battler) if speller == nil @spell_p.delete(battler) @spell_e.delete(battler) else for spell in speller spell.blink = false @spell_p.delete(spell) @spell_e.delete(spell) end end # 'X'e'b'v 2 ‚ɈÚs battler.phase = 2 end #-------------------------------------------------------------------------- # " 't''['€XV (''C'“'t'F['Y 'X'e'b'v 2 : 'A'N'V'‡'“ JŽn) #-------------------------------------------------------------------------- def update_phase4_step2(battler) # ‹§'A'N'V'‡'“‚łȂ¯‚ê‚ Î unless battler.current_action.forcing # §"ñ‚ª [“G‚ð’ÊU'‚‚·‚é] ‚© ["¡•û‚ð’ÊU'‚‚·‚é] ‚Ìê‡ if battler.restriction == 2 or battler.restriction == 3 # 'A'N'V'‡'“‚ÉU'‚‚ðÝ’è battler.current_action.kind = 0 battler.current_action.basic = 0 end end # 'A'N'V'‡'“‚ÌŽ•ʂŕª ò case battler.current_action.kind when 0 # î"{ if fin? battler.phase = 6 return end make_basic_action_result(battler) when 1 # 'X'L'‹ if fin? and $data_skills[battler.current_action.skill_id].scope == 1..2 battler.phase = 6 return end make_skill_action_result(battler) when 2 # 'A'C'e'€ if fin? and $data_items[battler.current_action.item_id].scope == 1..2 battler.phase = 6 return end make_item_action_result(battler) end if battler.phase == 2 # 'X'e'b'v 3 ‚ɈÚs battler.phase = 3 end end #-------------------------------------------------------------------------- # " î"{'A'N'V'‡'“ '‹‰Êì¬ #-------------------------------------------------------------------------- def make_basic_action_result(battler) # U'‚‚Ìê‡ if battler.current_action.basic == 0 # 'A'j'['V'‡'“ ID ‚ðÝ’è battler.anime1 = battler.animation1_id battler.anime2 = battler.animation2_id # s“®‘¤'o'g'‰[‚ª'G'l'~[‚Ìê‡ if battler.is_a?(Game_Enemy) if battler.restriction == 3 target = $game_troop.random_target_enemy elsif battler.restriction == 2 target = $game_party.random_target_actor else index = battler.current_action.target_index target = $game_party.smooth_target_actor(index) end end # s“®‘¤'o'g'‰[‚ª'A'N'^[‚Ìê‡ if battler.is_a?(Game_Actor) if battler.restriction == 3 target = $game_party.random_target_actor elsif battler.restriction == 2 target = $game_troop.random_target_enemy else index = battler.current_action.target_index target = $game_troop.smooth_target_enemy(index) end end # ‘ÎÛ‘¤'o'g'‰[‚Ì”z"ñ‚ðÝ’è battler.target = [target] # ’ÊU'‚‚Ì'ø‰Ê‚ð“K"p for target in battler.target target.attack_effect(battler) end return end # "h'ä‚Ìê‡ if battler.current_action.basic == 1 return end # “¦‚°‚é‚Ìê‡ if battler.is_a?(Game_Enemy) and battler.current_action.basic == 2 # “¦‚°‚é @help_window.set_text("“¦‚°‚é", 1) @help_wait = @help_time battler.escape return end # ‰½‚ ‚µ‚È‚¢‚Ìê‡ if battler.current_action.basic == 3 # 'X'e'b'v 6 ‚ɈÚs battler.phase = 6 return end end #-------------------------------------------------------------------------- # " 'X'L'‹‚Ü‚½‚Í'A'C'e'€‚̑Πۑ¤'o'g'‰[Ý’è # scope : 'X'L'‹‚Ü‚½‚Í'A'C'e'€‚Ì'ø Ê”ÍˆÍ #-------------------------------------------------------------------------- def set_target_battlers(scope, battler) # s“®‘¤'o'g'‰[‚ª'G'l'~[‚Ìê‡ if battler.is_a?(Game_Enemy) # 'ø‰Ê”͈͂ŕª ò case scope when 1 # “G’P‘Ì index =battler.current_action.target_index battler.target.push($game_party.smooth_target_acto r(index)) when 2 # “G‘S‘Ì for actor in $game_party.actors if actor.exist? battler.target.push(actor) end end when 3 # "¡•û’P‘Ì index = battler.current_action.target_index battler.target.push($game_troop.smooth_target_enem y(index)) when 4 # "¡•û‘S‘Ì for enemy in $game_troop.enemies if enemy.exist? battler.target.push(enemy) end end when 5 # "¡•û’P‘Ì (HP 0) index = battler.current_action.target_index enemy = $game_troop.enemies[index] if enemy != nil and enemy.hp0? battler.target.push(enemy) end when 6 # "¡•û‘S‘Ì (HP 0) for enemy in $game_troop.enemies if enemy != nil and enemy.hp0? battler.target.push(enemy) end end when 7 # Žg"pŽ' battler.target.push(battler) end end # s“®‘¤'o'g'‰[‚ª'A'N'^[‚Ìê‡ if battler.is_a?(Game_Actor) # 'ø‰Ê”͈͂ŕª ò case scope when 1 # “G’P‘Ì index = battler.current_action.target_index battler.target.push($game_troop.smooth_target_enem y(index)) when 2 # “G‘S‘Ì for enemy in $game_troop.enemies if enemy.exist? battler.target.push(enemy) end end when 3 # "¡•û’P‘Ì index = battler.current_action.target_index battler.target.push($game_party.smooth_target_acto r(index)) when 4 # "¡•û‘S‘Ì for actor in $game_party.actors if actor.exist? battler.target.push(actor) end end when 5 # "¡•û’P‘Ì (HP 0) index = battler.current_action.target_index actor = $game_party.actors[index] if actor != nil and actor.hp0? battler.target.push(actor) end when 6 # "¡•û‘S‘Ì (HP 0) for actor in $game_party.actors if actor != nil and actor.hp0? battler.target.push(actor) end end when 7 # Žg"pŽ' battler.target.push(battler) end end end #-------------------------------------------------------------------------- # " 'X'L'‹'A'N'V'‡'“ '‹‰Êì¬ #-------------------------------------------------------------------------- def make_skill_action_result(battler) # 'X'L'‹‚ðŽæ“¾ @skill = $data_skills[battler.current_action.skill_id] # ˜A'g'X'L'‹‚Å‚ ‚é‚©‚Ç‚¤‚© m”F speller = synthe?(battler) # ‹§'A'N'V'‡'“‚łȂ¯‚ê‚ Î unless battler.current_action.forcing # SP Ø‚ê‚ȂǂŎg"p‚Å‚«‚È‚ ‚È‚Á‚½ê‡ if speller == nil unless battler.skill_can_use?(@skill.id) # 'X'e'b'v 6 ‚ɈÚs battler.phase = 6 return end end end # SP Á”ï temp = false if speller != nil for spell in speller if spell.current_action.spell_id == 0 spell.sp -= @skill.sp_cost else spell.sp -= $data_skills[spell.current_action.spell_id].sp_cost end # 'X'e['^'X'E'B'“'h'E‚ð' 't'''b'V'… status_refresh(spell) end else battler.sp -= @skill.sp_cost # 'X'e['^'X'E'B'“'h'E‚ð' 't'''b'V'… status_refresh(battler) end # 'A'j'['V'‡'“ ID ‚ðÝ’è battler.anime1 = @skill.animation1_id battler.anime2 = @skill.animation2_id # 'R'‚'“'C'x'“'g ID ‚ðÝ’è battler.event = @skill.common_event_id # ‘ÎÛ‘¤'o'g'‰[‚ðÝ’è set_target_battlers(@skill.scope, battler) # 'X'L'‹‚Ì'ø‰Ê‚ð“K"p for target in battler.target if speller != nil damage = 0 d_result = false effective = false state_p = [] state_m = [] for spell in speller if spell.current_action.spell_id != 0 @skill = $data_skills[spell.current_action.spell_id] end effective |= target.skill_effect(spell, @skill) if target.damage[spell].class != String d_result = true damage += target.damage[spell] elsif effective effect = target.damage[spell] end state_p += target.state_p[spell] state_m += target.state_m[spell] target.damage.delete(spell) target.state_p.delete(spell) target.state_m.delete(spell) end if d_result target.damage[battler] = damage elsif effective target.damage[battler] = effect else target.damage[battler] = 0 end target.state_p[battler] = state_p target.state_m[battler] = state_m else target.skill_effect(battler, @skill) end end end #-------------------------------------------------------------------------- # " 'A'C'e'€'A'N'V'‡'“ '‹‰Êì¬ #-------------------------------------------------------------------------- def make_item_action_result(battler) # 'A'C'e'€‚ðŽæ“¾ @item = $data_items[battler.current_action.item_id] # 'A'C'e'€Ø‚ê‚ȂǂŎg"p‚Å ‚«‚È‚‚È‚Á‚½ê‡ unless $game_party.item_can_use?(@item.id) # 'X'e'b'v 6 ‚ɈÚs battler.phase = 6 return end # Á"Õ•i‚Ìê‡ if @item.consumable # Žg"p‚µ‚½'A'C'e'€‚ð 1 '¸‚ç‚· $game_party.lose_item(@item.id, 1) end # 'A'j'['V'‡'“ ID ‚ðÝ’è battler.anime1 = @item.animation1_id battler.anime2 = @item.animation2_id # 'R'‚'“'C'x'“'g ID ‚ðÝ’è battler.event = @item.common_event_id # ‘ÎÛ‚ð'ˆ’è index = battler.current_action.target_index target = $game_party.smooth_target_actor(index) # ‘ÎÛ‘¤'o'g'‰[‚ðÝ’è set_target_battlers(@item.scope, battler) # 'A'C'e'€‚Ì'ø‰Ê‚ð“K"p for target in battler.target target.item_effect(@item, battler) end end #-------------------------------------------------------------------------- # " 't''['€XV (''C'“'t'F['Y 'X'e'b'v 3 : s“®‘¤'A'j'['V'‡'“) #-------------------------------------------------------------------------- def update_phase4_step3(battler) # 'w'‹'v'E'B'“'h'E‚ÌXVB'A'N' V'‡'“‚ÌŽ•ʂŕª ò case battler.current_action.kind when 0 # î"{ if battler.current_action.basic == 1 @help_window.set_text($data_system.words.guard, 1) @help_wait = @help_time end when 1 # 'X'L'‹ skill = $data_skills[battler.current_action.skill_id] @help_window.set_text(skill.name, 1) @help_wait = @help_time when 2 # 'A'C'e'€ item = $data_items[battler.current_action.item_id] @help_window.set_text(item.name, 1) @help_wait = @help_time end # s“®‘¤'A'j'['V'‡'“ (ID ‚ª 0 ‚Ìꇂ͔’'t'‰'b'V'…) if battler.anime1 == 0 battler.white_flash = true battler.wait = 5 # 'J''‰Ý’è if battler.target[0].is_a?(Game_Enemy) camera_set(battler) end else battler.animation.push([battler.anime1, true]) speller = synthe?(battler) if speller != nil for spell in speller if spell != battler if spell.current_action.spell_id == 0 spell.animation.push([battler.anime1, true]) else skill = spell.current_action.spell_id spell.animation.push([$data_skills[skill].animation1_id, true]) spell.current_action.spell_id = 0 end end end end battler.wait = 2 * $data_animations[battler.anime1].frame_max - 10 end # 'X'e'b'v 4 ‚ɈÚs battler.phase = 4 end #-------------------------------------------------------------------------- # " 't''['€XV (''C'“'t'F['Y 'X'e'b'v 4 : ‘ÎÛ‘¤'A'j'['V'‡'“) #-------------------------------------------------------------------------- def update_phase4_step4(battler) # 'J''‰Ý’è if battler.target[0].is_a?(Game_Enemy) and battler.anime1 != 0 camera_set(battler) end # ‘ÎÛ‘¤'A'j'['V'‡'“ for target in battler.target target.animation.push([battler.anime2, (target.damage[battler] != "Fallo")]) unless battler.anime2 == 0 battler.wait = 2 * $data_animations[battler.anime2].frame_max - 10 end end # 'X'e'b'v 5 ‚ɈÚs battler.phase = 5 end #-------------------------------------------------------------------------- # " 't''['€XV (''C'“'t'F['Y 'X'e'b'v 5 : '_'['W•\ަ) #-------------------------------------------------------------------------- def update_phase4_step5(battler) # '_'['W•\ަ for target in battler.target if target.damage[battler] != nil target.damage_pop[battler] = true target.damage_effect(battler, battler.current_action.kind) battler.wait = @damage_wait # 'X'e['^'X'E'B'“'h'E‚ð' 't'''b'V'… status_refresh(target) end end # 'X'e'b'v 6 ‚ɈÚs battler.phase = 6 end #-------------------------------------------------------------------------- # " 't''['€XV (''C'“'t'F['Y 'X'e'b'v 6 : ' 't'''b'V'…) #-------------------------------------------------------------------------- def update_phase4_step6(battler) # 'J''‰‚ð"ß‚· if battler.target[0].is_a?(Game_Enemy) and @camera == battler @spriteset.screen_target(0, 0, 1) end # 'X'L'‹'‰['j'“'O if battler.target[0].is_a?(Game_Actor) and battler.current_action.kind == 1 for target in battler.target skill_learning(target, target.class_id, battler.current_action.skill_id) end end # 'A'N'V'‡'“‹§‘ÎÛ‚Ì'o'g' [‚ð'N' 'A if battler.current_action.forcing == true and battler.current_action.force_kind == 0 and battler.current_action.force_basic == 0 and battler.current_action.force_skill_id == 0 $game_temp.forcing_battler = nil battler.current_action.forcing = false end refresh_phase(battler) speller = synthe?(battler) if speller != nil for spell in speller if spell != battler refresh_phase(spell) end end synthe_delete(speller) end # 'R'‚'“'C'x'“'g ID ‚ª"L'ø‚Ìê‡ if battler.event > 0 # 'C'x'“'g‚ð'Z'b'g'A'b'v common_event = $data_common_events[battler.event] $game_system.battle_interpreter.setup(common_event .list, 0) end act = 0 for actor in $game_party.actors + $game_troop.enemies if actor.movable? act += 1 end end if @turn_cnt >= act and act > 0 @turn_cnt %= act $game_temp.battle_turn += 1 # 'o'g'‹'C'x'“'g‚Ì‘S'y['W‚ð'Ÿõ for index in 0...$data_troops[@troop_id].pages.size # 'C'x'“'g'y['W‚ðŽæ“¾ page = $data_troops[@troop_id].pages[index] # ‚±‚Ì'y['W‚Ì'X'p'“‚ª ['^['“] ‚Ìê‡ if page.span == 1 # ŽÀsÏ‚Ý't'‰'O‚ð'N' 'A $game_temp.battle_event_flags[index] = false end end end battler.phase = 1 @action_battlers.delete(battler) end #-------------------------------------------------------------------------- # " ' 't'''b'V'… #-------------------------------------------------------------------------- def refresh_phase(battler) battler.at -= @max if battler.movable? battler.atp = 100 * battler.at / @max end spell_reset(battler) # 'X' 'b'v'_'['W if battler.hp > 0 and battler.slip_damage? battler.slip_damage_effect battler.damage_pop["slip"] = true end # 'X'e['gŽ©‘R‰ð" battler.remove_states_auto # 'X'e['^'X'E'B'“'h'E‚ð' 't'''b'V'… status_refresh(battler, true) unless battler.movable? return end # '^['“”'J'E'“'g @turn_cnt += 1 end #-------------------------------------------------------------------------- # " 'o'g'‰['A'N'V'‡'“'X'^['g #-------------------------------------------------------------------------- def action_start(battler) battler.phase = 1 battler.anime1 = 0 battler.anime2 = 0 battler.target = [] battler.event = 0 @action_battlers.unshift(battler) end #-------------------------------------------------------------------------- # " 'X'e['^'X'E'B'“'h'E‚ð' 't'''b'V'… #-------------------------------------------------------------------------- def status_refresh(battler, at = false) if battler.is_a?(Game_Actor) for i in 0...$game_party.actors.size if battler == $game_party.actors[i] number = i + 1 end end @status_window.refresh(number) if at == true @status_window.at_refresh(number) end end end #-------------------------------------------------------------------------- # " 'A'j''E'F'C'g”»’fˆ" #-------------------------------------------------------------------------- def anime_wait_return if (@action_battlers.empty? or @anime_wait == false) and not $game_system.battle_interpreter.running? # 'G'l'~['A'[‚ª"L'ø‚Ìê‡ if @enemy_arrow != nil return [@active - 2, 0].min == 0 # 'A'N'^['A'[‚ª"L'ø‚Ìê‡ elsif @actor_arrow != nil return [@active - 2, 0].min == 0 # 'X'L'‹'E'B'“'h'E‚ª"L'ø‚Ìê ‡ elsif @skill_window != nil return [@active - 3, 0].min == 0 # 'A'C'e'€'E'B'“'h'E‚ª"L'ø‚Ì ê‡ elsif @item_window != nil return [@active - 3, 0].min == 0 # 'A'N'^['R'}'“'h'E'B'“'h'E‚ª"L'ø‚Ì ê‡ elsif @actor_command_window.active return [@active - 1, 0].min == 0 else return true end else return false end end #-------------------------------------------------------------------------- # " 'A'N'^['R'}'“'hÁ‹Ž”»’f #-------------------------------------------------------------------------- def command_delete # 'G'l'~['A'[‚ª"L'ø‚Ìê‡ if @enemy_arrow != nil end_enemy_select # 'A'N'^['A'[‚ª"L'ø‚Ìê‡ elsif @actor_arrow != nil end_actor_select end # 'X'L'‹'E'B'“'h'E‚ª"L'ø‚Ìê ‡ if @skill_window != nil end_skill_select # 'A'C'e'€'E'B'“'h'E‚ª"L'ø‚Ì ê‡ elsif @item_window != nil end_item_select end # 'A'N'^['R'}'“'h'E'B'“'h'E‚ª"L'ø‚Ì ê‡ if @actor_command_window.active @command.shift @command_a = false # ''C'“'t'F['Y't'‰'O‚ð'Z'b'g $game_temp.battle_main_phase = true # 'A'N'^['R'}'“'h'E'B'“'h'E‚ð"³'ø‰» @actor_command_window.active = false @actor_command_window.visible = false # 'A'N'^[‚Ì"¾"Å'G't'F'N'g OFF if @active_actor != nil @active_actor.blink = false end end end #-------------------------------------------------------------------------- # " ‹§'A'N'V'‡'“Ý’è #-------------------------------------------------------------------------- def force_action(battler) battler.current_action.kind = battler.current_action.force_kind battler.current_action.basic = battler.current_action.force_basic battler.current_action.skill_id = battler.current_action.force_skill_id battler.current_action.force_kind = 0 battler.current_action.force_basic = 0 battler.current_action.force_skill_id = 0 end #-------------------------------------------------------------------------- # " 'J''‰'Z'b'g #-------------------------------------------------------------------------- def camera_set(battler) @camera = battler if battler.target.size == 1 if battler.current_action.kind == 0 zoom = 1.2 / battler.target[0].zoom elsif synthe?(battler) == nil zoom = 1.5 / battler.target[0].zoom else zoom = 2.0 / battler.target[0].zoom end @spriteset.screen_target(battler.target[0].attack_x(zoom), battler.target[0].attack_y(zoom), zoom) else @spriteset.screen_target(0, 0, 0.75) end end #-------------------------------------------------------------------------- # " 'X'L'‹‰r¥'^'C'€ì¬ #-------------------------------------------------------------------------- def recite_time(battler) end #-------------------------------------------------------------------------- # " ˜A'g'X'L'‹”»•Ê #-------------------------------------------------------------------------- def synthe_spell(battler) end #-------------------------------------------------------------------------- # " 'X'L'‹'‰['j'“'O'V'X'e'€ #-------------------------------------------------------------------------- def skill_learning(actor, class_id, skill_id) end #-------------------------------------------------------------------------- # " s“®‰Â”\”»’è #-------------------------------------------------------------------------- def active?(battler) speller = synthe?(battler) if speller != nil if synthe_delete?(speller) return false end else unless battler.inputable? spell_reset(battler) unless battler.movable? battler.atp = 0 return false end end if battler.current_action.forcing spell_reset(battler) end end return true end #-------------------------------------------------------------------------- # " ‡¬'X'L'‹‰r¥’ ‚©H #-------------------------------------------------------------------------- def synthe?(battler) for speller in @synthe if speller.include?(battler) return speller end end return nil end #-------------------------------------------------------------------------- # " ‡¬'X'L'‹Á‹Ž”»’f #-------------------------------------------------------------------------- def synthe_delete?(speller) for battler in speller if not battler.inputable? and dead_ok?(battler) synthe_delete(speller) return true end end return false end #-------------------------------------------------------------------------- # " ‡¬'X'L'‹Á‹Ž #-------------------------------------------------------------------------- def synthe_delete(speller) for battler in speller spell_reset(battler) if dead_ok?(battler) @action_battlers.delete(battler) end end @synthe.delete(speller) end #-------------------------------------------------------------------------- # " ˜A'g Ü‚Þ'X'L'‹‰r¥‰ð" #-------------------------------------------------------------------------- def skill_reset(battler) speller = synthe?(battler) if speller != nil synthe_delete(speller) else spell_reset(battler) end end #-------------------------------------------------------------------------- # " 'X'L'‹‰r¥‰ð" #-------------------------------------------------------------------------- def spell_reset(battler) battler.rt = 0 battler.rtp = 0 battler.blink = false battler.spell = false battler.current_action.spell_id = 0 @spell_p.delete(battler) @spell_e.delete(battler) end #-------------------------------------------------------------------------- # " “¬I"¹”»’è #-------------------------------------------------------------------------- def fin? return (victory? or $game_party.all_dead? or $game_party.actors.size == 0) end #-------------------------------------------------------------------------- # " “G‘S"Å”»’è #-------------------------------------------------------------------------- def victory? for battler in $game_troop.enemies if not battler.hidden and (battler.rest_hp > 0 or battler.immortal or battler.damage_pop.size > 0) return false end end return true end #-------------------------------------------------------------------------- # " Ž€"S‹"‰Â”»’è #-------------------------------------------------------------------------- def dead_ok?(battler) speller = synthe?(battler) if speller == nil if @action_battlers.include?(battler) if battler.phase > 2 return false end end else for battler in speller if @action_battlers.include?(battler) if battler.phase > 2 return false end end end end return true end end #================================================= ============================= # ¡ Game_Actor #------------------------------------------------------------------------------ # @'A'N'^[‚ðˆµ‚¤'N'‰'X‚Å‚·B‚±‚Ì' N'‰'X‚Í Game_Actors 'N'‰'X ($game_actors) # ‚Ì“ •”‚ÅŽg"p‚³‚êAGame_Party 'N'‰'X ($game_party) ‚©‚ç‚ ŽQÆ‚³‚ê‚Ü‚·B #================================================= ============================= class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # " 'o'g'‹‰æ"Ê X À•W‚̎擾 #-------------------------------------------------------------------------- def screen_x # 'p['e'B“ ‚Ì•À‚'‡‚©‚ç X À•W‚ð'vŽZ‚µ‚Ä•"‚· if self.index != nil return self.index * 160 + (4 - $game_party.actors.size) * 80 + 80 else return 0 end end end #================================================= ============================= # ¡ Spriteset_Battle #------------------------------------------------------------------------------ # @'o'g'‹‰æ"Ê‚Ì'X'v'‰'C'g‚ ‚܂Ƃ߂½'N'‰'X‚Å‚·B‚± ‚Ì'N'‰'X‚Í Scene_Battle 'N'‰ # 'X‚Ì“ •”‚ÅŽg"p‚³‚ê‚Ü‚·B #================================================= ============================= class Spriteset_Battle #-------------------------------------------------------------------------- # " 'ö J'C'“'X'^'“'X•Ï” #-------------------------------------------------------------------------- attr_reader :real_x # xÀ•W•â³i'»Ý’lj attr_reader :real_y # yÀ•W•â³i'»Ý’lj attr_reader :real_zoom # g‘å"¦i'»Ý’lj #-------------------------------------------------------------------------- # " 'I'u'W'F'N'g‰ ú‰» #-------------------------------------------------------------------------- def initialize # 'r'…['|['g‚ðì¬ @viewport1 = Viewport.new(0, 0, 640, 480) @viewport2 = Viewport.new(0, 0, 640, 480) @viewport3 = Viewport.new(0, 0, 640, 480) @viewport4 = Viewport.new(0, 0, 640, 480) @viewport2.z = 101 @viewport3.z = 200 @viewport4.z = 5000 @wait = 0 @real_x = 0 @real_y = 0 @real_zoom = 1.0 @target_x = 0 @target_y = 0 @target_zoom = 1.0 @gap_x = 0 @gap_y = 0 @gap_zoom = 0.0 # 'o'g'‹'o'b'N'X'v'‰'C'g‚ðì¬ @battleback_sprite = Sprite.new(@viewport1) # 'G'l'~['X'v'‰'C'g‚ðì¬ @enemy_sprites = [] for enemy in $game_troop.enemies.reverse @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy)) end # 'A'N'^['X'v'‰'C'g‚ðì¬ @actor_sprites = [] @actor_sprites.push(Sprite_Battler.new(@viewport2) ) @actor_sprites.push(Sprite_Battler.new(@viewport2) ) @actor_sprites.push(Sprite_Battler.new(@viewport2) ) @actor_sprites.push(Sprite_Battler.new(@viewport2) ) # “V'ó‚ðì¬ @weather = RPG::Weather.new(@viewport1) # 's'N'`'''X'v'‰'C'g‚ðì¬ @picture_sprites = [] for i in 51..100 @picture_sprites.push(Sprite_Picture.new(@viewport 3, $game_screen.pictures[i])) end # '^'C'}['X'v'‰'C'g‚ðì¬ @timer_sprite = Sprite_Timer.new # 't''['€XV update end #-------------------------------------------------------------------------- # " 't''['€XV #-------------------------------------------------------------------------- def update # 'A'N'^['X'v'‰'C'g‚Ì“ "e‚ðXV ('A'N'^[‚Ì“ü‚ê‘-‚¦‚ɑΉž) @actor_sprites[0].battler = $game_party.actors[0] @actor_sprites[1].battler = $game_party.actors[1] @actor_sprites[2].battler = $game_party.actors[2] @actor_sprites[3].battler = $game_party.actors[3] # 'o'g'‹'o'b'N‚Ì't'@'C'‹"¼‚ª '»Ý‚Ì‚ ‚Ì‚Æˆá‚¤ê‡ if @battleback_name != $game_temp.battleback_name make_battleback end # ‰æ"Ê‚Ì'X'N'['‹ screen_scroll # '‚'“'X'^[‚̈ʒu•â³ for enemy in $game_troop.enemies enemy.real_x = @real_x enemy.real_y = @real_y enemy.real_zoom = @real_zoom end # 'o'g'‰['X'v'‰'C'g‚ðXV for sprite in @enemy_sprites + @actor_sprites sprite.update end # “V'ó'O'‰'t'B'b'N‚ðXV @weather.type = $game_screen.weather_type @weather.max = $game_screen.weather_max @weather.update # 's'N'`'''X'v'‰'C'g‚ðXV for sprite in @picture_sprites sprite.update end # '^'C'}['X'v'‰'C'g‚ðXV @timer_sprite.update # ‰æ"Ê‚ÌF’²‚Æ'V'F'C'NˆÊ’u ðÝ’è @viewport1.tone = $game_screen.tone @viewport1.ox = $game_screen.shake # ‰æ"Ê‚Ì't'‰'b'V'…F‚ðÝ’ @viewport4.color = $game_screen.flash_color # 'r'…['|['g‚ðXV @viewport1.update @viewport2.update @viewport4.update end #-------------------------------------------------------------------------- # " 'o'g'‹”w'i‚ÌÝ’è #-------------------------------------------------------------------------- def make_battleback @battleback_name = $game_temp.battleback_name if @battleback_sprite.bitmap != nil @battleback_sprite.bitmap.dispose end @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name) if @battleback_sprite.bitmap.width == 640 and @battleback_sprite.bitmap.height == 320 @battleback_sprite.src_rect.set(0, 0, 1280, 640) @base_zoom = 2.0 @battleback_sprite.zoom_x = @base_zoom @battleback_sprite.zoom_y = @base_zoom @real_y = 4 @battleback_sprite.x = 320 @battleback_sprite.y = @real_y @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2 @battleback_sprite.oy = @battleback_sprite.bitmap.height / 4 elsif @battleback_sprite.bitmap.width == 640 and @battleback_sprite.bitmap.height == 480 @battleback_sprite.src_rect.set(0, 0, 960, 720) @base_zoom = 1.5 @battleback_sprite.zoom_x = @base_zoom @battleback_sprite.zoom_y = @base_zoom @battleback_sprite.x = 320 @battleback_sprite.y = 0 @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2 @battleback_sprite.oy = @battleback_sprite.bitmap.height / 4 else @battleback_sprite.src_rect.set(0, 0, @battleback_sprite.bitmap.width, @battleback_sprite.bitmap.height) @base_zoom = 1.0 @battleback_sprite.zoom_x = @base_zoom @battleback_sprite.zoom_y = @base_zoom @battleback_sprite.x = 320 @battleback_sprite.y = 0 @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2 @battleback_sprite.oy = @battleback_sprite.bitmap.height / 4 end end #-------------------------------------------------------------------------- # " ‰æ"Ê‚Ì'X'N'['‹"Ú•W‚̈ʒuE g‘å"¦Ý’è #-------------------------------------------------------------------------- def screen_target(x, y, zoom) return unless $scene.drive @wait = $scene.scroll_time @target_x = x @target_y = y @target_zoom = zoom screen_over @gap_x = @target_x - @real_x @gap_y = @target_y - @real_y @gap_zoom = @target_zoom - @real_zoom end #-------------------------------------------------------------------------- # " ‰æ"Ê‚Ì'X'N'['‹ #-------------------------------------------------------------------------- def screen_scroll if @wait > 0 @real_x = @target_x - @gap_x * (@wait ** 2) / ($scene.scroll_time ** 2) @real_y = @target_y - @gap_y * (@wait ** 2) / ($scene.scroll_time ** 2) @real_zoom = @target_zoom - @gap_zoom * (@wait ** 2) / ($scene.scroll_time ** 2) @battleback_sprite.x = 320 + @real_x @battleback_sprite.y = @real_y @battleback_sprite.zoom_x = @base_zoom * @real_zoom @battleback_sprite.zoom_y = @base_zoom * @real_zoom @battleback_sprite.ox = @battleback_sprite.bitmap.width / 2 @battleback_sprite.oy = @battleback_sprite.bitmap.height / 4 @wait -= 1 end end #-------------------------------------------------------------------------- # " 'X'N' ['“‚ª‰æ"Ê O‚Éo‚½Žž‚̕Ⳉ" #-------------------------------------------------------------------------- def screen_over width = @battleback_sprite.bitmap.width * @base_zoom * @target_zoom / 2 unless 324 + @target_x > width and 324 - @target_x > width if 324 + @target_x > width @target_x = width - 324 elsif 324 - @target_x > width @target_x = 324 - width end end height = @battleback_sprite.bitmap.height * @base_zoom * @target_zoom / 4 unless @target_y > height - 4 and 484 - @target_y > 3 * height if @target_y > height - 4 @target_y = height - 4 elsif 484 - @target_y > 3 * height @target_y = 484 - 3 * height end end end end #================================================= ============================= # ¡ Game_Battler (•ª „’è‹` 1) #------------------------------------------------------------------------------ # @'o'g'‰[‚ðˆµ‚¤'N'‰'X‚Å‚·B‚±‚Ì' N'‰'X‚Í Game_Actor 'N'‰'X‚Æ Game_Enemy 'N'‰ # 'X‚Ì'X['p['N'‰'X‚Æ‚µ‚ÄŽg"p‚³‚ê‚Ü ·B #================================================= ============================= class Game_Battler #-------------------------------------------------------------------------- # " 'ö J'C'“'X'^'“'X•Ï”’ljÁ #-------------------------------------------------------------------------- attr_accessor :up_level # '''x'‹'A'b'v” attr_accessor :at # ATi'^'C'€'Q['Wj attr_accessor :atp # ATi•\ަ"pj attr_accessor :rt # RPi‰r¥'Q['Wj attr_accessor :rtp # RPi‰r¥•K"v"Êj attr_accessor :spell # ‡¬'X'L'‹”“®’ attr_accessor :recover_hp # HP‰ñ•""Ê attr_accessor :recover_sp # SP‰ñ•""Ê attr_accessor :state_p # 'X'e['^'XˆÙ”z"ñ attr_accessor :state_m # 'X'e['^'XˆÙ”z"ñ attr_accessor :damage_sp # SP'_'['W•\ަ't'‰'O attr_accessor :animation # 'A'j'['V'‡'“ ID, Hit‚Ì”z"ñ attr_accessor haseattr_accessor :wait attr_accessor :target attr_accessor :anime1 attr_accessor :anime2 attr_accessor :event #-------------------------------------------------------------------------- # " 'I'u'W'F'N'g‰ ú‰» #-------------------------------------------------------------------------- alias :initialize_rtab :initialize def initialize initialize_rtab @damage_pop = {} @damage = {} @damage_sp = {} @critical = {} @recover_hp = {} @recover_sp = {} @state_p = {} @state_m = {} @animation = [] @phase = 1 @wait = 0 @target = [] @anime1 = 0 @anime2 = 0 @event = 0 end #-------------------------------------------------------------------------- # " ‘¶Ý”»’è #-------------------------------------------------------------------------- def exist? return (not @hidden and (@hp > 0 or @immortal or @damage.size > 0)) end #-------------------------------------------------------------------------- # " ŽcHP"\‘ª #-------------------------------------------------------------------------- def rest_hp # rest_hp ‚É'»HP‚ð‘ã“ü rest_hp = @hp # 'o'g'‰[‚ªŽó‚¯‚é‘S'_'['W‚ðrest_hp‚É”½‰f‚³‚¹‚é for pre_damage in @damage if pre_damage[1].is_a?(Numeric) rest_hp -= pre_damage[1] end end return rest_hp end #-------------------------------------------------------------------------- # " 'X'e['g‚̉ð" # state_id : 'X'e['g ID # force : ‹§‰ð"'t'‰'O ('I['g'X'e['g‚̈"‚ÅŽg"p) #-------------------------------------------------------------------------- def remove_state(state_id, force = false) # ‚±‚Ì'X'e['g‚ª•t‰Á‚³‚ê‚Ä‚¢‚éê if state?(state_id) # ‹§•t‰Á‚³‚ꂽ'X'e['g‚ÅA‚©‚‰ð"‚ª‹§‚Š͂Ȃ¢ê‡ if @states_turn[state_id] == -1 and not force # ''\'b'hI"¹ return end # '»Ý‚Ì HP ‚ª 0 ‚©‚ 'I'v'V'‡'“ [HP 0 ‚Ìó‘"‚Ƃ݂Ȃ·] ‚ª"L'ø‚Ìê‡ if @hp == 0 and $data_states[state_id].zero_hp # ‚Ù‚©‚É [HP 0 ‚Ìó‘"‚Ƃ݂Ȃ·] 'X'e['g‚ª‚ ‚é‚©‚Ç‚¤‚©”»’è zero_hp = false for i in @states if i != state_id and $data_states[i].zero_hp zero_hp = true end end # “¬•s”\‚ð‰ð"‚µ‚Ă悯 ‚ê‚ÎAHP ‚ð 1 ‚É•ÏX if zero_hp == false @hp = 1 end end unless self.movable? # 'X'e['g ID ‚ð @states ”z"ñ‚¨‚æ‚' @states_turn 'n'b'V'…‚©‚ç" @states.delete(state_id) @states_turn.delete(state_id) if self.movable? self.at = 0 end else # 'X'e['g ID ‚ð @states ”z"ñ‚¨‚æ‚' @states_turn 'n'b'V'…‚©‚ç" @states.delete(state_id) @states_turn.delete(state_id) end end # HP ‚¨‚æ‚' SP ‚ÌÅ‘å’l'`'F'b'N @hp = [@hp, self.maxhp].min @sp = [@sp, self.maxsp].min end #-------------------------------------------------------------------------- # " ’ÊU'‚‚Ì'ø‰Ê“K"p # attacker : U'‚Ž' ('o'g'‰[) #-------------------------------------------------------------------------- def attack_effect(attacker) # 'N' 'e'B'J'‹'t'‰'O‚ð'N' 'A self.critical[attacker] = false state_p[attacker] = [] state_m[attacker] = [] # ‘æˆê"½’ ”»’è hit_result = (rand(100) < attacker.hit) # "½’ ‚Ìê‡ if hit_result == true # î"{'_'['W‚ð'vŽZ atk = [attacker.atk - self.pdef / 2, 0].max self.damage[attacker] = atk * (20 + attacker.str) / 20 # ‘®«C³ self.damage[attacker] *= elements_correct(attacker.element_set) self.damage[attacker] /= 100 # '_'['W‚Ì•„ ‚ª³‚Ìê‡ if self.damage[attacker] > 0 # 'N' 'e'B'J'‹C³ if rand(100) < 4 * attacker.dex / self.agi self.damage[attacker] *= 2 self.critical[attacker] = true end # "h'äC³ if self.guarding? self.damage[attacker] /= 2 end end # •ªŽU if self.damage[attacker].abs > 0 amp = [self.damage[attacker].abs * 15 / 100, 1].max self.damage[attacker] += rand(amp+1) + rand(amp+1) - amp end # ‘æ“ñ"½’ ”»’è eva = 8 * self.agi / attacker.dex + self.eva hit = self.damage[attacker] < 0 ? 100 : 100 - eva hit = self.cant_evade? ? 100 : hit hit_result = (rand(100) < hit) end # "½’ ‚Ìê‡ if hit_result == true # 'X'e['gÕ'‚‰ð" remove_states_shock # HP ‚©‚ç'_'['W‚ð'¸ŽZ # 'X'e['g•ω» @state_changed = false states_plus(attacker, attacker.plus_state_set) states_minus(attacker, attacker.minus_state_set) # '~'X‚Ìê‡ else # '_'['W‚É "Miss" ‚ðÝ’è self.damage[attacker] = "Fallo" # 'N' 'e'B'J'‹'t'‰'O‚ð'N' 'A self.critical[attacker] = false end # ''\'b'hI"¹ return true end #-------------------------------------------------------------------------- # " 'X'L'‹‚Ì'ø‰Ê“K"p # user : 'X'L'‹‚ÌŽg"pŽ' ('o'g'‰[) # skill : 'X'L'‹ #-------------------------------------------------------------------------- def skill_effect(user, skill) # 'N' 'e'B'J'‹'t'‰'O‚ð'N' 'A self.critical[user] = false state_p[user] = [] state_m[user] = [] # 'X'L'‹‚Ì'ø‰Ê”͈͂ª HP 1 ˆÈã‚Ì"¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 0A # ‚Ü‚½‚Í'X'L'‹‚Ì'ø‰Ê”ÍˆÍ ª HP 0 ‚Ì"¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 1 ˆÈã‚Ìê‡ if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1) # ''\'b'hI"¹ return false end # "L'ø't'‰'O‚ð'N' 'A effective = false # 'R'‚'“'C'x'“'g ID ‚ª"L'ø‚ÌꇂÍ"L'ø't'‰' O‚ð'Z'b'g effective |= skill.common_event_id > 0 # ‘æˆê"½’ ”»’è hit = skill.hit if skill.atk_f > 0 hit *= user.hit / 100 end hit_result = (rand(100) < hit) # •s mŽÀ‚È'X'L'‹‚ÌꇂÍ"L'ø' t'‰'O‚ð'Z'b'g effective |= hit < 100 # "½’ ‚Ìê‡ if hit_result == true # ˆÐ"Í‚ð'vŽZ power = skill.power + user.atk * skill.atk_f / 100 if power > 0 power -= self.pdef * skill.pdef_f / 200 power -= self.mdef * skill.mdef_f / 200 power = [power, 0].max end # ”{"¦‚ð'vŽZ rate = 20 rate += (user.str * skill.str_f / 100) rate += (user.dex * skill.dex_f / 100) rate += (user.agi * skill.agi_f / 100) rate += (user.int * skill.int_f / 100) # î"{'_'['W‚ð'vŽZ self.damage[user] = power * rate / 20 # ‘®«C³ self.damage[user] *= elements_correct(skill.element_set) self.damage[user] /= 100 # '_'['W‚Ì•„ ‚ª³‚Ìê‡ if self.damage[user] > 0 # "h'äC³ if self.guarding? self.damage[user] /= 2 end end # •ªŽU if skill.variance > 0 and self.damage[user].abs > 0 amp = [self.damage[user].abs * skill.variance / 100, 1].max self.damage[user] += rand(amp+1) + rand(amp+1) - amp end # ‘æ“ñ"½’ ”»’è eva = 8 * self.agi / user.dex + self.eva hit = self.damage[user] < 0 ? 100 : 100 - eva * skill.eva_f / 100 hit = self.cant_evade? ? 100 : hit hit_result = (rand(100) < hit) # •s mŽÀ‚È'X'L'‹‚ÌꇂÍ"L'ø' t'‰'O‚ð'Z'b'g effective |= hit < 100 end # "½’ ‚Ìê‡ if hit_result == true # ˆÐ"Í 0 ˆÈ O‚Ì•¨"U'‚‚Ìê‡ if skill.power != 0 and skill.atk_f > 0 # 'X'e['gÕ'‚‰ð" remove_states_shock # "L'ø't'‰'O‚ð'Z'b'g effective = true end # HP ‚̕ϓ®”»’è last_hp = [[self.hp - self.damage[user], self.maxhp].min, 0].max # 'ø‰Ê”»’è effective |= self.hp != last_hp # 'X'e['g•ω» @state_changed = false effective |= states_plus(user, skill.plus_state_set) effective |= states_minus(user, skill.minus_state_set) unless $game_temp.in_battle self.damage_effect(user, 1) end # ˆÐ"Í‚ª 0 ‚Ìê‡ if skill.power == 0 # '_'['W‚ɋ󕶎š"ñ‚ðÝ’è self.damage[user] = "" # 'X'e['g‚ɕω»‚ª‚È‚¢ê‡ unless @state_changed # '_'['W‚É "Miss" ‚ðÝ’è self.damage[user] = "Fallo" end end # '~'X‚Ìê‡ else # '_'['W‚É "Miss" ‚ðÝ’è self.damage[user] = "Fallo" end # “¬’ ‚łȂ¢ê‡ unless $game_temp.in_battle # '_'['W‚É nil ‚ðÝ’è self.damage[user] = nil end # ''\'b'hI"¹ return effective end #-------------------------------------------------------------------------- # " 'A'C'e'€‚Ì'ø‰Ê“K"p # item : 'A'C'e'€ #-------------------------------------------------------------------------- def item_effect(item, user = $game_party.actors[0]) # 'N' 'e'B'J'‹'t'‰'O‚ð'N' 'A self.critical[user] = false state_p[user] = [] state_m[user] = [] self.recover_hp[user] = 0 self.recover_sp[user] = 0 # 'A'C'e'€‚Ì'ø‰Ê”͈͂ª HP 1 ˆÈã‚Ì"¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 0A # ‚Ü‚½‚Í'A'C'e'€‚Ì'ø‰Ê”͈ Í‚ª HP 0 ‚Ì"¡•û‚ÅAŽ©•ª‚Ì HP ‚ª 1 ˆÈã‚Ìê‡ if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or ((item.scope == 5 or item.scope == 6) and self.hp >= 1) # ''\'b'hI"¹ return false end # "L'ø't'‰'O‚ð'N' 'A effective = false # 'R'‚'“'C'x'“'g ID ‚ª"L'ø‚ÌꇂÍ"L'ø't'‰' O‚ð'Z'b'g effective |= item.common_event_id > 0 # "½’ ”»’è hit_result = (rand(100) < item.hit) # •s mŽÀ‚È'X'L'‹‚ÌꇂÍ"L'ø' t'‰'O‚ð'Z'b'g effective |= item.hit < 100 # "½’ ‚Ìê‡ if hit_result == true # ‰ñ•""Ê‚ð'vŽZ self.recover_hp[user] = maxhp * item.recover_hp_rate / 100 + item.recover_hp self.recover_sp[user] = maxsp * item.recover_sp_rate / 100 + item.recover_sp if self.recover_hp[user] < 0 self.recover_hp[user] += self.pdef * item.pdef_f / 20 self.recover_hp[user] += self.mdef * item.mdef_f / 20 self.recover_hp[user] = [self.recover_hp[user], 0].min end # ‘®«C³ self.recover_hp[user] *= elements_correct(item.element_set) self.recover_hp[user] /= 100 self.recover_sp[user] *= elements_correct(item.element_set) self.recover_sp[user] /= 100 # •ªŽU if item.variance > 0 and self.recover_hp[user].abs > 0 amp = [self.recover_hp[user].abs * item.variance / 100, 1].max self.recover_hp[user] += rand(amp+1) + rand(amp+1) - amp end if item.variance > 0 and self.recover_sp[user].abs > 0 amp = [self.recover_sp[user].abs * item.variance / 100, 1].max self.recover_sp[user] += rand(amp+1) + rand(amp+1) - amp end # ‰ñ•""ʂ̕„ ‚ª•‰‚Ìê‡ if self.recover_hp[user] < 0 # "h'äC³ if self.guarding? self.recover_hp[user] /= 2 end end # HP ‰ñ•""ʂ̕„ ‚𔽓]‚µA'_'['W‚Ì’l‚ÉÝ’è self.damage[user] = -self.recover_hp[user] # HP ‚¨‚æ‚' SP ‚̕ϓ®”»’è last_hp = [[self.hp + self.recover_hp[user], self.maxhp].min, 0].max last_sp = [[self.sp + self.recover_sp[user], self.maxsp].min, 0].max effective |= self.hp != last_hp effective |= self.sp != last_sp # 'X'e['g•ω» @state_changed = false effective |= states_plus(user, item.plus_state_set) effective |= states_minus(user, item.minus_state_set) unless $game_temp.in_battle self.damage_effect(user, 2) end # 'p'‰'['^㸒l‚ª"L'ø‚Ìê‡ if item.parameter_type > 0 and item.parameter_points != 0 # 'p'‰'['^‚Å•ª ò case item.parameter_type when 1 # MaxHP @maxhp_plus += item.parameter_points when 2 # MaxSP @maxsp_plus += item.parameter_points when 3 # ˜r"Í @str_plus += item.parameter_points when 4 # "p‚³ @dex_plus += item.parameter_points when 5 # ‘f‘‚³ @agi_plus += item.parameter_points when 6 # "‚"Í @int_plus += item.parameter_points end # "L'ø't'‰'O‚ð'Z'b'g effective = true end # HP ‰ñ•""¦‚Ɖñ•""Ê‚ª 0 ‚Ìê‡ if item.recover_hp_rate == 0 and item.recover_hp == 0 # '_'['W‚ɋ󕶎š"ñ‚ðÝ’è self.damage[user] = "" # SP ‰ñ•""¦‚Ɖñ•""Ê‚ª 0A'p'‰'['^㸒l‚ª"³'ø‚Ìê‡ if item.recover_sp_rate == 0 and item.recover_sp == 0 and (item.parameter_type == 0 or item.parameter_points == 0) # 'X'e['g‚ɕω»‚ª‚È‚¢ê‡ unless @state_changed # '_'['W‚É "Miss" ‚ðÝ’è self.damage[user] = "Fallo" end end end # '~'X‚Ìê‡ else # '_'['W‚É "Miss" ‚ðÝ’è self.damage[user] = "Fallo" end # “¬’ ‚łȂ¢ê‡ unless $game_temp.in_battle # '_'['W‚É nil ‚ðÝ’è self.damage[user] = nil end # ''\'b'hI"¹ return effective end #-------------------------------------------------------------------------- # " 'X'e['g•ω» (+) ‚Ì“K"p # plus_state_set : 'X'e['g•ω» (+) #-------------------------------------------------------------------------- def states_plus(battler, plus_state_set) # "L'ø't'‰'O‚ð'N' 'A effective = false # '‹['v (•t‰Á‚·‚é'X'e['g) for i in plus_state_set # ‚±‚Ì'X'e['g‚ª"h'䂳‚ê‚Ä‚¢‚È‚¢ê ‡ unless self.state_guard?(i) # ‚±‚Ì'X'e['g‚ª't'‹‚łȂ¯‚ê‚Î"L'ø 't'‰'O‚ð'Z'b'g effective |= self.state_full?(i) == false # 'X'e['g‚ª [’ïR‚µ‚È‚¢] ‚Ìê‡ if $data_states[i].nonresistance # 'X'e['g•ω»'t'‰'O‚ð'Z'b'g @state_changed = true # 'X'e['g‚ð•t‰Á self.state_p[battler].push(i) # ‚±‚Ì'X'e['g‚ª't'‹‚ł͂Ȃ¢ê‡ elsif self.state_full?(i) == false # 'X'e['g"L'ø“x‚ð m"¦‚É•Ï ·‚µA"”‚Æ”ä r if rand(100) < [0,100,80,60,40,20,0][self.state_ranks[i]] # 'X'e['g•ω»'t'‰'O‚ð'Z'b'g @state_changed = true # 'X'e['g‚ð•t‰Á self.state_p[battler].push(i) end end end end # ''\'b'hI"¹ return effective end #-------------------------------------------------------------------------- # " 'X'e['g•ω» (-) ‚Ì“K"p # minus_state_set : 'X'e['g•ω» (-) #-------------------------------------------------------------------------- def states_minus(battler, minus_state_set) # "L'ø't'‰'O‚ð'N' 'A effective = false # '‹['v (‰ð"‚·‚é'X'e['g) for i in minus_state_set # ‚±‚Ì'X'e['g‚ª•t‰Á‚³‚ê‚Ä‚¢‚ê‚Î" L'ø't'‰'O‚ð'Z'b'g effective |= self.state?(i) # 'X'e['g•ω»'t'‰'O‚ð'Z'b'g @state_changed = true # 'X'e['g‚ð‰ð" self.state_m[battler].push(i) end # ''\'b'hI"¹ return effective end #-------------------------------------------------------------------------- # " '_'['W‰‰ŽZ #-------------------------------------------------------------------------- def damage_effect(battler, item) if item == 2 self.hp += self.recover_hp[battler] self.sp += self.recover_sp[battler] if self.recover_sp[battler] != 0 self.damage_sp[battler] = -self.recover_sp[battler] end self.recover_hp.delete(battler) self.recover_sp.delete(battler) else if self.damage[battler].class != String self.hp -= self.damage[battler] end end for i in self.state_p[battler] add_state(i) end for i in self.state_m[battler] remove_state(i) end end #-------------------------------------------------------------------------- # " 'X' 'b'v'_'['W‚Ì'ø‰Ê“K"p #-------------------------------------------------------------------------- def slip_damage_effect # '_'['W‚ðÝ’è self.damage["slip"] = self.maxhp / 10 # •ªŽU if self.damage["slip"].abs > 0 amp = [self.damage["slip"].abs * 15 / 100, 1].max self.damage["slip"] += rand(amp+1) + rand(amp+1) - amp end # HP ‚©‚ç'_'['W‚ð'¸ŽZ self.hp -= self.damage["slip"] # ''\'b'hI"¹ return true end end #================================================= ============================= # ¡ Game_BattleAction #------------------------------------------------------------------------------ # @'A'N'V'‡'“ (“¬’ ‚Ìs“®) ‚ðˆµ‚¤'N'‰'X‚Å‚·B‚±‚Ì' N'‰'X‚Í Game_Battler 'N'‰ # 'X‚Ì“ •”‚ÅŽg"p‚³‚ê‚Ü‚·B #================================================= ============================= class Game_BattleAction #-------------------------------------------------------------------------- # " 'ö J'C'“'X'^'“'X•Ï” #-------------------------------------------------------------------------- attr_accessor :spell_id # ‡‘Ì"‚"@"p'X'L'‹ ID attr_accessor :force_kind # Ž•Ê ( î"{ / 'X'L'‹ / 'A'C'e'€) attr_accessor :force_basic # î"{ (U'‚ / "h'ä / “¦‚°‚é) attr_accessor :force_skill_id # 'X'L'‹ ID #-------------------------------------------------------------------------- # " "L'ø”»’è #-------------------------------------------------------------------------- def valid? return (not (@force_kind == 0 and @force_basic == 3)) end end #================================================= ============================= # ¡ Game_Actor #------------------------------------------------------------------------------ # @'A'N'^[‚ðˆµ‚¤'N'‰'X‚Å‚·B‚±‚Ì' N'‰'X‚Í Game_Actors 'N'‰'X ($game_actors) # ‚Ì“ •”‚ÅŽg"p‚³‚êAGame_Party 'N'‰'X ($game_party) ‚©‚ç‚ ŽQÆ‚³‚ê‚Ü‚·B #================================================= ============================= class Game_Actor < Game_Battler def skill_can_use?(skill_id) return super end end #================================================= ============================= # ¡ Game_Enemy #------------------------------------------------------------------------------ # @'G'l'~[‚ðˆµ‚¤'N'‰'X‚Å‚·B‚±‚Ì' N'‰'X‚Í Game_Troop 'N'‰'X ($game_troop) ‚Ì # “ •”‚ÅŽg"p‚³‚ê‚Ü‚·B #================================================= ============================= class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # " 'ö J'C'“'X'^'“'X•Ï” #-------------------------------------------------------------------------- attr_accessor :height # ‰æ‘"‚Ì‚‚³ attr_accessor :real_x # XÀ•W•â³ attr_accessor :real_y # YÀ•W•â³ attr_accessor :real_zoom # g‘å"¦ #-------------------------------------------------------------------------- # " 'I'u'W'F'N'g‰ ú‰» # troop_id : 'g'‹['v ID # member_index : 'g'‹['v''“'o[‚Ì'C'“'f'b'N'X #-------------------------------------------------------------------------- def initialize(troop_id, member_index) super() @troop_id = troop_id @member_index = member_index troop = $data_troops[@troop_id] @enemy_id = troop.members[@member_index].enemy_id enemy = $data_enemies[@enemy_id] @battler_name = enemy.battler_name @battler_hue = enemy.battler_hue @hp = maxhp @sp = maxsp @real_x = 0 @real_y = 0 @real_zoom = 1.0 @fly = 0 enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {@fly = $1.to_i} @hidden = troop.members[@member_index].hidden @immortal = troop.members[@member_index].immortal end alias :true_x :screen_x alias :true_y :screen_y #-------------------------------------------------------------------------- # " 'o'g'‹‰æ"Ê X À•W‚̎擾 #-------------------------------------------------------------------------- def screen_x return 320 + (true_x - 320) * @real_zoom + @real_x end #-------------------------------------------------------------------------- # " 'o'g'‹‰æ"Ê Y À•W‚̎擾 #-------------------------------------------------------------------------- def screen_y return true_y * @real_zoom + @real_y end #-------------------------------------------------------------------------- # " 'o'g'‹‰æ"Ê Z À•W‚̎擾 #-------------------------------------------------------------------------- def screen_z return true_y + @fly end #-------------------------------------------------------------------------- # " 'o'g'‹‰æ"Ê g‘å"¦‚̎擾 #-------------------------------------------------------------------------- def zoom return ($scene.zoom_rate[1] - $scene.zoom_rate[0]) * (true_y + @fly) / 320 + $scene.zoom_rate[0] end #-------------------------------------------------------------------------- # " U'‚"pA'o'g'‹‰æ"Ê X À•W‚̎擾 #-------------------------------------------------------------------------- def attack_x(z) return (320 - true_x) * z * 0.75 end #-------------------------------------------------------------------------- # " U'‚"pA'o'g'‹‰æ"Ê Y À•W‚̎擾 #-------------------------------------------------------------------------- def attack_y(z) return (160 - (true_y + @fly / 4) * z + @height * zoom * z / 2) * 0.75 end #-------------------------------------------------------------------------- # " 'A'N'V'‡'“ì¬ #-------------------------------------------------------------------------- def make_action # 'J'''“'g'A'N'V'‡'“‚ð'N' 'A self.current_action.clear # “®‚¯‚È‚¢ê‡ unless self.inputable? # ''\'b'hI"¹ return end # '»Ý"L'ø‚È'A'N'V'‡'“‚ð’ o available_actions = [] rating_max = 0 for action in self.actions # '^['“ ð' m”F n = $game_temp.battle_turn a = action.condition_turn_a b = action.condition_turn_b if (b == 0 and n != a) or (b > 0 and (n < 1 or n < a or n % b != a % b)) next end # HP ð' m”F if self.hp * 100.0 / self.maxhp > action.condition_hp next end # '''x'‹ ð' m”F if $game_party.max_level < action.condition_level next end # 'X'C'b'` ð' m”F switch_id = action.condition_switch_id if switch_id > 0 and $game_switches[switch_id] == false next end # 'X'L'‹Žg"p‰Â”\ ð' m”F if action.kind == 1 unless self.skill_can_use?(action.skill_id) next end end # ð'‚É Y“" : ‚±‚Ì'A'N'V'‡'“‚ð’ljÁ available_actions.push(action) if action.rating > rating_max rating_max = action.rating end end # Å‘å‚Ì''['e'B'“'O’l‚ð 3 ‚Æ‚µ‚ć'v‚ð'vŽZ (0 ˆÈ‰º‚Í" O) ratings_total = 0 for action in available_actions if action.rating > rating_max - 3 ratings_total += action.rating - (rating_max - 3) end end # ''['e'B'“'O‚̇'v‚ª 0 ‚ł͂Ȃ¢ê‡ if ratings_total > 0 # "”‚ðì¬ value = rand(ratings_total) # 쬂µ‚½"”‚ɑΉž‚· é‚ ‚Ì‚ð'J'''“'g'A'N'V'‡'“‚É Ý’è for action in available_actions if action.rating > rating_max - 3 if value < action.rating - (rating_max - 3) self.current_action.kind = action.kind self.current_action.basic = action.basic self.current_action.skill_id = action.skill_id self.current_action.decide_random_target_for_enemy return else value -= action.rating - (rating_max - 3) end end end end end end #================================================= ============================= # ¡ Game_Party #------------------------------------------------------------------------------ # @'p['e'B‚ðˆµ‚¤'N'‰'X‚Å‚·B'S['‹'h‚â'A'C'e'€‚ȂǂÌî• ‚ª ܂܂ê‚Ü‚·B‚±‚Ì'N # '‰'X‚Ì'C'“'X'^'“'X‚Í $game_party ‚ÅŽQÆ‚³‚ê‚Ü‚·B #================================================= ============================= class Game_Party #-------------------------------------------------------------------------- # " ‘S"Å”»’è #-------------------------------------------------------------------------- def all_dead? # 'p['e'Bl”‚ª 0 l‚Ìê‡ if $game_party.actors.size == 0 return false end # HP 0 ˆÈã‚Ì'A'N'^[‚ª'p['e'B‚É‚¢‚éê‡ for actor in @actors if actor.rest_hp > 0 return false end end # ‘S"Å return true end #-------------------------------------------------------------------------- # " ‘ÎÛ'A'N'^[‚Ì'‰'“'_'€‚È'ˆ’è # hp0 : HP 0 ‚Ì'A'N'^[‚É'À‚é #-------------------------------------------------------------------------- # 'I' 'W'i'‹‚Ì'^['Q'b'g'ˆ’è'‹['`'“‚ð smooth_target_actor_rtab ‚Æ"¼‘O•ÏX alias :random_target_actor_rtab :random_target_actor def random_target_actor(hp0 = false) # '‹['''b'g‚ð‰ ú‰» roulette = [] # '‹['v for actor in @actors # ð'‚É Y“"‚·‚éê‡ if (not hp0 and actor.exist? and actor.rest_hp > 0) or (hp0 and actor.hp0?) # 'A'N'^[‚Ì'N'‰'X‚Ì [ˆÊ’u] ‚ðŽæ“¾ position = $data_classes[actor.class_id].position # ‘O‰q‚̂Ƃ« n = 4A’ ‰q‚̂Ƃ« n = 3A'ã‰q‚̂Ƃ« n = 2 n = 4 - position # '‹['''b'g‚É'A'N'^[‚ð n ‰ñ’ljÁ n.times do roulette.push(actor) end end end # '‹['''b'g‚Ì'T'C'Y‚ª 0 ‚Ìê‡ if roulette.size == 0 return random_target_actor_rtab(hp0) end # '‹['''b'g‚ð‰ñ‚µA'A'N'^[‚ð'ˆ’è return roulette[rand(roulette.size)] end #-------------------------------------------------------------------------- # " ‘ÎÛ'A'N'^[‚Ì'X'€['Y‚È'ˆ’è # actor_index : 'A'N'^['C'“'f'b'N'X #-------------------------------------------------------------------------- # 'I' 'W'i'‹‚Ì'^['Q'b'g'ˆ’è'‹['`'“‚ð smooth_target_actor_rtab ‚Æ"¼‘O•ÏX alias :smooth_target_actor_rtab :smooth_target_actor def smooth_target_actor(actor_index) # 'A'N'^[‚ðŽæ“¾ actor = @actors[actor_index] # 'A'N'^[‚ª‘¶Ý‚·‚éê‡ if actor != nil and actor.exist? and actor.rest_hp > 0 return actor end # '‹['v for actor in @actors # 'A'N'^[‚ª‘¶Ý‚·‚éê‡ if actor.exist? and actor.rest_hp > 0 return actor end end # "¡•û‚ª‘S"Å‚µ‚Ä‚¢‚éê ‡A'I' 'W'i'‹‚Ì'^['Q'b'g'ˆ’è'‹['`'“‚ðŽÀs‚·‚é return smooth_target_actor_rtab(actor_index) end end #================================================= ============================= # ¡ Game_Troop #------------------------------------------------------------------------------ # @'g'‹['v‚ðˆµ‚¤'N'‰'X‚Å‚·B‚±‚ 'N'‰'X‚Ì'C'“'X'^'“'X‚Í $game_troop ‚ÅŽQÆ‚³ # ‚ê‚Ü‚·B #================================================= ============================= class Game_Troop #-------------------------------------------------------------------------- # " ‘ÎÛ'G'l'~[‚Ì'‰'“'_'€‚È'ˆ’è # hp0 : HP 0 ‚Ì'G'l'~[‚É'À‚é #-------------------------------------------------------------------------- # 'I' 'W'i'‹‚Ì'^['Q'b'g'ˆ’è'‹['`'“‚ð random_target_enemy_rtab ‚Æ"¼‘O•ÏX alias :random_target_enemy_rtab :random_target_enemy def random_target_enemy(hp0 = false) # '‹['''b'g‚ð‰ ú‰» roulette = [] # '‹['v for enemy in @enemies # ð'‚É Y“"‚·‚éê‡ if (not hp0 and enemy.exist? and enemy.rest_hp > 0) or (hp0 and enemy.hp0?) # '‹['''b'g‚É'G'l'~[‚ð’ljÁ roulette.push(enemy) end end # '‹['''b'g‚Ì'T'C'Y‚ª 0 ‚Ìê‡ if roulette.size == 0 return random_target_enemy_rtab(hp0) end # '‹['''b'g‚ð‰ñ‚µA'G'l'~[‚ð'ˆ’è return roulette[rand(roulette.size)] end #-------------------------------------------------------------------------- # " ‘ÎÛ'G'l'~[‚Ì'X'€['Y‚È'ˆ’è # enemy_index : 'G'l'~['C'“'f'b'N'X #-------------------------------------------------------------------------- # 'I' 'W'i'‹‚Ì'^['Q'b'g'ˆ’è'‹['`'“‚ð smooth_target_enemy_rtab ‚Æ"¼‘O•ÏX alias :smooth_target_enemy_rtab :smooth_target_enemy def smooth_target_enemy(enemy_index) # 'G'l'~[‚ðŽæ“¾ enemy = @enemies[enemy_index] # 'G'l'~[‚ª‘¶Ý‚·‚éê‡ if enemy != nil and enemy.exist? and enemy.rest_hp > 0 return enemy end # '‹['v for enemy in @enemies # 'G'l'~[‚ª‘¶Ý‚·‚éê‡ if enemy.exist? and enemy.rest_hp > 0 return enemy end end # “G‚ª‘S"Å‚µ‚Ä‚¢‚éê‡A Ä“x“G‚Ì'Ÿõ‚ðs‚¤ return smooth_target_enemy_rtab(enemy_index) end end #================================================= ============================= # ¡ Sprite_Battler #------------------------------------------------------------------------------ # @'o'g'‰[•\ަ"p‚Ì'X'v'‰'C'g‚Å‚·BGam e_Battler 'N'‰'X‚Ì'C'“'X'^'“'X‚ð ÄŽ‹‚µA # 'X'v'‰'C'g‚Ìó‘"‚ðŽ©“®“I ɕω»‚³‚¹‚Ü‚·B #================================================= ============================= class Sprite_Battler < RPG::Sprite #-------------------------------------------------------------------------- # " 't''['€XV #-------------------------------------------------------------------------- def update super # 'o'g'‰[‚ª nil ‚Ìê‡ if @battler == nil self.bitmap = nil loop_animation(nil) return end # 't'@'C'‹"¼‚©F‘ ‚ª'»Ý‚Ì‚ ‚̂ƈقȂéê‡ if @battler.battler_name != @battler_name or @battler.battler_hue != @battler_hue # 'r'b'g'}'b'v‚ðŽæ“¾AÝ’è @battler_name = @battler.battler_name @battler_hue = @battler.battler_hue self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue) @width = bitmap.width @height = bitmap.height self.ox = @width / 2 self.oy = @height if @battler.is_a?(Game_Enemy) @battler.height = @height end # “¬•s”\‚Ü‚½‚͉B‚êó‘" È‚ç•s“§"¾“x‚ð 0 ‚É‚·‚é if @battler.dead? or @battler.hidden self.opacity = 0 end end # 'A'j'['V'‡'“ ID ‚ª'»Ý‚Ì‚ ‚̂ƈقȂéê‡ if @battler.state_animation_id != @state_animation_id @state_animation_id = @battler.state_animation_id loop_animation($data_animations[@state_animation_id]) end # •\ަ‚³‚ê‚é‚-‚«'A'N'^[‚Ìê‡ if @battler.is_a?(Game_Actor) and @battler_visible # ''C'“'t'F['Y‚łȂ¢‚Æ‚«‚Í•s“§"¾“ x‚ð‚â‚≺‚°‚é if $game_temp.battle_main_phase self.opacity += 3 if self.opacity < 255 else self.opacity -= 3 if self.opacity > 207 end end # "¾"Å if @battler.blink blink_on else blink_off end # •s‰ÂŽ‹‚Ìê‡ unless @battler_visible # o'» if not @battler.hidden and not @battler.dead? and (@battler.damage.size < 2 or @battler.damage_pop.size < 2) appear @battler_visible = true end end # '_'['W for battler in @battler.damage_pop if battler[0].class == Array if battler[0][1] >= 0 $scene.skill_se else $scene.levelup_se end damage(@battler.damage[battler[0]], false, 2) else damage(@battler.damage[battler[0]], @battler.critical[battler[0]]) end if @battler.damage_sp.include?(battler[0]) damage(@battler.damage_sp[battler[0]], @battler.critical[battler[0]], 1) @battler.damage_sp.delete(battler[0]) end @battler.damage_pop.delete(battler[0]) @battler.damage.delete(battler[0]) @battler.critical.delete(battler[0]) end # ‰ÂŽ‹‚Ìê‡ if @battler_visible # “¦‘" if @battler.hidden $game_system.se_play($data_system.escape_se) escape @battler_visible = false end # ”’'t'‰'b'V'… if @battler.white_flash whiten @battler.white_flash = false end # 'A'j'['V'‡'“ unless @battler.animation.empty? for animation in @battler.animation.reverse animation($data_animations[animation[0]], animation[1]) @battler.animation.delete(animation) end end # 'R'‰'v'X if @battler.damage.empty? and @battler.dead? if $scene.dead_ok?(@battler) if @battler.is_a?(Game_Enemy) $game_system.se_play($data_system.enemy_collapse_s e) else $game_system.se_play($data_system.actor_collapse_s e) end collapse @battler_visible = false end end end # 'X'v'‰'C'g‚ÌÀ•W‚ðÝ’è self.x = @battler.screen_x self.y = @battler.screen_y self.z = @battler.screen_z if @battler.is_a?(Game_Enemy) self.zoom_x = @battler.real_zoom * @battler.zoom self.zoom_y = @battler.real_zoom * @battler.zoom end end end #================================================= ============================= # ¡ Window_Base #------------------------------------------------------------------------------ # @'Q['€’ ‚Ì‚·‚-‚Ä‚Ì'E'B'“'h'E‚Ì'X['p['N'‰'X‚Å‚·B #================================================= ============================= class Window_Base < Window #-------------------------------------------------------------------------- # " 'Q['W‚Ì•`‰æ #-------------------------------------------------------------------------- def gauge_rect_at(width, height, align3, color1, color2, color3, color4, color5, color6, color7, color8, color9, color10, color11, color12, grade1, grade2) # ˜g•`‰æ @at_gauge = Bitmap.new(width, height * 5) @at_gauge.fill_rect(0, 0, width, height, color1) @at_gauge.fill_rect(1, 1, width - 2, height - 2, color2) if (align3 == 1 and grade1 == 0) or grade1 > 0 color = color3 color3 = color4 color4 = color end if (align3 == 1 and grade2 == 0) or grade2 > 0 color = color5 color5 = color6 color6 = color color = color7 color7 = color8 color8 = color color = color9 color9 = color10 color10 = color color = color11 color11 = color12 color12 = color end if align3 == 0 if grade1 == 2 grade1 = 3 end if grade2 == 2 grade2 = 3 end end # ‹ó'Q['W‚Ì•`‰æ c‚É'O'‰'f['V'‡'“•\ަ @at_gauge.gradation_rect(2, 2, width - 4, height - 4, color3, color4, grade1) # ŽÀ'Q['W‚Ì•`‰æ @at_gauge.gradation_rect(2, height + 2, width- 4, height - 4, color5, color6, grade2) @at_gauge.gradation_rect(2, height * 2 + 2, width- 4, height - 4, color7, color8, grade2) @at_gauge.gradation_rect(2, height * 3 + 2, width- 4, height - 4, color9, color10, grade2) @at_gauge.gradation_rect(2, height * 4 + 2, width- 4, height - 4, color11, color12, grade2) end end #================================================= ============================= # ¡ Window_Help #------------------------------------------------------------------------------ # @'X'L'‹‚â'A'C'e'€‚Ì "¾A'A'N'^[‚Ì'X'e['^'X‚Ȃǂð•\ަ‚·‚é'E'B'“ 'h'E‚Å‚·B #================================================= ============================= class Window_Help < Window_Base #-------------------------------------------------------------------------- # " 'G'l'~[Ý’è # enemy : "¼‘O‚Æ'X'e['g‚ð•\ަ‚·‚é'G'l'~[ #-------------------------------------------------------------------------- def set_enemy(enemy) text = enemy.name.sub(/\\[Ff]\[([0-9]+)\]/) {""} state_text = make_battler_state_text(enemy, 112, false) if state_text != "" text += " " + state_text end set_text(text, 1) end end #================================================= ============================= # ¡ Window_BattleStatus #------------------------------------------------------------------------------ # @'o'g'‹‰æ"Ê‚Å'p['e'B''“'o[‚Ì'X'e['^'X‚ð•\ަ‚·‚é'E'B'“'h'E‚ ‚·B #================================================= ============================= class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # " 'I'u'W'F'N'g‰ ú‰» #-------------------------------------------------------------------------- def initialize x = (4 - $game_party.actors.size) * 80 width = $game_party.actors.size * 160 super(x, 320, width, 160) self.back_opacity = 160 @actor_window = [] for i in 0...$game_party.actors.size @actor_window.push(Window_ActorStatus.new(i, x + i * 160)) end @level_up_flags = [false, false, false, false] refresh end #-------------------------------------------------------------------------- # " ‰ð•ú #-------------------------------------------------------------------------- def dispose for window in @actor_window window.dispose end super end #-------------------------------------------------------------------------- # " ' 't'''b'V'… #-------------------------------------------------------------------------- def refresh(number = 0) if number == 0 cnt = 0 for window in @actor_window window.refresh(@level_up_flags[cnt]) cnt += 1 end else @actor_window[number - 1].refresh(@level_up_flags[number - 1]) end end #-------------------------------------------------------------------------- # " AT'Q['W' 't'''b'V'… #-------------------------------------------------------------------------- def at_refresh(number = 0) if number == 0 for window in @actor_window window.at_refresh end else @actor_window[number - 1].at_refresh end end #-------------------------------------------------------------------------- # " 't''['€XV #-------------------------------------------------------------------------- def update super if self.x != (4 - $game_party.actors.size) * 80 self.x = (4 - $game_party.actors.size) * 80 self.width = $game_party.actors.size * 160 for window in @actor_window window.dispose end @actor_window = [] for i in 0...$game_party.actors.size @actor_window.push(Window_ActorStatus.new(i, x + i * 160)) end refresh end for window in @actor_window window.update end end end #================================================= ============================= # ¡ Window_ActorStatus #------------------------------------------------------------------------------ # @'o'g'‹‰æ"Ê‚Å'p['e'B''“'o[‚Ì'X'e['^'X‚ð‚»‚ê‚¼‚ê•\ަ‚·‚é 'E'B'“'h'E‚Å‚·B #================================================= ============================= class Window_ActorStatus < Window_Base #-------------------------------------------------------------------------- # " 'I'u'W'F'N'g‰ ú‰» #-------------------------------------------------------------------------- def initialize(id, x) @actor_num = id super(x, 320, 160, 160) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 self.back_opacity = 0 actor = $game_party.actors[@actor_num] @actor_nm = actor.name @actor_mhp = actor.maxhp @actor_msp = actor.maxsp @actor_hp = actor.hp @actor_sp = actor.sp @actor_st = make_battler_state_text(actor, 120, true) @status_window = [] for i in 0...5 @status_window.push(Window_DetailsStatus.new(actor , i, x)) end refresh(false) end #-------------------------------------------------------------------------- # " ‰ð•ú #-------------------------------------------------------------------------- def dispose for i in 0...5 @status_window[i].dispose end super end #-------------------------------------------------------------------------- # " ' 't'''b'V'… #-------------------------------------------------------------------------- def refresh(level_up_flags) self.contents.clear actor = $game_party.actors[@actor_num] @status_window[0].refresh(actor) if @actor_nm != actor.name @status_window[1].refresh(actor) if @actor_mhp != actor.maxhp or @actor_hp != actor.hp @status_window[2].refresh(actor) if @actor_msp != actor.maxsp or @actor_sp != actor.sp @status_window[3].refresh(actor, level_up_flags) if @actor_st != make_battler_state_text(actor, 120, true) or level_up_flags @actor_nm = actor.name @actor_mhp = actor.maxhp @actor_msp = actor.maxsp @actor_hp = actor.hp @actor_sp = actor.sp @actor_st = make_battler_state_text(actor, 120, true) end #-------------------------------------------------------------------------- # " AT'Q['W' 't'''b'V'… #-------------------------------------------------------------------------- def at_refresh @status_window[4].refresh($game_party.actors[@actor_num]) end #-------------------------------------------------------------------------- # " 't''['€XV #-------------------------------------------------------------------------- def update for window in @status_window window.update end end end #================================================= ============================= # ¡ Window_DetailsStatus #------------------------------------------------------------------------------ # @'o'g'‹‰æ"Ê‚Å'A'N'^[‚Ì'X'e['^'X‚ð'ÂX‚É•\ަ‚·‚é'E'B' 'h'E‚Å‚·B #================================================= ============================= class Window_DetailsStatus < Window_Base #-------------------------------------------------------------------------- # " 'I'u'W'F'N'g‰ ú‰» #-------------------------------------------------------------------------- def initialize(actor, id, x) @status_id = id super(x, 320 + id * 26, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 self.back_opacity = 0 refresh(actor, false) end #-------------------------------------------------------------------------- # " ‰ð•ú #-------------------------------------------------------------------------- def dispose super end #-------------------------------------------------------------------------- # " ' 't'''b'V'… #-------------------------------------------------------------------------- def refresh(actor, level_up_flags = false) self.contents.clear case @status_id when 0 draw_actor_name(actor, 4, 0) when 1 draw_actor_hp(actor, 4, 0, 120) when 2 draw_actor_sp(actor, 4, 0, 120) when 3 if level_up_flags $defaultfonttype = $fontface = $fontname = Font.default_name #self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120, 32, "¡Sube nivel!") else draw_actor_state(actor, 4, 0) end when 4 draw_actor_atg(actor, 4, 0, 120) end end #-------------------------------------------------------------------------- # " 't''['€XV #-------------------------------------------------------------------------- def update # ''C'“'t'F['Y‚̂Ƃ«‚Í•s“§"¾“x‚ð‚ ‚â‰º‚°‚é if $game_temp.battle_main_phase self.contents_opacity -= 4 if self.contents_opacity > 191 else self.contents_opacity += 4 if self.contents_opacity < 255 end end end #================================================= ============================= # ¡ Arrow_Base #------------------------------------------------------------------------------ # @'o'g'‹‰æ"ʂŎg"p‚·‚é'A '['J['\'‹•\ަ"p‚Ì'X'v'‰'C'g‚Å‚ ·B‚±‚Ì'N'‰'X‚Í # Arrow_Enemy 'N'‰'X‚Æ Arrow_Actor 'N'‰'X‚Ì'X['p['N'‰'X‚Æ‚µ‚ÄŽg"p‚³‚ê‚Ü ·B #================================================= ============================= class Arrow_Base < Sprite #-------------------------------------------------------------------------- # " 'I'u'W'F'N'g‰ ú‰» # viewport : 'r'…['|['g #-------------------------------------------------------------------------- def initialize(viewport) super(viewport) self.bitmap = RPG::Cache.windowskin($game_system.windowskin_name ) self.ox = 16 self.oy = 32 self.z = 2500 @blink_count = 0 @index = 0 @help_window = nil update end end #================================================= ============================= # ¡ Arrow_Enemy #------------------------------------------------------------------------------ # @'G'l'~[‚ð‘I‘ð‚³‚¹‚邽‚ß‚Ì'A' ['J['\'‹‚Å‚·B‚±‚Ì'N'‰'X‚Í Arrow_Base 'N'‰ # 'X‚ð'p³‚µ‚Ü‚·B #================================================= ============================= class Arrow_Enemy < Arrow_Base #-------------------------------------------------------------------------- # " 't''['€XV #-------------------------------------------------------------------------- def update super # ‘¶Ý‚µ‚È‚¢'G'l'~[‚ðŽw‚µ‚Ä‚¢‚½‚ç”ò‚΂· $game_troop.enemies.size.times do break if self.enemy.exist? @index += 1 @index %= $game_troop.enemies.size end # 'J['\'‹‰E if Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) $game_troop.enemies.size.times do @index += 1 @index %= $game_troop.enemies.size break if self.enemy.exist? end $scene.camera = "select" zoom = 1 / self.enemy.zoom $scene.spriteset.screen_target(self.enemy.attack_x (zoom) * 0.75, self.enemy.attack_y(zoom) * 0.75, zoom) end # 'J['\'‹¶ if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) $game_troop.enemies.size.times do @index += $game_troop.enemies.size - 1 @index %= $game_troop.enemies.size break if self.enemy.exist? end $scene.camera = "select" zoom = 1 / self.enemy.zoom $scene.spriteset.screen_target(self.enemy.attack_x (zoom) * 0.75, self.enemy.attack_y(zoom) * 0.75, zoom) end # 'X'v'‰'C'g‚ÌÀ•W‚ðÝ’è if self.enemy != nil self.x = self.enemy.screen_x self.y = self.enemy.screen_y end end end #================================================= ============================= # ¡ Interpreter #------------------------------------------------------------------------------ # @'C'x'“'g'R'}'“'h‚ðŽÀs‚· é'C'“'^'v' '^‚Å‚·B‚±‚Ì'N'‰'X‚Í Game_System 'N'‰ # 'X‚â Game_Event 'N'‰'X‚Ì“ •”‚ÅŽg"p‚³‚ê‚Ü‚·B #================================================= ============================= class Interpreter #-------------------------------------------------------------------------- # " 'A'N'^[‚Ì“ü‚ê‘-‚¦ #-------------------------------------------------------------------------- def command_129 # 'A'N'^[‚ðŽæ“¾ actor = $game_actors[@parameters[0]] # 'A'N'^[‚ª"L'ø‚Ìê‡ if actor != nil # ‘€ì‚Å•ª ò if @parameters[1] == 0 if @parameters[2] == 1 $game_actors[@parameters[0]].setup(@parameters[0]) end $game_party.add_actor(@parameters[0]) if $game_temp.in_battle $game_actors[@parameters[0]].at = 0 $game_actors[@parameters[0]].atp = 0 $scene.spell_reset($game_actors[@parameters[0]]) $game_actors[@parameters[0]].damage_pop = {} $game_actors[@parameters[0]].damage = {} $game_actors[@parameters[0]].damage_sp = {} $game_actors[@parameters[0]].critical = {} $game_actors[@parameters[0]].recover_hp = {} $game_actors[@parameters[0]].recover_sp = {} $game_actors[@parameters[0]].state_p = {} $game_actors[@parameters[0]].state_m = {} $game_actors[@parameters[0]].animation = [] end else $game_party.remove_actor(@parameters[0]) end end if $game_temp.in_battle $scene.status_window.update end # 'p‘± return true end #-------------------------------------------------------------------------- # " HP ‚Ì‘'¸ #-------------------------------------------------------------------------- alias :command_311_rtab :command_311 def command_311 command_311_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " SP ‚Ì‘'¸ #-------------------------------------------------------------------------- alias :command_312_rtab :command_312 def command_312 command_312_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " 'X'e['g‚Ì•ÏX #-------------------------------------------------------------------------- alias :command_313_rtab :command_313 def command_313 command_313_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " ‘S‰ñ•" #-------------------------------------------------------------------------- alias :command_314_rtab :command_314 def command_314 command_314_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " EXP ‚Ì‘'¸ #-------------------------------------------------------------------------- alias :command_315_rtab :command_315 def command_315 command_315_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " '''x'‹‚Ì‘'¸ #-------------------------------------------------------------------------- alias :command_316_rtab :command_316 def command_316 command_316_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " 'p'‰'['^‚Ì‘'¸ #-------------------------------------------------------------------------- alias :command_317_rtab :command_317 def command_317 command_317_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " ‘•”õ‚Ì•ÏX #-------------------------------------------------------------------------- alias :command_319_rtab :command_319 def command_319 command_319_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " 'A'N'^[‚Ì"¼‘O•ÏX #-------------------------------------------------------------------------- alias :command_320_rtab :command_320 def command_320 command_320_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " 'A'N'^[‚Ì'N'‰'X•ÏX #-------------------------------------------------------------------------- alias :command_321_rtab :command_321 def command_321 command_321_rtab if $game_temp.in_battle $scene.status_window.refresh end end #-------------------------------------------------------------------------- # " 'A'j'['V'‡'“‚Ì•\ަ #-------------------------------------------------------------------------- def command_337 # 'C'e''['^‚ň" iterate_battler(@parameters[0], @parameters[1]) do |battler| # 'o'g'‰[‚ª‘¶Ý‚·‚éê‡ if battler.exist? # 'A'j'['V'‡'“ ID ‚ðÝ’è battler.animation.push([@parameters[2], true]) end end # 'p‘± return true end #-------------------------------------------------------------------------- # " '_'['W‚̈" #-------------------------------------------------------------------------- def command_338 # ‘€ì‚·‚é’l‚ðŽæ“¾ value = operate_value(0, @parameters[2], @parameters[3]) # 'C'e''['^‚ň" iterate_battler(@parameters[0], @parameters[1]) do |battler| # 'o'g'‰[‚ª‘¶Ý‚·‚éê‡ if battler.exist? # HP ‚ð•ÏX battler.hp -= value # “¬’ ‚È‚ç if $game_temp.in_battle # '_'['W‚ðÝ’è battler.damage["event"] = value battler.damage_pop["event"] = true end end end if $game_temp.in_battle $scene.status_window.refresh end # 'p‘± return true end #-------------------------------------------------------------------------- # " 'A'N'V'‡'“‚Ì‹§ #-------------------------------------------------------------------------- def command_339 # “¬’ ‚łȂ¯‚ê‚Î"³Ž‹ unless $game_temp.in_battle return true end # '^['“”‚ª 0 ‚È‚ç"³Ž‹ if $game_temp.battle_turn == 0 return true end # 'C'e''['^‚ň" (•-‹X“I‚È‚ ‚Ì‚ÅA•¡”‚ɂȂ邱‚Æ Í‚È‚¢) iterate_battler(@parameters[0], @parameters[1]) do |battler| # 'o'g'‰[‚ª‘¶Ý‚·‚éê‡ if battler.exist? # 'A'N'V'‡'“‚ðÝ’è battler.current_action.force_kind = @parameters[2] if battler.current_action.force_kind == 0 battler.current_action.force_basic = @parameters[3] else battler.current_action.force_skill_id = @parameters[3] end # s“®‘ÎÛ‚ðÝ’è if @parameters[4] == -2 if battler.is_a?(Game_Enemy) battler.current_action.decide_last_target_for_enem y else battler.current_action.decide_last_target_for_acto r end elsif @parameters[4] == -1 if battler.is_a?(Game_Enemy) battler.current_action.decide_random_target_for_en emy else battler.current_action.decide_random_target_for_ac tor end elsif @parameters[4] >= 0 battler.current_action.target_index = @parameters[4] end # 'A'N'V'‡'“‚ª"L'ø‚©‚ [‚·‚®‚ÉŽÀs] ‚Ìê‡ if battler.current_action.valid? and @parameters[5] == 1 # ‹§‘ÎÛ‚Ì'o'g'‰[‚ðÝ’è $game_temp.forcing_battler = battler # 'C'“'f'b'N'X‚ði‚ß‚é @index += 1 # I"¹ return false elsif battler.current_action.valid? and @parameters[5] == 0 battler.current_action.forcing = true end end end # 'p‘± return true end end #================================================= ============================= # ¡ Sprite'‚'W'…['‹ #------------------------------------------------------------------------------ # @'A'j'['V'‡'“‚Ì Ç"‚ðs‚¤'‚'W'…['‹‚Å‚·B #================================================= ============================= module RPG class Sprite < ::Sprite def initialize(viewport = nil) super(viewport) @_whiten_duration = 0 @_appear_duration = 0 @_escape_duration = 0 @_collapse_duration = 0 @_damage = [] @_animation = [] @_animation_duration = 0 @_blink = false end def damage(value, critical, type = 0) if value.is_a?(Numeric) damage_string = value.abs.to_s else damage_string = value.to_s end bitmap = Bitmap.new(160, 48) #bitmap.font.name = "Arial Black" $defaultfonttype = $fontface = $fontname = Font.default_name bitmap.font.size = 32 bitmap.font.color.set(0, 0, 0) bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1) bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1) bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1) bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1) if value.is_a?(Numeric) and value < 0 if type == 0 bitmap.font.color.set(176, 255, 144) else bitmap.font.color.set(176, 144, 255) end else if type == 0 bitmap.font.color.set(255, 255, 255) else bitmap.font.color.set(255, 176, 144) end end if type == 2 bitmap.font.color.set(255, 224, 128) end bitmap.draw_text(0, 12, 160, 36, damage_string, 1) if critical string = "Crtico" bitmap.font.size = 20 bitmap.font.color.set(0, 0, 0) bitmap.draw_text(-1, -1, 160, 20, string, 1) bitmap.draw_text(+1, -1, 160, 20, string, 1) bitmap.draw_text(-1, +1, 160, 20, string, 1) bitmap.draw_text(+1, +1, 160, 20, string, 1) bitmap.font.color.set(255, 255, 255) bitmap.draw_text(0, 0, 160, 20, string, 1) end num = @_damage.size if type != 2 @_damage.push([::Sprite.new, 40, 0, rand(40) - 20, rand(30) + 50]) else @_damage.push([::Sprite.new, 40, 0, rand(20) - 10, rand(20) + 60]) end @_damage[num][0].bitmap = bitmap @_damage[num][0].ox = 80 + self.viewport.ox @_damage[num][0].oy = 20 + self.viewport.oy if self.battler.is_a?(Game_Actor) @_damage[num][0].x = self.x @_damage[num][0].y = self.y - self.oy / 2 else @_damage[num][0].x = self.x + self.viewport.rect.x - self.ox + self.src_rect.width / 2 @_damage[num][0].y = self.y - self.oy * self.zoom_y / 2 + self.viewport.rect.y @_damage[num][0].zoom_x = self.zoom_x @_damage[num][0].zoom_y = self.zoom_y @_damage[num][0].z = 3000 end end def animation(animation, hit) return if animation == nil num = @_animation.size @_animation.push([animation, hit, animation.frame_max, []]) bitmap = RPG::Cache.animation(animation.animation_name, animation.animation_hue) if @@_reference_count.include?(bitmap) @@_reference_count[bitmap] += 1 else @@_reference_count[bitmap] = 1 end if @_animation[num][0] != 3 or not @@_animations.include?(animation) for i in 0..15 sprite = ::Sprite.new sprite.bitmap = bitmap sprite.visible = false @_animation[num][3].push(sprite) end unless @@_animations.include?(animation) @@_animations.push(animation) end end update_animation(@_animation[num]) end def loop_animation(animation) return if animation == @_loop_animation dispose_loop_animation @_loop_animation = animation return if @_loop_animation == nil @_loop_animation_index = 0 animation_name = @_loop_animation.animation_name animation_hue = @_loop_animation.animation_hue bitmap = RPG::Cache.animation(animation_name, animation_hue) if @@_reference_count.include?(bitmap) @@_reference_count[bitmap] += 1 else @@_reference_count[bitmap] = 1 end @_loop_animation_sprites = [] for i in 0..15 sprite = ::Sprite.new sprite.bitmap = bitmap sprite.visible = false @_loop_animation_sprites.push(sprite) end # update_loop_animation end def dispose_damage for damage in @_damage.reverse damage[0].bitmap.dispose damage[0].dispose @_damage.delete(damage) end end def dispose_animation for anime in @_animation.reverse sprite = anime[3][0] if sprite != nil @@_reference_count[sprite.bitmap] -= 1 if @@_reference_count[sprite.bitmap] == 0 sprite.bitmap.dispose end end for sprite in anime[3] sprite.dispose end @_animation.delete(anime) end end def effect? @_whiten_duration > 0 or @_appear_duration > 0 or @_escape_duration > 0 or @_collapse_duration > 0 or @_damage.size == 0 or @_animation.size == 0 end def update super if @_whiten_duration > 0 @_whiten_duration -= 1 self.color.alpha = 128 - (16 - @_whiten_duration) * 10 end if @_appear_duration > 0 @_appear_duration -= 1 self.opacity = (16 - @_appear_duration) * 16 end if @_escape_duration > 0 @_escape_duration -= 1 self.opacity = 256 - (32 - @_escape_duration) * 10 end if @_collapse_duration > 0 @_collapse_duration -= 1 self.opacity = 256 - (48 - @_collapse_duration) * 6 end for damage in @_damage if damage[1] > 0 damage[1] -= 1 damage[4] -= 3 damage[2] -= damage[4] if self.battler.is_a?(Game_Actor) damage[0].x = self.x + (40 - damage[1]) * damage[3] / 10 damage[0].y = self.y - self.oy / 2 + damage[2] / 10 else damage[0].x = self.x + self.viewport.rect.x - self.ox + self.src_rect.width / 2 + (40 - damage[1]) * damage[3] / 10 damage[0].y = self.y - self.oy * self.zoom_y / 2 + self.viewport.rect.y + damage[2] / 10 damage[0].zoom_x = self.zoom_x damage[0].zoom_y = self.zoom_y end damage[0].z = 2960 + damage[1] damage[0].opacity = 256 - (12 - damage[1]) * 32 if damage[1] == 0 damage[0].bitmap.dispose damage[0].dispose @_damage.delete(damage) end end end for anime in @_animation if (Graphics.frame_count % 2 == 0) anime[2] -= 1 update_animation(anime) end end if @_loop_animation != nil and (Graphics.frame_count % 2 == 0) update_loop_animation @_loop_animation_index += 1 @_loop_animation_index %= @_loop_animation.frame_max end if @_blink @_blink_count = (@_blink_count + 1) % 32 if @_blink_count < 16 alpha = (16 - @_blink_count) * 6 else alpha = (@_blink_count - 16) * 6 end self.color.set(255, 255, 255, alpha) end @@_animations.clear end def update_animation(anime) if anime[2] > 0 frame_index = anime[0].frame_max - anime[2] cell_data = anime[0].frames[frame_index].cell_data position = anime[0].position animation_set_sprites(anime[3], cell_data, position) for timing in anime[0].timings if timing.frame == frame_index animation_process_timing(timing, anime[1]) end end else @@_reference_count[anime[3][0].bitmap] -= 1 if @@_reference_count[anime[3][0].bitmap] == 0 anime[3][0].bitmap.dispose end for sprite in anime[3] sprite.dispose end @_animation.delete(anime) end end def animation_set_sprites(sprites, cell_data, position) for i in 0..15 sprite = sprites[i] pattern = cell_data[i, 0] if sprite == nil or pattern == nil or pattern == -1 sprite.visible = false if sprite != nil next end sprite.visible = true sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) if position == 3 if self.viewport != nil sprite.x = self.viewport.rect.width / 2 if $game_temp.in_battle and self.battler.is_a?(Game_Enemy) sprite.y = self.viewport.rect.height - 320 else sprite.y = self.viewport.rect.height - 160 end else sprite.x = 320 sprite.y = 240 end else sprite.x = self.x + self.viewport.rect.x - self.ox + self.src_rect.width / 2 if $game_temp.in_battle and self.battler.is_a?(Game_Enemy) sprite.y = self.y - self.oy * self.zoom_y / 2 + self.viewport.rect.y if position == 0 sprite.y -= self.src_rect.height * self.zoom_y / 4 elsif position == 2 sprite.y += self.src_rect.height * self.zoom_y / 4 end else sprite.y = self.y + self.viewport.rect.y - self.oy + self.src_rect.height / 2 sprite.y -= self.src_rect.height / 4 if position == 0 sprite.y += self.src_rect.height / 4 if position == 2 end end sprite.x += cell_data[i, 1] sprite.y += cell_data[i, 2] sprite.z = 2000 sprite.ox = 96 sprite.oy = 96 sprite.zoom_x = cell_data[i, 3] / 100.0 sprite.zoom_y = cell_data[i, 3] / 100.0 if position != 3 sprite.zoom_x *= self.zoom_x sprite.zoom_y *= self.zoom_y end sprite.angle = cell_data[i, 4] sprite.mirror = (cell_data[i, 5] == 1) sprite.opacity = cell_data[i, 6] * self.opacity / 255.0 sprite.blend_type = cell_data[i, 7] end end def x=(x) sx = x - self.x if sx != 0 for anime in @_animation if anime[3] != nil for i in 0..15 anime[3][i].x += sx end end end if @_loop_animation_sprites != nil for i in 0..15 @_loop_animation_sprites[i].x += sx end end end super end def y=(y) sy = y - self.y if sy != 0 for anime in @_animation if anime[3] != nil for i in 0..15 anime[3][i].y += sy end end end if @_loop_animation_sprites != nil for i in 0..15 @_loop_animation_sprites[i].y += sy end end end super end end end #------------------------------------------------------------------------------ # @Bitmap'N'‰'X‚ÉV‚½‚È‹@”\‚ ’ljÁ‚µ‚Ü‚·B #================================================= ============================= class Bitmap #-------------------------------------------------------------------------- # " ‹é'`‚ð'O'‰'f['V'‡'“•\ަ # color1 : 'X'^['g'J'‰[ # color2 : 'G'“'h'J'‰[ # align : 0:‰¡‚É'O'‰'f['V'‡'“ # 1:c‚É'O'‰'f['V'‡'“ # 2:ŽÎ‚ß‚É'O'‰'f['V'‡'“i''d‚ɂ‚«’ˆ"j #-------------------------------------------------------------------------- def gradation_rect(x, y, width, height, color1, color2, align = 0) if align == 0 for i in x...x + width red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1) green = color1.green + (color2.green - color1.green) * (i - x) / (width - 1) blue = color1.blue + (color2.blue - color1.blue) * (i - x) / (width - 1) alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - x) / (width - 1) color = Color.new(red, green, blue, alpha) fill_rect(i, y, 1, height, color) end elsif align == 1 for i in y...y + height red = color1.red + (color2.red - color1.red) * (i - y) / (height - 1) green = color1.green + (color2.green - color1.green) * (i - y) / (height - 1) blue = color1.blue + (color2.blue - color1.blue) * (i - y) / (height - 1) alpha = color1.alpha + (color2.alpha - color1.alpha) * (i - y) / (height - 1) color = Color.new(red, green, blue, alpha) fill_rect(x, i, width, 1, color) end elsif align == 2 for i in x...x + width for j in y...y + height red = color1.red + (color2.red - color1.red) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color1.green + (color2.green - color1.green) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color1.blue + (color2.blue - color1.blue) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color1.alpha + (color2.alpha - color1.alpha) * ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end elsif align == 3 for i in x...x + width for j in y...y + height red = color1.red + (color2.red - color1.red) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 green = color1.green + (color2.green - color1.green) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 blue = color1.blue + (color2.blue - color1.blue) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 alpha = color1.alpha + (color2.alpha - color1.alpha) * ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2 color = Color.new(red, green, blue, alpha) set_pixel(i, j, color) end end end end end[/codebox] 2-Nombre: Active Time Battle Autor: Fukuyama Script:
Spoiler
================================================== ============================# New_Battle#------------------------------------------------------------------------------# Compiled By : MakirouAru#======================================= =======================================# XRXS_BP 3. HP ver.1.01 # by fukuyama, ݓy# Battle_End_Recovery## 퓬̉W[## Request: stay# Script: fukuyama# Test: mRmq## URL: http://www4.big.or.jp/~fukuyama/rgss/Battle_End_Recovery.txt#module Battle_End_Recoverymodule Scene_Battle_Module# ϐID@@recovery_rate_variable_id = nil# ̎擾def battle_end_recovery_rate if @@recovery_rate_variable_id.nil? @@recovery_rate_variable_id = $data_system.variables.index '퓬̉' if @@recovery_rate_variable_id.nil? @@recovery_rate_variable_id = false end end return 0 unless @@recovery_rate_variable_id return $game_variables[@@recovery_rate_variable_id]end# 퓬̉def battle_end_recovery # recovery_rate = battle_end_recovery_rate # ϐOȊOAN^[ĂꍇA퓬̉s if recovery_rate != 0 and not actor.dead? # p[eB̃AN^[Ƀ[v $game_party.actors.each do |actor| # vZ recovery_hp = (actor.maxhp / 100.0 * recovery_rate).truncate recovery_sp = (actor.maxsp / 100.0 * recovery_rate).truncate # ۂɉ actor.hp += recovery_hp actor.sp += recovery_sp # Aj[Vݒ actor.damage = - recovery_hp actor.damage_pop = true end # Xe[^XEBhEXV @status_window.refresh endendend # module Scene_Battle_Moduleend # module Battle_End_Recovery#------------------------------# 퓬V[̍Ē`#------------------------------class Scene_Battle# Scene_BattlepW[CN[hinclude Battle_End_Recovery::Scene_Battle_Module# ̃tF[YTJnɕalias battle_end_recovery_original_start_phase5 start_phase5# tF[YTJnĒ`def start_phase5# 퓬̉Ăяobattle_end_recovery# ̃tF[YTJnĂяobattle_end_recovery_original_sta rt_phase5endend# Battle_End_Recovery# XRXS_BP10. LEVEL UP!EBhE # by ݓy$data_system_level_up_se = "" # xAbvSEB""ŖB$data_system_level_up_me = "Audio/ME/007-Fanfare01" # xAbvME#=================================== ===========================================# Window_LevelUpWindow#------------------------------------------------------------------------------# @ogIAxAbvꍇɃXe[^X\EBhEłB#=================== ================================================== =========class Window_LevelUpWindow < Window_Base#--------------------------------------------------------------------------# IuWFNg#--------------------------------------------------------------------------def initialize(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)super(0, 128, 160, 192)self.contents = Bitmap.new(width - 32, height - 32)self.visible = falserefresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)end#--------------------------------------------------------------------------# tbV#--------------------------------------------------------------------------def refresh(actor, last_lv, up_hp, up_sp, up_str, up_dex, up_agi, up_int)self.contents.clearself.contents.font.color = system_colorself.contents.font.name = "Arial"self.contents.font.size = 14self.contents.draw_text( 0, 0, 160, 24, "SUBE DE NIVEL!")self.contents.font.size = 18self.contents.draw_text( 0, 28, 160, 24, $data_system.words.hp)self.contents.draw_text( 0, 50, 160, 24, $data_system.words.sp)self.contents.font.size = 14self.contents.draw_text( 0, 72, 80, 24, $data_system.words.str)self.contents.draw_text( 0, 94, 80, 24, $data_system.words.dex)self.contents.draw_text( 0, 116, 80, 24, $data_system.words.agi)self.contents.draw_text( 0, 138, 80, 24, $data_system.words.int)self.contents.draw_text(92, 0, 128, 24, "")self.contents.draw_text(76, 28, 128, 24, "=")self.contents.draw_text(76, 50, 128, 24, "=")self.contents.draw_text(76, 72, 128, 24, "=")self.contents.draw_text(76, 94, 128, 24, "=")self.contents.draw_text(76, 116, 128, 24, "=")self.contents.draw_text(76, 138, 128, 24, "=")self.contents.font.color = normal_colorself.contents.draw_text( 0, 0, 88, 24, last_lv.to_s, 2)self.contents.draw_text( 0, 28, 72, 24, "+" + up_hp.to_s, 2)self.contents.draw_text( 0, 50, 72, 24, "+" + up_sp.to_s, 2)self.contents.draw_text( 0, 72, 72, 24, "+" + up_str.to_s, 2)self.contents.draw_text( 0, 94, 72, 24, "+" + up_dex.to_s, 2)self.contents.draw_text( 0, 116, 72, 24, "+" + up_agi.to_s, 2)self.contents.draw_text( 0, 138, 72, 24, "+" + up_int.to_s, 2)self.contents.font.size = 20self.contents.draw_text( 0, 0, 128, 24, actor.level.to_s, 2)self.contents.draw_text( 0, 26, 128, 24, actor.maxhp.to_s, 2)self.contents.draw_text( 0, 48, 128, 24, actor.maxsp.to_s, 2)self.contents.draw_text( 0, 70, 128, 24, actor.str.to_s, 2)self.contents.draw_text( 0, 92, 128, 24, actor.dex.to_s, 2)self.contents.draw_text( 0, 114, 128, 24, actor.agi.to_s, 2)self.contents.draw_text( 0, 136, 128, 24, actor.int.to_s, 2)endend#========================================= =====================================# Window_BattleStatus#============================== ================================================cl ass Window_BattleStatus < Window_Base#--------------------------------------------------------------------------# ljEJCX^Xϐ#--------------------------------------------------------------------------attr_accessor :level_up_flags # SUBE DE NIVEL!\end#==================================== ==========================================# Game_Battler#===================================== =========================================class Game_Battler#--------------------------------------------------------------------------# ljEJCX^Xϐ#--------------------------------------------------------------------------attr_accessor :exp_gain_ban # EXP擾ꎞ֎~#--------------------------------------------------------------------------# IuWFNg#--------------------------------------------------------------------------alias xrxs_bp10_initialize initializedef initialize@exp_gain_ban = falsexrxs_bp10_initializeend#--------------------------------------------------------------------------# Xe[g [EXP lłȂ] #--------------------------------------------------------------------------alias xrxs_bp10_cant_get_exp? cant_get_exp?def cant_get_exp?if @exp_gain_ban == true return trueelse return xrxs_bp10_cant_get_exp?endendend#================= ================================================== ===========# Scene_Battle#===================================== =========================================class Scene_Battle#--------------------------------------------------------------------------# At^[ogtF[YJn#--------------------------------------------------------------------------alias xrxs_bp10_start_phase5 start_phase5def start_phase5# EXP l֎~for i in 0...$game_party.actors.size $game_party.actors[i].exp_gain_ban = trueendxrxs_bp10_start_phase5# EXP l֎~̉for i in 0...$game_party.actors.size $game_party.actors[i].exp_gain_ban = falseend# EXP@exp_gained = 0for enemy in $game_troop.enemies # l EXPlj # Gl~[BԂłȂꍇ @exp_gained += enemy.exp if not enemy.hiddenend# ݒ@phase5_step = 0@exp_gain_actor = -1# UgEBhE\@result_window.y -= 64@result_window.visible = true# xAbvphase5_next_levelupend#--------------------------------------------------------------------------# t[XV (At^[ogtF[Y)#--------------------------------------------------------------------------alias xrxs_bp10_update_phase5 update_phase5def update_phase5case @phase5_stepwhen 1 update_phase5_step1else xrxs_bp10_update_phase5 # xAbvĂꍇ͋*ogI battle_end(0) if @levelup_window != nil and @phase5_wait_count <= 0endend#--------------------------------------------------------------------------# t[XV (At^[ogtF[Y 1 : xAbv)#--------------------------------------------------------------------------def update_phase5_step1# C {^ꂽꍇif Input.trigger?(Input::C) # EBhEĎ̃AN^[ @levelup_window.visible = false if @levelup_window != nil @status_window.level_up_flags[@exp_gain_actor] = false phase5_next_levelupendend#--------------------------------------------------------------------------# ̃AN^[̃xAbv\#--------------------------------------------------------------------------def phase5_next_levelupbegin # ̃AN^[ @exp_gain_actor += 1 # Ō̃AN^[̏ꍇ if @exp_gain_actor >= $game_party.actors.size # At^[ogtF[YJn @phase5_step = 0 return end actor = $game_party.actors[@exp_gain_actor] if actor.cant_get_exp? == false # ݂̔\͒lێ last_level = actor.level last_maxhp = actor.maxhp last_maxsp = actor.maxsp last_str = actor.str last_dex = actor.dex last_agi = actor.agi last_int = actor.int # ol擾̌Iu( actor.exp += @exp_gained # if actor.level > last_level # xAbvꍇ @status_window.level_up(@exp_gain_actor) if $data_system_level_up_se != "" Audio.se_stop Audio.se_play($data_system_level_up_se) end if $data_system_level_up_me != "" Audio.me_stop Audio.me_play($data_system_level_up_me) end @levelup_window = Window_LevelUpWindow.new(actor, last_level, actor.maxhp - last_maxhp, actor.maxsp - last_maxsp, actor.str - last_str, actor.dex - last_dex, actor.agi - last_agi, actor.int - last_int) @levelup_window.x = 160 * @exp_gain_actor @levelup_window.visible = true @phase5_wait_count = 40 @phase5_step = 1 # Xe[^XEBhEtbV @status_window.refresh return end endend until falseendend# XRXS_17. Xbv_[Wh^ڍ ver.1.51 # by ݓy, fukuyama#========================================= =====================================# Game_Battler#===================================== =========================================class Game_Battler#--------------------------------------------------------------------------# Xbv_[W̌Kp#--------------------------------------------------------------------------alias xrxs_bp7_slip_damage_effect slip_damage_effectdef slip_damage_effect# l̏slip_damage_percent = 0slip_damage_plus = 0# ݕtĂXe[g̒Xbv_[WL̃mTfor i in @states if $data_states[i].slip_damage # ̃Xe[gĂXbv_[W # LvvXXe[g܂Lv}CiXXe[gB for j in $data_states[i].plus_state_set if $data_states[j] != nil if $data_states[j].name =~ /^Xbv([0-9]+)(%|)/ slip_damage_percent += $1.to_i elsif $data_states[j].name =~ /^Xbv([0-9]+)$/ slip_damage_plus += $1.to_i end end end for j in $data_states[i].minus_state_set if $data_states[j] != nil if $data_states[j].name =~ /^Xbv([0-9]+)(%|)/ slip_damage_percent -= $1.to_i elsif $data_states[j].name =~ /^Xbv([0-9]+)$/ slip_damage_plus -= $1.to_i end end end endendif slip_damage_percent == 0 and slip_damage_plus == 0 xrxs_bp7_slip_damage_effectelse # hXbvh䂪 ꍇ for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id] armor = $data_armors[i] next if armor == nil for j in armor.guard_state_set if $data_states[j] != nil if $data_states[j].name =~ /^Xbv([0-9]+)(%|)/ if slip_damage_percent > 0 slip_damage_percent = [slip_damage_percent - $1.to_i, 0].max end end if $data_states[j].name =~ /^Xbv([0-9]+)$/ if slip_damage_percent > 0 slip_damage_plus = [slip_damage_plus - $1.to_i, 0].max end end end end end # _[Wݒ self.damage = self.maxhp * slip_damage_percent / 100 + slip_damage_plus # U if self.damage.abs > 0 amp = [self.damage.abs * 15 / 100, 1].max self.damage += rand(amp+1) + rand(amp+1) - amp end # HP _[WZ self.hp -= self.damage # \bhI return trueendendend# XRXS_BP 1. CP ver.15 # by ݓy, a, Jack-R#================================================ ==============================# Scene_Battle_CP#================================== ============================================class Scene_Battle_CP#--------------------------------------------------------------------------# JCX^Xϐ#--------------------------------------------------------------------------attr_accessor :stop # CPZXgbv#----------------------------------------------------------------------------# IuWFNg̏#----------------------------------------------------------------------------def initialize@battlers = []@cancel = false@agi_total = 0# z @count_battlers @count_battlers = []# Gl~[z @count_battlers ɒljfor enemy in $game_troop.enemies @count_battlers.push(enemy)end# AN^[z @count_battlers ɒljfor actor in $game_party.actors @count_battlers.push(actor)endfor battler in @count_battlers @agi_total += battler.agiendfor battler in @count_battlers battler.cp = [[65535 * (rand(15) + 85) / 100 * battler.agi / @agi_total * 4, 0].max, 65535].minendend#----------------------------------------------------------------------------# CPJEg̊Jn#----------------------------------------------------------------------------def startif @cp_thread != nil then returnend@cancel = false@stop = false# Xbh@cp_thread = Thread.new do while @cancel != true if @stop != true self.update # XV sleep(0.05) end endend# ܂ŃXbhend#----------------------------------------------------------------------------# CPJEgAbv#----------------------------------------------------------------------------def updateif @count_battlers != nil then for battler in @count_battlers # soȂΖ if battler.dead? == true #or battler.movable? == false then battler.cp = 0 next end # 1.3ς邱ƂŁXs[hύX\B_͎gp邱ƁB battler.cp = [[battler.cp + 1.3 * 4096 * battler.agi / @agi_total, 0].max, 65535].min endendend#----------------------------------------------------------------------------# CPJEg̊Jn#----------------------------------------------------------------------------def stop@cancel = trueif @cp_thread != nil then @cp_thread.join @cp_thread = nilendendend#===================================== =========================================# Game_Battler#===================================== =========================================class Game_Battlerattr_accessor :now_guarding # ݖh䒆tOattr_accessor :cp # CPattr_accessor :slip_state_update_ban # XbvEXe[g̋֎~#--------------------------------------------------------------------------# R}h͉\#--------------------------------------------------------------------------def inputable?return (not @hidden and restriction <= 1 and @cp >=65535)end#--------------------------------------------------------------------------# Xe[g [Xbv_[W] #--------------------------------------------------------------------------alias xrxs_bp1_slip_damage? slip_damage?def slip_damage?return false if @slip_state_update_banreturn xrxs_bp1_slip_damage?end#--------------------------------------------------------------------------# Xe[gR (^[ƂɌĂяo)#--------------------------------------------------------------------------alias xrxs_bp1_remove_states_auto remove_states_autodef remove_states_autoreturn if @slip_state_update_banxrxs_bp1_remove_states_autoe ndend#============================================ ==================================# Game_Actor#======================================= =======================================class Game_Actor < Game_Battler#--------------------------------------------------------------------------# ZbgAbv#--------------------------------------------------------------------------alias xrxs_bp1_setup setupdef setup(actor_id)xrxs_bp1_setup(actor_id)@hate = 100 # init-value is 100@cp = 0@now_guarding = false@slip_state_update_ban = falseendend#====================================== ========================================# Game_Enemy#======================================= =======================================class Game_Enemy < Game_Battler#--------------------------------------------------------------------------# IuWFNg#--------------------------------------------------------------------------alias xrxs_bp1_initialize initializedef initialize(troop_id, member_index)xrxs_bp1_initialize(troop_id, member_index)@hate = 100 # init-value is 100@cp = 0@now_guarding = false@slip_state_update_ban = falseendend#====================================== ========================================# Window_BattleStatus#============================== ================================================cl ass Window_BattleStatus < Window_Base#--------------------------------------------------------------------------#--------------------------------------------------------------------------# JCX^Xϐ#--------------------------------------------------------------------------attr_accessor :update_cp_only # CP[^[݂̂̍XV#--------------------------------------------------------------------------# IuWFNg#--------------------------------------------------------------------------alias xrxs_bp1_initialize initializedef initialize@update_cp_only = falsexrxs_bp1_initializeend#--------------------------------------------------------------------------# tbV#--------------------------------------------------------------------------alias xrxs_bp1_refresh refreshdef refreshif @update_cp_only == false xrxs_bp1_refreshendfor i in 0...$game_party.actors.size actor = $game_party.actors[i] actor_x = i * 160 + 4 draw_actor_cp_meter(actor, actor_x, 96, 120, 0)endend#--------------------------------------------------------------------------def draw_actor_name(actor, x, y) self.contents.font.color = normal_color self.contents.font.size = 24 self.contents.draw_text(x, y, 120, 32, actor.name)end#--------------------------------------------------------------------------# CP[^[ ̕`#--------------------------------------------------------------------------def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)self.contents.font.color = system_colorself.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))if actor.cp == nil actor.cp = 0endw = width * [actor.cp,65535].min / 65535self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))endend#====================================== ========================================# Scene_Battle#===================================== =========================================class Scene_Battle# Ɍݒ肕ƁAAN^[R}h|bvƂɌĐ$data_system_ command_up_se = ""#--------------------------------------------------------------------------# ogI# result : (0: 1:sk 2:)#--------------------------------------------------------------------------alias xrxs_bp1_battle_end battle_enddef battle_end(result)# CPJEg~@cp_thread.stopxrxs_bp1_battle_end(r esult)end#--------------------------------------------------------------------------# vogtF[YJn#--------------------------------------------------------------------------alias xrxs_bp1_start_phase1 start_phase1def start_phase1@agi_total = 0@cp_thread = Scene_Battle_CP.new# AN^[R}hEBhEč쐬s1 = $data_system.words.attacks2 = $data_system.words.skills3 = $data_system.words.guards4 = $data_system.words.item@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, "Huir"])@actor_command_window.y = 128@actor_command_window.back_opacity = 160@actor_command_window.active = false@actor_command_window.visible = false@actor_command_window.draw_item(4, $game_temp.battle_can_escape ? @actor_command_window.normal_color : @actor_command_window.disabled_color)xrxs_bp1_star t_phase1end#--------------------------------------------------------------------------# p[eBR}htF[YJn#--------------------------------------------------------------------------alias xrxs_bp1_start_phase2 start_phase2def start_phase2xrxs_bp1_start_phase2@party_command_wi ndow.active = false@party_command_window.visible = false# start_phase3end#--------------------------------------------------------------------------# t[XV (p[eBR}htF[Y)#--------------------------------------------------------------------------alias xrxs_bp1_update_phase2 update_phase2def update_phase2# C {^ꂽꍇif Input.trigger?(Input::C) # p[eBR}hEBhẼJ[\uŕ case @party_command_window.index when 0 # 키 # SE t $game_system.se_play($data_system.decision_se) @cp_thread.start # AN^[R}htF[YJn start_phase3 end returnendxrxs_bp1_update_phase2end#--------------------------------------------------------------------------# ̃AN^[̃R}h͂#--------------------------------------------------------------------------def phase3_next_actor# [vbegin # AN^[̖ŃGtFNg OFF if @active_battler != nil @active_battler.blink = false end # Ō̃AN^[̏ꍇ if @actor_index == $game_party.actors.size-1 # CtF[YJn @cp_thread.start start_phase4 return end # AN^[̃CfbNXi߂ @actor_index += 1 @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true if @active_battler.inputable? == false @active_battler.current_action.kind = -1 end # AN^[R}h͂tȂԂȂxend until @active_battler.inputable?@cp_thread.stop# AN^[R}hEBhEZbgAbv@active_battler.no w_guarding = falsephase3_setup_command_windowend#--------------------------------------------------------------------------# ÕAN^[̃R}h͂#--------------------------------------------------------------------------def phase3_prior_actor# [vbegin # AN^[̖ŃGtFNg OFF if @active_battler != nil @active_battler.blink = false end # ŏ̃AN^[̏ꍇ if @actor_index == 0 # ŏ֖߂ start_phase3 return end # AN^[̃CfbNX߂ @actor_index -= 1 @active_battler = $game_party.actors[@actor_index] @active_battler.blink = true # AN^[R}h͂tȂԂȂxend until @active_battler.inputable?@cp_thread.stop# AN^[R}hEBhEZbgAbv@active_battler.no w_guarding = falsephase3_setup_command_windowend#--------------------------------------------------------------------------# AN^[R}hEBhẼZbgAbv#--------------------------------------------------------------------------alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_windowdef phase3_setup_command_window# ̍ĐAudio.se_play($data_system_command_up_s e) if $data_system_command_up_se != ""# ߂xrxs_bp1_phase3_setup_command_windowend#--------------------------------------------------------------------------# t[XV (AN^[R}htF[Y : {R}h)#--------------------------------------------------------------------------alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_commanddef update_phase3_basic_command# C {^ꂽꍇif Input.trigger?(Input::C) # AN^[R}hEBhẼJ[\uŕ case @actor_command_window.index when 4 # if $game_temp.battle_can_escape # SE t $game_system.se_play($data_system.decision_se) # ANVݒ @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 4 # ̃AN^[̃R}h͂ phase3_next_actor else # uU[ SE t $game_system.se_play($data_system.buzzer_se) end return endendxrxs_bsp1_update_phase3_basic_commandend#--------------------------------------------------------------------------# CtF[YJn#--------------------------------------------------------------------------alias xrxs_bp1_start_phase4 start_phase4def start_phase4xrxs_bp1_start_phase4# Gl~[ANV쐬for enemy in $game_troop.enemies if enemy.cp < 65535 enemy.current_action.clear enemy.current_action.kind = -1 # ^[B next end enemy.make_actionend# s쐬make_action_ordersend#--------------------------------------------------------------------------# t[XV (CtF[Y Xebv 1 : ANV)#--------------------------------------------------------------------------alias xrxs_bp1_update_phase4_step1 update_phase4_step1def update_phase4_step1# @phase4_act_continuation = 0# sif judge @cp_thread.stop # ܂͔sk̏ꍇ : \bhI returnend# sog[z̐擪擾@active_battler = @action_battlers[0]# Xe[^XXVCPɌB@status_window.update_cp_o nly = true# Xe[gXV֎~B@active_battler.slip_state_update_ba n = true if @active_battler != nil# ߂xrxs_bp1_update_phase4_step1# ֎~@status_window.update_cp_only = false@active_battler.slip_state_update_ban = false if @active_battler != nilend#--------------------------------------------------------------------------# t[XV (CtF[Y Xebv 2 : ANVJn)#--------------------------------------------------------------------------alias xrxs_bp1_update_phase4_step2 update_phase4_step2def update_phase4_step2# *ANVłȂunless @active_battler.current_action.forcing # CPĂȂꍇ if @phase4_act_continuation == 0 and @active_battler.cp < 65535 @phase4_step = 6 return end # [GU] [U] ̏ꍇ if @active_battler.restriction == 2 or @active_battler.restriction == 3 # ANVɍUݒ @active_battler.current_action.kind = 0 @active_battler.current_action.basic = 0 end # [słȂ] ̏ꍇ if @active_battler.restriction == 4 # ANV*Ώۂ̃og[NA $game_temp.forcing_battler = nil if @phase4_act_continuation == 0 and @active_battler.cp >= 65535 # Xe[gR @active_battler.remove_states_auto # CP @active_battler.cp = [(@active_battler.cp - 65535),0].max # Xe[^XEBhEtbV @status_window.refresh end # Xebv 1 Ɉڍs @phase4_step = 1 return endend# ANV̎핂ŕcase @active_battler.current_action.kindwhen 0 # UhEEȂ̋CP @active_battler.cp -= 0 if @phase4_act_continuation == 0when 1 # XLgp̏CP @active_battler.cp -= 65535 if @phase4_act_continuation == 0when 2 # ACegp̏CP @active_battler.cp -= 65535 if @phase4_act_continuation == 0when -1 # CP*܂ĂȂ @phase4_step = 6 returnend# CPZꎞ~@cp_thread.stop = true# Xe[gR@active_battler.remove_states_autoxrxs_b p1_update_phase4_step2end#--------------------------------------------------------------------------# {ANV 쐬#--------------------------------------------------------------------------alias xrxs_bp1_make_basic_action_result make_basic_action_resultdef make_basic_action_result# Ȕꍇif @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0 @active_battler.cp -= 65535 # UCPend# h̏ꍇif @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0 @active_battler.cp -= 32767 # h䎞CPend# G̓̏ꍇif @active_battler.is_a?(Game_Enemy) and @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0 @active_battler.cp -= 65535 # CPend# Ȃ̏ꍇif @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0 @active_battler.cp -= 32767 # ȂCPend# ̏ꍇif @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0 @active_battler.cp -= 65535 # CP # \ł͂Ȃꍇ if $game_temp.battle_can_escape == false # uU[ SE t $game_system.se_play($data_system.buzzer_se) return end # SE t $game_system.se_play($data_system.decision_se) # update_phase2_escape returnendxrxs_bp1_make_basic_action_resultend#--------------------------------------------------------------------------# t[XV (CtF[Y Xebv 5 : _[W\)#--------------------------------------------------------------------------alias xrxs_bp1_update_phase4_step5 update_phase4_step5def update_phase4_step5# Xbv_[Wif @active_battler.hp > 0 and @active_battler.slip_damage? @active_battler.slip_damage_effect @active_battler.damage_pop = trueendxrxs_bp1_update_phase4_step5end#--------------------------------------------------------------------------# t[XV (CtF[Y Xebv 6 : tbV)#--------------------------------------------------------------------------alias xrxs_bp1_update_phase4_step6 update_phase4_step6def update_phase4_step6# CPZĊJ @cp_thread.stop = false# wvEBhEB@help_window.visible = falsexrxs_bp1_update_phase4_step6endend# XRXS_BP 7. ogXe[^XENAfUC ver.1.02 # by ݓy, TOMY#============================================= =================================# Window_BattleStatus#============================== ================================================cl ass Window_BattleStatus < Window_Base#--------------------------------------------------------------------------# JCX^Xϐ#--------------------------------------------------------------------------attr_accessor :update_cp_only # CP[^[݂̂̍XV#--------------------------------------------------------------------------# IuWFNg#--------------------------------------------------------------------------alias xrxs_bp7_initialize initializedef initializexrxs_bp7_initialize# Full-View̏ꍇ͉s # Ă*B#self.opacity = 0#self.back_opacity = 0end#--------------------------------------------------------------------------# tbV#--------------------------------------------------------------------------alias xrxs_bp7_refresh refreshdef refreshif @update_cp_only xrxs_bp7_refresh returnend# `֎~Ȃ߂@draw_ban = truexrxs_bp7_refresh# `̋֎~@draw_ban = false# `Jn@item_max = $game_party.actors.sizeendend#==================== ================================================== ========# Window_Base#====================================== ========================================class Window_Base < Window#--------------------------------------------------------------------------# O̕`#--------------------------------------------------------------------------alias xrxs_bp7_draw_actor_name draw_actor_namedef draw_actor_name(actor, x, y)xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != trueend#--------------------------------------------------------------------------# Xe[g̕`#--------------------------------------------------------------------------alias xrxs_bp7_draw_actor_state draw_actor_statedef draw_actor_state(actor, x, y, width = 120)xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != trueend#========================================== ====================================# OCu#=================================== ===========================================class Window_Base#--------------------------------------------------------------------------# C` by ݓy#--------------------------------------------------------------------------def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)# `̌vZB傫߂ɒp̒Bdistance = (start_x - end_x).abs + (start_y - end_y).abs# `Jnif end_color == start_color for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i self.contents.fill_rect(x, y, width, width, start_color) endelse for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i r = start_color.red * (distance-i)/distance + end_color.red * i/distance g = start_color.green * (distance-i)/distance + end_color.green * i/distance b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a)) endendend#--------------------------------------------------------------------------# e` by TOMY#--------------------------------------------------------------------------def draw_shadow_text(x, y, width, height, string, align = 0)# ̐FۑĂ*color = self.contents.font.color.dup# ʼne`self.contents.font.color = Color.new(0, 0, 0)self.contents.draw_text(x + 2, y + 2, width, height, string, align)# ̐Fɖ߂ĕ`self.contents.font.color = colorself.contents.draw_text(x, y, width, height, string, align)endendend
Solo los deven de poner encima de main y ya est Eso es todo. Hasta la prxima. ![]() |
|
|
|||
|
|||
|
Recopilemos Scripts!
|
|
#2
|
||||
|
||||
|
Te Doy Una Mano Lord Fernando Con La Recolecta De Script Agrega Este
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Personalizacion Del Mapa (RMVX) 1-Nombre: AI-chan Custom HUD (HUD personalizado) Autor: Angel Ivy-chan.
Spoiler
Lo que el script hace, exactamente? (Introduccin)
Se trata de un nuevo HUD, por ahora, slo para el jefe del equipo, pero posteriormente se aument. Legal ... Tiene una foto? (Imgenes) S, s ... Claro que lo es horrible, pero ... Vea: Lo que circula el char es una prueba, s que no es muy buena, pero ... '-' Tiene Script? Claro Que S, s ... Cdigo:
#===============================================================================
# AI-chan HUD Customizada...
# Por Angel Ivy-chan,
# Para RPG Maker Brasil e Evolution.
#===============================================================================
class Ai_chan_HUD2 < Window_Base
def initialize
super(0,0,544,416)
@hp1 = Color.new(0,160,87)
@hp2 = Color.new(159,241,193)
@mp1 = Color.new(0,74,127)
@mp2 = Color.new(139,174,216)
@exp1 = Color.new(120,100,50)
@exp2 = Color.new(220,215,170)
@back1 = Color.new(0,0,0)
@back2 = Color.new(255,255,255)
self.contents = Bitmap.new(500,380)
self.contents.font.size = 20
self.opacity = 0
self.z = 300
update
end
def update
self.contents.clear
@hp2 = Color.new(159,241,193)
if $game_party.members[0].hp <= $game_party.members[0].maxhp / 4
@hp2 = Color.new(241,159,93)
@hp1 = Color.new(160,0,87)
else
@hp1 = Color.new(0,160,87)
@hp2 = Color.new(159,241,193)
end
if $game_party.members[0].mp <= $game_party.members[0].maxmp / 4
@mp1 = Color.new(74,0,127)
@mp2 = Color.new(174,139,216)
else
@mp1 = Color.new(0,74,127)
@mp2 = Color.new(139,174,216)
end
actor = $game_party.members[0]
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
#-------------------------------------------------------------------------------
# Elipse Esquisita:
#-------------------------------------------------------------------------------
#self.contents.fill_rect(0,0,210,80,@back1)
self.contents.fill_rect(0,26,210,20,@back1)
self.contents.fill_rect(1,24,208,24,@back1)
self.contents.fill_rect(3,22,204,28,@back1)
self.contents.fill_rect(6,20,198,32,@back1)
self.contents.fill_rect(10,18,190,36,@back1)
self.contents.fill_rect(15,16,180,40,@back1)
self.contents.fill_rect(21,14,168,44,@back1)
self.contents.fill_rect(28,12,154,48,@back1)
self.contents.fill_rect(36,10,138,52,@back1)
self.contents.fill_rect(43,8,120,56,@back1)
self.contents.fill_rect(53,6,100,60,@back1)
self.contents.fill_rect(64,4,78,64,@back1)
#-------------------------------------------------------------------------------
# Alguns dados importantes:
#-------------------------------------------------------------------------------
draw_character(actor.character_name, actor.character_index, 25, 55)
@sarix = 35
self.contents.font.size = 16
self.contents.draw_text(@sarix + 20, 0, 120, 24, "#{$game_party.members[0].name}:")
#-------------------------------------------------------------------------------
# Barra de HP:
#-------------------------------------------------------------------------------
hp = $game_party.members[0].hp
maxhp = $game_party.members[0].maxhp
wb = 146 * hp / maxhp
self.contents.fill_rect(@sarix + 10, 25, 150, 8, @back1)
self.contents.font.size = 12
self.contents.font.bold = true
self.contents.fill_rect(@sarix + 11, 26, 148, 6, @back2)
self.contents.fill_rect(@sarix + 12, 27, 146, 4, @back1)
self.contents.gradient_fill_rect(@sarix + 12, 27, wb, 4, @hp1, @hp2)
self.contents.draw_text(@sarix + 10, 15, 24, 24, "HP")
self.contents.draw_text(@sarix + 100, 20, 120, 24, "#{$game_party.members[0].hp}/#{$game_party.members[0].maxhp}")
#-------------------------------------------------------------------------------
# Barra de MP:
#-------------------------------------------------------------------------------
mp = $game_party.members[0].mp
maxmp = $game_party.members[0].maxmp
wb = 146 * mp / maxmp
self.contents.fill_rect(@sarix + 10, 40, 150, 8, @back1)
self.contents.fill_rect(@sarix + 11, 41, 148, 6, @back2)
self.contents.fill_rect(@sarix + 12, 42, 146, 4, @back1)
self.contents.gradient_fill_rect(@sarix + 12, 42, wb, 4, @mp1, @mp2)
self.contents.draw_text(@sarix + 10, 30, 24, 24, "MP")
self.contents.draw_text(@sarix + 100, 35, 120, 24, "#{$game_party.members[0].mp}/#{$game_party.members[0].maxmp}")
#-------------------------------------------------------------------------------
# Barra de EXP:
#-------------------------------------------------------------------------------
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
@sariexp = actor.now_exp * 100 / actor.next_exp
else
rate = 1
@sariexp = "Max"
end
self.contents.fill_rect(@sarix + 10, 55, 150, 8, @back1)
self.contents.fill_rect(@sarix + 11, 56, 148, 6, @back2)
self.contents.fill_rect(@sarix + 12, 57, 146, 4, @back1)
self.contents.gradient_fill_rect(@sarix + 12, 57, 146 * rate, 4, @exp1, @exp2)
self.contents.draw_text(@sarix + 10, 45, 24, 24, "EXP:")
self.contents.draw_text(@sarix + 100, 50, 120, 24, "#{@sariexp}%")
#-------------------------------------------------------------------------------
# Outros:
#-------------------------------------------------------------------------------
self.contents.fill_rect(8,50,36,12,@back1)
draw_misari_actor_level(actor, 10, 45)
end
end
class Window_Base
def draw_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, WLH, actor.level, 2)
end
end
class Window_Base
def draw_misari_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
self.contents.font.color = normal_color
self.contents.draw_text(x + 6, y, 24, WLH, actor.level, 2)
end
end
class Spriteset_Map
alias hud_initialize initialize
alias hud_update update
alias hud_dispose dispose
def initialize
@hud = Ai_chan_HUD2.new
hud_initialize
end
def update
@hud.update
if $game_switches[2] == true
@hud.visible = true
else
@hud.visible = false
end
hud_update
end
def dispose
@hud.dispose
hud_dispose
end
end
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#-------------------------------------------------------------------------------
# Propriedade de RPG Maker Brasil, e RPG Maker Evolution.
# No quero ver em nenhum outro lugar... Qualquer coisa: "sariangelivy@gmail.com"
# RPG Maker Brasil: http://www.rpgmakerbrasil.com/forum/f43/ai-chan-custom-hud-7367.html#post76279
# RPG Maker Evolution: http://rpgmakerevolution1.ipbfree.com/index.php?showtopic=122
#---------------------------------------------------------
S, no hay problema ... Espero mismas preguntas y errores, como me gustara mejorar el guin un poco ms ... Y s, es poner por encima de la Main ... De lo contrario no funciona '-' Crditos y / o Agradecimientos: (Angel Ivy-chan) Pero Doy las gracias al personal de RPG Maker Brasil, y la evolucin del RPG Maker, porque voy a publicar slo los dos sitios ... |
|
#3
|
||||
|
||||
|
aqi dejo un script que cambia la batalla rpg a una que es 100000000 vese mejor hace que cambie a una batalla a tiempo activo y te puedes mover libremente el unico problema es que mucho cuesta hacer los battlers pero espero que te guste aquie sta el link
http://www.sendspace.com/file/kvs7l5 |
|
#4
|
||||
|
||||
|
No se si esto cuenta, pero una de las mejores paginas de scripts que he visto
es MundoDeluxe: Indice de Scripts de MundoDeluxe Deben estar registrados en Miarroba.com para poder acceder. Avisenme si esto no contaba con el tema. |
|
#5
|
||||
|
||||
|
Cita:
//--Tema revivido--// No revivas temas, lee las fechas de los posts antes de postear, si han pasado ms de treinta das desde el ltimo post entonces el tema esta muerto, por lo tanto no puedes postear. //--Tema cerrado--// |
![]() |
| Herramientas | |
| Desplegado | |
|
|
Temas Similares para: Recopilemos Scripts!
|
||||
| Tema | Autor | Foro | Respuestas | ltimo mensaje |
| Rpg Maker Xp -TEMA OFICIAL- | neo_crimsom | RPG Maker | 1025 | 25-nov-2007 07:29 |











Mode Lineal
