Registre-se gratuitamente e tenha o mundo do RPG na sua mão!
 
PortalInícioCalendárioGaleriaFAQBuscarRegistrar-seGruposConectar-se

Compartilhe | 
 

 --Gem Box--

Ver o tópico anterior Ver o tópico seguinte Ir em baixo 
AutorMensagem
Sorcer Loko
Cientista
Cientista


Número de Mensagens : 51
Data de inscrição : 01/02/2008

Estatísticas
Alertas Alertas:
0/5  (0/5)
Pontos Pontos: 10 / RST: 360 XD!!
Minhas Moedas! Minhas Moedas!: 210

MensagemAssunto: --Gem Box--   Qua 2 Abr - 20:53:45

Descrição: Quando o herói esta com um equipamento que você define, ele joga duas vezes seguidas na batalha.

Creditos à RTH.

Código:
################################################################################
################################################################################
########################### RTH Gem_Box #########################################
################################################################################
################################################################################
#===============================================================================
# Criado por Renan Tsuneo Hangai Junior
#===============================================================================
# Script de Gem_Box
#===============================================================================
# Permite que voce crie um equipamento em que se o heroi estiver
# equipado, ele jogará 2 vezes na mesma rodada
#===============================================================================

module RTH
 
  # Coloque aki a id do item Gem_Box
  # Coloque [a, b]
  # Onde: a = Tipo do item:
  # 1 = Arma
  # 2 = Escudo
  # 3 = Elmo
  # 4 = Vestimenta
  # 5 = Acessório
  # e b = Id do item
  GEM_BOX_EQUIP = [5, 33]
 
end

class Game_BattleAction
 
  attr_accessor :rqs_kind, :rqs_basic, :rqs_skill_id, :rqs_item_id
  attr_accessor :rqs_count_actions, :rqs_actions, :rqs_target
 
  alias rth_quick_state_baction_clear clear
  def clear(*args)
    @rqs_kind = []
    @rqs_basic = []
    @rqs_skill_id = []
    @rqs_item_id = []
    @rqs_target = []
    @rqs_count_actions = 0
    rth_quick_state_baction_clear(*args)
  end 
 
  def set_rqs_status
    @rqs_actions = true
    @rqs_kind[@rqs_count_actions] = self.kind
    @rqs_basic[@rqs_count_actions] = self.basic
    @rqs_skill_id[@rqs_count_actions] = self.skill_id
    @rqs_item_id[@rqs_count_actions] = self.item_id
    @rqs_target[@rqs_count_actions] = self.target_index
    @rqs_count_actions += 1
  end
 
  def unset_rqs_status
    @rqs_count_actions -= 1
    self.kind = @rqs_kind[@rqs_count_actions]
    self.basic = @rqs_basic[@rqs_count_actions]
    self.skill_id = @rqs_skill_id[@rqs_count_actions]
    self.item_id = @rqs_item_id[@rqs_count_actions]
    self.target_index = @rqs_target[@rqs_count_actions]
    if @rqs_count_actions <= 0
      @rqs_actions = false
    end
  end
 
  def quicked_first?
    return @rqs_count_actions == 1
  end
 
end

class Game_Actor < Game_Battler
 
  def gem_box?
    gem_box_id = RTH::GEM_BOX_EQUIP[1]
    gem_box_tipo = RTH::GEM_BOX_EQUIP[0]
    gem_box_name = (gem_box_tipo == 1 ? "weapon_id" : "armor#{gem_box_tipo-1}_id")
    eval("return true if self.#{gem_box_name} == gem_box_id")
    return false
  end
 
end

class Scene_Battle
 
  alias rth_quick_state_sbattle_phase3_next_actor phase3_next_actor
  alias rth_quick_state_sbattle_phase3_prior_actor phase3_prior_actor
  alias rth_quick_state_sbattle_update_phase4_step1 update_phase4_step1
 
  def phase3_next_actor(*args)
    if @active_battler != nil
      if @active_battler.gem_box?
        @active_battler.current_action.set_rqs_status
        return if @active_battler.current_action.quicked_first?
      end
    end
    rth_quick_state_sbattle_phase3_next_actor(*args)
  end
 
  def phase3_prior_actor(*args)
    rth_quick_state_sbattle_phase3_prior_actor(*args)
    if @active_battler != nil
      if @active_battler.current_action.rqs_actions
        @active_battler.current_action.clear
      end
    end
  end
 
  def update_phase4_step1(*args)
    if @active_battler != nil
      @quick_attack = @active_battler.current_action.rqs_actions
      if @active_battler.is_a?(Game_Actor)
        if @active_battler.current_action.rqs_actions
          if @active_battler.current_action.quicked_first?
            @action_battlers.unshift(@active_battler)
          end
        end
      end
    end
    rth_quick_state_sbattle_update_phase4_step1(*args)
    if @active_battler != nil
      @quick_attack = @active_battler.current_action.rqs_actions
      if @active_battler.is_a?(Game_Actor)
        if @active_battler.current_action.rqs_actions
          @active_battler.current_action.unset_rqs_status
        end 
      end
    end
  end
 
end
Voltar ao Topo Ir em baixo
Ver perfil do usuário
 
--Gem Box--
Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo 
Página 1 de 1

Permissão deste fórum:Você não pode responder aos tópicos neste fórum
King RPG :: RPG Maker XP :: Scripts (RGSS)-
Ir para: