O TEMA DO FÓRUM ESTÁ EM MANUTENÇÃO. FEEDBACKS AQUI: ACESSAR

Shapeshift - Mudança de Forma

Iniciado por Raizen, 25/03/2013 às 14:36

Shapeshift - Mudança de Forma

Compativel com: RMVX Ace
Compatibilidade :boa
Facilidade de uso: fácil
Lag gerado: baixo
[box class=titlebg]
Condições de Uso
[/box]
Não especificado pelo autor

[box class=titlebg]
Para que serve o script
[/box]
 
  O script permite que tanto inimigo quanto o herói possam mudar de forma, ou seja, na batalha um actor pode virar outro do database, e o mesmo para inimigos, usado muito como habilidades em vários rpgs.

[box class=titlebg]
Script
[/box]

=begin
#==============================================================================
 ** Effect: Shape shift
 Author: Tsukihime
 Date: Mar 10, 2013
------------------------------------------------------------------------------
 ** Change log
 Mar 10, 2013
   - old equips are re-equipped after transformation process
 Mar 9, 2013
   - updates character name and index, class, and initializes skills
 Oct 25, 2012
   - added support for actor transform
 Oct 10, 2012
   - initial release
------------------------------------------------------------------------------   
 ** Terms of Use
 * Free to use in commercial/non-commercial projects
 * No real support. The script is provided as-is
 * Will do bug fixes, but no compatibility patches
 * Features may be requested but no guarantees, especially if it is non-trivial
 * Preserve this header
------------------------------------------------------------------------------
 ** Required
 
 Effects Manager
 (http://himeworks.wordpress.com/2012/10/05/effects-manager/)
------------------------------------------------------------------------------ 
 ** Description
 
 Adds a "Shape shift" effect to your state.
 When this state is active, the battler will be transformed to a different
 battler specified by the state.
 
------------------------------------------------------------------------------
 ** Usage
 
 Tag your state with
    <eff: shape_shift battler_ID>
    
 Where
   battler_id is either the ID of the actor or an enemy, depending on the
   battler type
   
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Effect_Shapeshift"] = true
#==============================================================================
# ** Rest of the script
#==============================================================================
module Effects
  module Shape_Shift

    Effect_Manager.register_effect(:shape_shift)
  end
end

class Game_Battler < Game_BattlerBase
  
  def state_effect_shape_shift_add(state, effect)
    new_form_id = effect.value1[0].to_i
    transform(new_form_id)
  end
  
  def state_effect_shape_shift_remove(state, effect)
    transform(@old_form_id)
  end
end

class Game_Enemy < Game_Battler
  
  def state_effect_shape_shift_add(state, effect)
    @old_form_id = enemy.id
    super
  end
end

class Game_Actor < Game_Battler
  
  def transform(actor_id)
    @actor_id = actor_id
    @name = actor.name
    change_class(actor.class_id, true)
    init_skills
    @face_name = actor.face_name
    @face_index = actor.face_index
    @character_index = actor.character_index
    @character_name = actor.character_name
    refresh
    make_actions unless @actions.empty?
  end
  
  #-----------------------------------------------------------------------------
  # Save the equips since we might remove them
  #-----------------------------------------------------------------------------
  def state_effect_shape_shift_add(state, effect)
    @old_form_id = @actor_id
    @old_equips = equips
    @old_hp = self.hp
    @old_mp = self.mp
    super
  end
  
  #-----------------------------------------------------------------------------
  # Revert stats and put your equips back on
  #-----------------------------------------------------------------------------
  def state_effect_shape_shift_remove(state, effect)
    super
    curr_equips = equips
    @old_equips.each_with_index {|equip, slot_id|
      change_equip(slot_id, equip) if equip != curr_equips[slot_id]
    }
  end
end


[box class=titlebg]
Imagens
[/box]

Imperceptível por imagens.

[box class=titlebg]
Créditos e Avisos
[/box]

Tsukihime