Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-------------------------------------------------------------------------------
- # Don't remove this header!
- #-------------------------------------------------------------------------------
- # Jekyll Transformation System Script
- # by Trihan
- #
- # Version : 1.3
- #
- # This script is commissioned by Batworks Software.
- #-------------------------------------------------------------------------------
- #-------------------------------------------------------------------------------
- # Version History
- #-------------------------------------------------------------------------------
- # 1.3 - Fixed a bug where Jekyll would transform while walking if followers
- # were turned off.
- # 1.2 - Fixed a bug where Jekyll would transform while walking even if he
- # wasn't in the battle party.
- # 1.1 - Added a check that prevents the transform turns from going down if
- # Jekyll was resurrected that turn.
- # 1.0 - Initial script.
- #-------------------------------------------------------------------------------
- #-------------------------------------------------------------------------------
- # The script is plug and play. Just set up the config and you're good to go.
- #
- # JEKYLL_ACTOR - The actor ID of the Jekyll character
- # TRANSFORM_STATES - An array containing, in order, the state IDs Jekyll cycles
- # through, starting with Jekyll 3.
- # TRANSFORM_TURNS - The number of actions Jekyll will take between transforms.
- # TRANSFORM_STEPS - The number of steps on the map before Jekyll will move to
- # the next stage. This will reset after battle.
- # RESET_STEPS_AFTER_BATTLE - If true, steps will revert to default after battle.
- # NERD_CLASS - The ID of the initial Jekyll nerd class.
- # JOCK_CLASS - The ID of the jock class to transform into.
- # NERD_CHAR - The name of the image for the Nerd appearance.
- # NERD_CHAR_INDEX - The index to use from the Nerd image.
- # NERD_FACE - The name of the image for the Nerd face.
- # NERD_FACE_INDEX - The index to use from the Nerd face image.
- # JOCK_CHAR - The name of the image for the Jock appearance.
- # JOCK_CHAR_INDEX - The index to use from the Jock image.
- # JOCK_FACE - The name of the image for the Jock face.
- # JOCK_FACE_INDEX - The index to use from the Jock face image.
- # TRANSFORM_SOUND - The name of the SE to play when transforming.
- # TRANSFORM_VOLUME - The volume at which to play the transform sound.
- # TRANSFORM_PITCH - The pitch at which to play the transform sound.
- # HYDE_SWITCH - The ID of the Hyde switch.
- # MJISHI_SWITCH - The ID of the Mjishi switch.
- #-------------------------------------------------------------------------------
- module TLBJekyll
- #-------------------------------------------------------------------------------
- # Config
- JEKYLL_ACTOR = 4
- TRANSFORM_STATES = [79, 80, 81, 26, 77, 78]
- TRANSFORM_TURNS = 3
- TRANSFORM_STEPS = 10
- RESET_STEPS_AFTER_BATTLE = true
- NERD_CLASS = 3
- JOCK_CLASS = 4
- NERD_CHAR = "$jekyll"
- NERD_CHAR_INDEX = 0
- NERD_FACE = "$jekyllportrait"
- NERD_FACE_INDEX = 0
- JOCK_CHAR = "$chad"
- JOCK_CHAR_INDEX = 0
- JOCK_FACE = "$chadportrait"
- JOCK_FACE_INDEX = 0
- TRANSFORM_SOUND = "Transformation"
- TRANSFORM_VOLUME = 100
- TRANSFORM_PITCH = 100
- HYDE_SWITCH = 79
- MJISHI_SWITCH = 108
- # ** End Config **
- #
- # WARNING: Editing anything beyond this point may result in the script no
- # longer functioning as intended.
- #-------------------------------------------------------------------------------
- end
- module DataManager
- class << self; alias :tlb_jekyll_setup_new_game :setup_new_game; end
- def self.setup_new_game
- tlb_jekyll_setup_new_game
- $game_actors[TLBJekyll::JEKYLL_ACTOR].add_state(TLBJekyll::TRANSFORM_STATES[0])
- end
- class << self; alias :tlb_jekyll_setup_battle_test :setup_battle_test; end
- def self.setup_battle_test
- tlb_jekyll_setup_battle_test
- $game_actors[TLBJekyll::JEKYLL_ACTOR].add_state(TLBJekyll::TRANSFORM_STATES[0])
- end
- end
- module BattleManager
- class << self; alias :tlb_jekyll_battle_end :battle_end; end
- def self.battle_end(result)
- tlb_jekyll_battle_end(result)
- if TLBJekyll::RESET_STEPS_AFTER_BATTLE && $game_party.members.include?($game_actors[TLBJekyll::JEKYLL_ACTOR])
- $game_actors[TLBJekyll::JEKYLL_ACTOR].transform_steps = TLBJekyll::TRANSFORM_STEPS
- end
- end
- end
- class Game_Actor < Game_Battler
- attr_accessor :transform_turns
- attr_accessor :transform_steps
- attr_accessor :transform_state_index
- alias :tlb_jekyll_game_actor_setup :setup
- def setup(actor_id)
- tlb_jekyll_game_actor_setup(actor_id)
- if actor_id == TLBJekyll::JEKYLL_ACTOR
- @transform_turns = TLBJekyll::TRANSFORM_TURNS
- @transform_steps = TLBJekyll::TRANSFORM_STEPS
- @transform_state_index = 0
- end
- end
- def transform_into_chad
- change_class(TLBJekyll::JOCK_CLASS, true)
- sound_name = TLBJekyll::TRANSFORM_SOUND
- sound_vol = TLBJekyll::TRANSFORM_VOLUME
- sound_pitch = TLBJekyll::TRANSFORM_PITCH
- RPG::SE.new(sound_name, sound_vol, sound_pitch).play
- @name = "Chad"
- char = TLBJekyll::JOCK_CHAR
- char_index = TLBJekyll::JOCK_CHAR_INDEX
- face = TLBJekyll::JOCK_FACE
- face_index = TLBJekyll::JOCK_FACE_INDEX
- set_graphic(char, char_index, face, face_index)
- $game_switches[TLBJekyll::HYDE_SWITCH] = true
- $game_switches[TLBJekyll::MJISHI_SWITCH] = true
- @transform_turns = TLBJekyll::TRANSFORM_TURNS
- $game_player.refresh
- end
- def transform_into_jekyll
- change_class(TLBJekyll::NERD_CLASS, true)
- sound_name = TLBJekyll::TRANSFORM_SOUND
- sound_vol = TLBJekyll::TRANSFORM_VOLUME
- sound_pitch = TLBJekyll::TRANSFORM_PITCH
- RPG::SE.new(sound_name, sound_vol, sound_pitch).play
- @name = "Jekyll"
- char = TLBJekyll::NERD_CHAR
- char_index = TLBJekyll::NERD_CHAR_INDEX
- face = TLBJekyll::NERD_FACE
- face_index = TLBJekyll::NERD_FACE_INDEX
- set_graphic(char, char_index, face, face_index)
- $game_switches[TLBJekyll::HYDE_SWITCH] = false
- $game_switches[TLBJekyll::MJISHI_SWITCH] = false
- @transform_turns = TLBJekyll::TRANSFORM_TURNS
- $game_player.refresh
- end
- def update_transform_state
- unless @result.removed_states.include?(1)
- @transform_turns -= 1
- if @transform_turns == 0
- SceneManager.scene.display_transform if SceneManager.scene.is_a?(Scene_Battle)
- if @class_id == TLBJekyll::NERD_CLASS
- transform_into_chad
- else
- transform_into_jekyll
- end
- end
- old_state = TLBJekyll::TRANSFORM_STATES[@transform_state_index]
- remove_state(old_state)
- @transform_state_index += 1
- @transform_state_index = 0 if @transform_state_index == TLBJekyll::TRANSFORM_STATES.size
- end
- new_state = TLBJekyll::TRANSFORM_STATES[@transform_state_index]
- add_state(new_state)
- end
- end
- class Game_Party < Game_Unit
- alias :tlb_jekyll_increase_steps :increase_steps
- def increase_steps
- tlb_jekyll_increase_steps
- actor = $game_actors[TLBJekyll::JEKYLL_ACTOR]
- if battle_members.include?(actor) && $game_player.followers.visible
- actor.transform_steps -= 1
- if actor.transform_steps == 0
- actor.update_transform_state
- actor.transform_steps = TLBJekyll::TRANSFORM_STEPS
- end
- end
- end
- end
- class Scene_Battle < Scene_Base
- alias :tlb_jekyll_process_action_end :process_action_end
- def process_action_end
- @subject.update_transform_state if @subject == $game_actors[TLBJekyll::JEKYLL_ACTOR]
- tlb_jekyll_process_action_end
- end
- def display_transform
- @log_window.add_text("#{$game_actors[TLBJekyll::JEKYLL_ACTOR].name} transforms!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement