Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * [ACE] Battle Busts
- #===============================================================================
- # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
- # * Version: 1.0
- # * Updated: 27/01/2015
- # * Requires: -------
- #-------------------------------------------------------------------------------
- # * < Change Log >
- #-------------------------------------------------------------------------------
- # * Version 1.0 (27/01/2015)
- # - Initial release.
- #-------------------------------------------------------------------------------
- # * < Description >
- #-------------------------------------------------------------------------------
- # * This script will add an option to display bust images for the actors during
- # the battle when you are selecting their commands.
- # * Settings to setup the position, opacity and z value of the bust image for
- # each actor separately!
- # * Script call to change an actor's battle bust image and their properties
- # during the game!
- #-------------------------------------------------------------------------------
- # * < Script Calls >
- #-------------------------------------------------------------------------------
- # * To change an actor's battle bust image during the game, you can use the
- # following script call:
- #
- # change_battle_bust(id,img,pos*,opa*,z*)
- #
- # id = The id of the actor.
- # img = The image file name for the new bust.
- # pos = The position array for the new bust.
- # opa = The opacity for the new bust.
- # z = The z value for the new bust.
- #
- # Settings marked with a * sign are optional and can be omitted at will.
- # If they are omitted, the settings for those will not be changed.
- # NOTE:
- # If you want to define a new z value for a bust, you must define the pos and
- # opa settings too! Similarly, if you want to define the opacity value for the
- # bust, you must define the pos setting too but you can omit the z setting!
- #
- # * Example:
- #
- # change_battle_bust(2,"actorbbust3a",[250,200])
- #
- # This would change the battle bust image used for the actor with the ID of 2
- # to the image named "actorbbust3a".
- # It's X position would be 250, and it's Y position would be 200.
- # It's opacity and z value would stay the same as before.
- #-------------------------------------------------------------------------------
- # * < Installation >
- #-------------------------------------------------------------------------------
- # * Place this script below Materials but above Main!
- #-------------------------------------------------------------------------------
- # * < Compatibility Info >
- #-------------------------------------------------------------------------------
- # * No known incompatibilities.
- #-------------------------------------------------------------------------------
- # * < Known Issues >
- #-------------------------------------------------------------------------------
- # * No known issues.
- #-------------------------------------------------------------------------------
- # * < Terms of Use >
- #-------------------------------------------------------------------------------
- # * Free to use for whatever purposes you want.
- # * Credit me (Sixth) in your game, pretty please! :P
- # * Posting modified versions of this script is allowed as long as you notice me
- # about it with a link to it!
- #===============================================================================
- $imported = {} if $imported.nil?
- $imported["SixthBattleBusts"] = true
- #===============================================================================
- # Settings:
- #===============================================================================
- module Sixth_Battle_Busts
- # The folder used for storing the battle bust images.
- BustImg_Folder = "Graphics/BattleBust/"
- # Bust image setup starts here!
- #
- # Format:
- #
- # ID => { # <-- The ID is the id of the actor from your database.
- # :image => "image file name", # <-- Enter the image name here.
- # :pos => [x,y], # <-- Enter the X and Y position for the image here.
- # :opacity => value, # <-- Enter the opacity value for the image here.
- # :z => value, # <-- Enter the z value for the image here.
- # }, # <-- Closing the bust setup for an actor. Never forget this line!
- #
- # Each actor must have a valid setting setup here!
- # Valid values for the opacity setting: 0 - 255. (0 = fully transparent!)
- # The z value affects what appears before the image and what appears below it.
- # Can be used to show the bust image below or under some specific windows.
- Bust_Setup = { # <-- No touchy-touchy!
- 1 => {
- :image => "bust1-A",
- :pos => [282,128],
- :opacity => 255,
- :z => 40,
- },
- 2 => {
- :image => "bust3-A",
- :pos => [282,128],
- :opacity => 255,
- :z => 40,
- },
- 3 => {
- :image => "bust2-A",
- :pos => [282,128],
- :opacity => 255,
- :z => 40,
- },
- # Add as many as you want here!
- } # <-- No touchy-touchy!
- end # <-- No touchy-touchy!
- #===============================================================================
- # End of Settings! Editing anything below may lead to... You know what, right?
- #===============================================================================
- module Cache
- def self.battle_bust(filename)
- load_bitmap(Sixth_Battle_Busts::BustImg_Folder, filename)
- end
- end
- class Scene_Battle < Scene_Base
- alias make_bust_sprites1222 create_spriteset
- def create_spriteset
- make_bust_sprites1222
- create_bust_sprite
- end
- def create_bust_sprite
- @bust = Sprite.new
- end
- alias actor_bust_drawing1223 next_command
- def next_command
- actor_bust_drawing1223
- draw_actor_bust_image
- end
- alias actor_bust_drawing1253 prior_command
- def prior_command
- actor_bust_drawing1253
- draw_actor_bust_image
- end
- def draw_actor_bust_image
- @bust.bitmap.dispose if !@bust.bitmap.nil? && !@bust.bitmap.disposed?
- if !BattleManager.actor.nil?
- @bust_data = BattleManager.actor.battle_bust
- @bust.bitmap = Cache.battle_bust(@bust_data[:image])
- @bust.x = @bust_data[:pos][0]; @bust.y = @bust_data[:pos][1]
- @bust.opacity = @bust_data[:opacity]; @bust.z = @bust_data[:z]
- end
- end
- alias hide_actor_bust1223 turn_start
- def turn_start
- @bust.bitmap.dispose if !@bust.bitmap.nil? && !@bust.bitmap.disposed?
- hide_actor_bust1223
- end
- alias dispose_busts1223 dispose_spriteset
- def dispose_spriteset
- dispose_bust_sprite
- dispose_busts1223
- end
- def dispose_bust_sprite
- @bust.bitmap.dispose if !@bust.bitmap.nil? && !@bust.bitmap.disposed?
- @bust.dispose if !@bust.nil?
- end
- end
- class Game_Actor < Game_Battler
- attr_accessor :battle_bust
- alias init_battle_busts2233 initialize
- def initialize(actor_id)
- init_battle_busts2233(actor_id)
- @battle_bust = Sixth_Battle_Busts::Bust_Setup[actor_id]
- end
- end
- class Game_Interpreter
- def change_battle_bust(id,img,pos=nil,opa=nil,z=nil)
- $game_actors[id].battle_bust[:image] = img
- $game_actors[id].battle_bust[:pos] = pos if !pos.nil?
- $game_actors[id].battle_bust[:opacity] = opa if !opa.nil?
- $game_actors[id].battle_bust[:z] = z if !z.nil?
- end
- end
- #==============================================================================
- # !!END OF SCRIPT - OHH, NOES!!
- #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement