Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # DSI Class Image As Battler (Can't find a fancy name, lol)
- # -- Last Updated: 2017.07.04
- # -- Author: dsiver144
- # -- Level: Easy
- # -- Requires: n/a
- #==============================================================================
- $imported = {} if $imported.nil?
- $imported["DSI-ClassImageAsBattler"] = true
- #==============================================================================
- # + Updates
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # 2017.07.04 - Finish first version.
- #==============================================================================
- # + Instructions
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ?? Materials/?f?? but above ?? Main. Remember to save.
- # Put this above MOG_Damage_Popup
- #==============================================================================
- module DSIVER144
- module CARD_AS_BATTLER
- NON_CLASS_BATTLER_IMAGE = "bt_mgirl_pudding_a" # In Graphics/Battlers Folder
- BATTLER_POSITION = [445,265] # [ X , Y ]
- ZOOM_SCALE = 1.0 # 1.0 = Full size
- end # CARD_AS_BATTLER
- end # DSIVER144
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # * Create Actor Sprite
- # By default, the actor image is not displayed, but for convenience
- # a dummy sprite is created for treating enemies and allies the same.
- #--------------------------------------------------------------------------
- def create_actors
- @actor_sprites = Array.new(4) { Sprite_Battler.new(@viewport1) }
- end
- end # Spriteset_Battle
- class Game_Actor
- include DSIVER144::CARD_AS_BATTLER
- #--------------------------------------------------------------------------
- # * new method: screen_x
- #--------------------------------------------------------------------------
- def screen_x
- return BATTLER_POSITION[0]
- end
- #--------------------------------------------------------------------------
- # * new method: screen_y
- #--------------------------------------------------------------------------
- def screen_y
- return BATTLER_POSITION[1]
- end
- #--------------------------------------------------------------------------
- # * new method: screen_z
- #--------------------------------------------------------------------------
- def screen_z
- return 100
- end
- end
- class Sprite_Battler < Sprite_Base
- include DSIVER144::CARD_AS_BATTLER
- #--------------------------------------------------------------------------
- # * Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :battler
- #--------------------------------------------------------------------------
- # * new method: initialize
- #--------------------------------------------------------------------------
- alias_method(:dsi_init_battler, :initialize)
- def initialize(viewport, battler = nil)
- dsi_init_battler(viewport, battler)
- self.zoom_x = self.zoom_y = ZOOM_SCALE
- end
- #--------------------------------------------------------------------------
- # * new method: update
- #--------------------------------------------------------------------------
- def update
- super
- if @battler
- update_bitmap
- update_origin
- update_position
- setup_new_effect
- setup_new_animation
- update_effect
- else
- self.bitmap = nil
- @effect_type = nil
- end
- end
- #--------------------------------------------------------------------------
- # * new method: update_bitmap
- #--------------------------------------------------------------------------
- def update_bitmap
- if @battler.actor?
- id = $game_system.current_class ? $game_system.current_class : 0
- if id == 0
- new_bitmap = Cache.battler(NON_CLASS_BATTLER_IMAGE,0)
- else
- new_bitmap = Cache.picture(DSIVER144::CLASS_CHOOSING::CLASSES[id][:picture])
- end
- else
- new_bitmap = Cache.battler(@battler.battler_name, @battler.battler_hue)
- end
- if bitmap != new_bitmap
- self.bitmap = new_bitmap
- init_visibility
- end
- end
- end # Sprite_CardBattler
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement