#======================================================= # Akea Team Battle Skill # Author: Raizen # Community: http://www.centrorpg.com/ # Compatibility: RMVXAce # Allows double, triple, quadruple... skills, similar function found on_skill_ok # Chrono Trigger #======================================================= $imported ||= Hash.new $imported[:akea_team_battle] = true module Akea_Team_Skill Team_Skill = [] Data_Skill = [] # Name of the word that seperates the battlers on battle Window Conj = ' and ' #============================================================================== # Here is configured the skills(double, triple....) # For configuration, follow the below example: #Data_Skill[id] = { #'Actors' => [actor1, actor2], #'Skills' => [id1, id2], # Where id is the id of the skill which will be a team skill # Where actor1 and actor2 are the id of the actors that participate on the skill # Where id1 and id2 are the ids of the skill that the respective actor1 and actor2 need to have learned. # IMPORTANT: Add the team skill on the classes, it can be level 1, it will # only be shown when all the requirements are met. #============================================================================== Data_Skill[54] = { #skill id 'Actors' => [1, 8], #actors involved 'Skills' => [51, 51], #id of skills necessary } Data_Skill[127] = { #skill id 'Actors' => [1, 2, 4], #actors involved 'Skills' => [3, 52, 89], #id of skills necessary } Data_Skill[128] = { #skill id 'Actors' => [2, 4], #actors involved 'Skills' => [56, 89], #id of skills necessary } #============================================================================== #------------------------------------------------------------------------------ # -----------------------Animation Configuration -------------------------- #------------------------------------------------------------------------------ #============================================================================== # To configure the animation of the skills, use exactly the same notetags commands # that are used on Akea Animated Battle System, which are: # , , , # you can add as many lines as you want, always using the same template as below # [actor_id, 'movement_type'], # To call this animation, put on notetags of the skill the following: # # Where id is the number in front of Team_Skill[id] # for example Team_Skill[3] you would call it like this: # #============================================================================== # Team_Skill[3] => Triple Vulcano Fist #============================================================================== Team_Skill[3] = [ [1, ''], [1, ''], [1, ''], [1, ''], [1, ''], [1, ''], [2, ''], [2, ''], [2, ''], [2, ''], [2, ''], [2, ''], [2, ''], [4, ''], [4, ''], [4, ''], [4, ''], [4, ''], [4, ''], [4, ''], ] #============================================================================== # Team_Skill[3] => Double Ice Combo #============================================================================== Team_Skill[4] = [ [2, ''], [2, ''], [2, ''], [2, ''], [2, ''], [2, ''], [2, ''], [2, ''], [2, ''], [4, ''], [4, ''], [4, ''], [4, ''], [4, ''], [4, ''], [4, ''], [4, ''], [4, ''], ] end #============================================================================== # HERE STARTS THE SCRIPT!!! #============================================================================== #============================================================================== # ** Scene_Battle #------------------------------------------------------------------------------ # Esta classe executa o processamento da tela de batalha. #============================================================================== class Scene_Battle < Scene_Base alias :atbs_turn_start :turn_start alias :atbs_start :start alias :atbs_turn_start :turn_start def start(*args, &block) @force_team_skill = [] atbs_start(*args, &block) end #-------------------------------------------------------------------------- # * Início do turno #-------------------------------------------------------------------------- def turn_start atbs_turn_start #@force_team_skill.sort! {|a, b| $game_actors[b].param(6) - $game_actors[a].param(6)} #@force_team_skill.pop for n in 0...@force_team_skill.size BattleManager.remove_action(@force_team_skill[n]) end @force_team_skill = [] end #-------------------------------------------------------------------------- # * Verificação de notetags #-------------------------------------------------------------------------- def atbs_team_skill(battle_notes) @remember_old_user = @subject @remember_old_target = @reuse_targets for n in 0...battle_notes.size - 10 if battle_notes[n..n+10] == "' team_skill = battle_notes[n+11..n+10+y].to_i end end for n in 0...Akea_Team_Skill::Team_Skill[team_skill].size battle_notes = Akea_Team_Skill::Team_Skill[team_skill][n][1] @subject = $game_actors[Akea_Team_Skill::Team_Skill[team_skill][n][0]] @reuse_targets = @remember_old_target if battle_notes[0..9] == "' insert_battle_commands(battle_notes[10..9+y].to_i) elsif battle_notes[0..9] == "' insert_battle_damage(battle_notes[10..9+y].to_i) elsif battle_notes[0..9] == "' old_sub = @subject for z in 0...@reuse_targets.size insert_battle_commands(battle_notes[10..9+y].to_i, @reuse_targets[z], old_sub) end @subject = old_sub elsif battle_notes[0..10] == "' insert_battle_animations(battle_notes[11..11+y]) elsif battle_notes[0..10] == "' insert_battle_animations(battle_notes[11..11+y].to_i) elsif battle_notes[0..10] == "' insert_self_battle_animations(battle_notes[11..11+y].to_i) elsif battle_notes[0..10] == "' all_battle_members[@subject.index].current_condition = battle_notes[11..11+y].to_i end end @subject = @remember_old_user @reuse_targets = @remember_old_target end #-------------------------------------------------------------------------- # * Habilidade [Confirmação] #-------------------------------------------------------------------------- def on_skill_ok @skill = @skill_window.item id = BattleManager.actor.id BattleManager.actor.input.set_skill(@skill.id) BattleManager.actor.last_skill.object = @skill if !@skill.need_selection? @skill_window.hide next_command elsif @skill.for_opponent? select_enemy_selection else select_actor_selection end if Akea_Team_Skill::Data_Skill[@skill.id] @force_team_skill << Akea_Team_Skill::Data_Skill[@skill.id]['Actors'].dup @force_team_skill.last << @skill.id end end end #============================================================================== # ** Window_BattleSkill #------------------------------------------------------------------------------ # Esta janela para seleção de habilidades na tela de batalha. #============================================================================== class Window_BattleSkill < Window_SkillList alias :atbs_include? :include? #-------------------------------------------------------------------------- # * Inclusão do item na lista # item : item #-------------------------------------------------------------------------- def include?(item) return false if item.note.include?("") atbs_include?(item) end end #============================================================================== # ** Game_Actor #------------------------------------------------------------------------------ # Esta classe gerencia os heróis. Ela é utilizada internamente pela classe # Game_Actors ($game_actors). A instância desta classe é referenciada # pela classe Game_Party ($game_party). #============================================================================== class Game_Actor < Game_Battler alias :atbs_learn_skill :learn_skill #-------------------------------------------------------------------------- # * Aprender habilidade # skill_id : ID da habilidade #-------------------------------------------------------------------------- def learn_skill(skill_id) atbs_learn_skill(skill_id) for n in 0...Akea_Team_Skill::Data_Skill.size if Akea_Team_Skill::Data_Skill[n] for i in 0...Akea_Team_Skill::Data_Skill[n]['Actors'].size atbs_learn_skill(n) if Akea_Team_Skill::Data_Skill[n]['Actors'][i] == @actor_id && skill_learn?($data_skills[Akea_Team_Skill::Data_Skill[n]['Skills'][i]]) end end end end end #============================================================================== # ** Window_SkillList #------------------------------------------------------------------------------ # Esta janela exibe uma lista de habilidades usáveis na tela de habilidades. #============================================================================== class Window_SkillList < Window_Selectable alias :atbs_include? :include? #-------------------------------------------------------------------------- # * Inclusão do item na lista # item : item #-------------------------------------------------------------------------- def include?(item) if Akea_Team_Skill::Data_Skill[item.id] check_inc = true Akea_Team_Skill::Data_Skill[item.id]['Actors'].each{|member| check_inc = false unless $game_party.members.include?($game_actors[member])} for n in 0...Akea_Team_Skill::Data_Skill[item.id]['Actors'].size check_inc = false unless $game_actors[Akea_Team_Skill::Data_Skill[item.id]['Actors'][n]].skill_learn?($data_skills[Akea_Team_Skill::Data_Skill[item.id]['Skills'][n]]) end atbs_include?(item) && check_inc else atbs_include?(item) end end end #============================================================================== # ** BattleManager #------------------------------------------------------------------------------ # Este módulo gerencia o andamento da batalha. #============================================================================== module BattleManager #-------------------------------------------------------------------------- # * Forçar ação #-------------------------------------------------------------------------- def self.remove_action(battler) for i in 0...battler.size - 1 @action_battlers.delete($game_actors[battler[i]]) unless $game_actors[battler[i]].current_action.item == $data_skills[battler.last] end end end #============================================================================== # ** Game_Battler #------------------------------------------------------------------------------ # Esta classe gerencia os battlers. Controla a adição de sprites e ações # dos lutadores durante o combate. # É usada como a superclasse das classes Game_Enemy e Game_Actor. #============================================================================== class Game_Battler < Game_BattlerBase alias :atbs_make_damage_value :make_damage_value #-------------------------------------------------------------------------- # * Cálculo de dano # user : usuário # item : habilidade/item #-------------------------------------------------------------------------- def make_damage_value(user, item) unless Akea_Team_Skill::Data_Skill[item.id] atbs_make_damage_value(user, item) return end value = 0 for n in 0...Akea_Team_Skill::Data_Skill[item.id]['Actors'].size - 1 user = $game_actors[Akea_Team_Skill::Data_Skill[item.id]['Actors'][n]] value += item.damage.eval(user, self, $game_variables) value *= item_element_rate(user, item) value *= pdr if item.physical? value *= mdr if item.magical? value *= rec if item.damage.recover? value = apply_critical(value) if @result.critical value = apply_variance(value, item.damage.variance) value = apply_guard(value) end @result.make_damage(value.to_i, item) end end #============================================================================== # ** Window_BattleLog #------------------------------------------------------------------------------ # Esta janela exibe o progresso da luta. Não exibe o quadro da # janela, é tratado como uma janela por conveniência. #============================================================================== class Window_BattleLog < Window_Selectable alias :atbs_display_use_item :display_use_item #-------------------------------------------------------------------------- # * Exibição de uso de habilidade/item # subject : lutador # item : habilidade/item #-------------------------------------------------------------------------- def display_use_item(subject, item) if item.is_a?(RPG::Skill) unless Akea_Team_Skill::Data_Skill[item.id] atbs_display_use_item(subject, item) return end name = '' for n in 0...Akea_Team_Skill::Data_Skill[item.id]['Actors'].size next unless Akea_Team_Skill::Data_Skill[item.id]['Actors'][n] if n == 0 name += $game_actors[Akea_Team_Skill::Data_Skill[item.id]['Actors'][n]].name elsif n != Akea_Team_Skill::Data_Skill[item.id]['Actors'].size - 1 name += ', ' + $game_actors[Akea_Team_Skill::Data_Skill[item.id]['Actors'][n]].name else name += Akea_Team_Skill::Conj + $game_actors[Akea_Team_Skill::Data_Skill[item.id]['Actors'][n]].name end end add_text(name + item.message1) unless item.message2.empty? wait add_text(item.message2) end else atbs_display_use_item(subject, item) end end end