Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Transform Enemies based on Variables
- # Version: 1.0
- # Author: DiamondandPlatinum3
- # Date: September 25, 2012
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Description:
- #
- # This script allows you to use multiple variables to differentiate when
- # an enemy transforms. The usual method is quite heavy on Game Switches if
- # you wish to use it that way, so this alternative has been created.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #------------------------------------------------------------------------------
- # Instructions:
- #
- # ~ In your Enemy noteboxes input these codes
- # ~TransVarID: ?
- # ~TransReqAmount: ?
- # ~TransNextEnemyID: ?
- # ~TransBattleAnimID: ?
- #
- # Replacing the ?'s with a number.
- #
- #
- # ~TransVarID = The Variable ID you want to check
- # ~TransReqAmount = The Required Amount (or above) that the Variable must hold for the conditions to be met
- # ~TransNextEnemyID = The ID of the enemy you want this enemy to transform into
- # ~TransBattleAnimID = The ID of the Battle Animation you want to see when this enemy transforms (this is not required)
- #
- #
- # A Visual Explanation can be found
- # Here: http://img4host.net/upload/242013385060a2d2f1c7c.png
- #
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #
- #
- # THERE IS NO EDITABLE REGION TO THIS SCRIPT
- #
- #==============================================================================
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # * Basic Update Processing
- # main : Call from main update method
- #--------------------------------------------------------------------------
- alias dp3_enemynote_transformchecker_ojne832 update_basic
- def update_basic(main = false)
- # Call Original Method
- dp3_enemynote_transformchecker_ojne832(main)
- # Call New Function
- dp3_check_enemy_note_for_transform_commands
- end
- #--------------------------------------------------------------------------
- # * Check Enemy Note For Transform Commands
- #--------------------------------------------------------------------------
- def dp3_check_enemy_note_for_transform_commands
- $game_troop.members.each do |game_enemy|
- note = $data_enemies[game_enemy.enemy_id].note
- var_id = nil
- amount_req = nil
- transform_id = nil
- tranform_battle_anim_id = nil
- note[/~TransVarID: ([-0-9]+)/]
- var_id = $1.to_i if $1
- note[/~TransReqAmount: ([-0-9]+)/]
- amount_req = $1.to_i if $1
- note[/~TransNextEnemyID: ([-0-9]+)/]
- transform_id = $1.to_i if $1
- note[/~TransBattleAnimID: ([-0-9]+)/]
- tranform_battle_anim_id = $1.to_i if $1
- if var_id && amount_req && transform_id
- if $game_variables[var_id] >= amount_req
- game_enemy.animation_id = tranform_battle_anim_id if tranform_battle_anim_id
- game_enemy.transform(transform_id)
- end # if $game_variables
- end # If not nil
- end # Loop
- end # Function
- end # Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement