Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================#
- # ** CHANGES
- #-*--------------------------------------------------------------------------*-#
- # Classes
- # Game_BattleAction
- # new-method :battle_vocab
- # new-method :battle_commands
- # Window_ActorCommand
- # new-method :draw_command
- # overwrite :initialize
- # overwrite :setup
- # overwrite :refresh
- # overwrite :draw_item
- # Scene_Battle
- # overwrite :execute_action_skill
- #
- #------------------------------------------------------------------------------#
- #==============================================================================#
- # $imported - Is mostly used by Japanese RPG Maker XP/VX scripters.
- # This acts as a flag, or signal to show that "x" script is present.
- # This is used for compatability with other future scripts.
- $imported = {} if $imported == nil
- $imported["IEO-CustomBattleStatus"] = true
- #==============================================================================#
- # $ieo_script - This is a hash specific to IEO scripts
- # they work just like the $imported, but there key is slightly
- # different, it is an array conatining an integer
- # and a string, since IEO script all have an ID, the value
- # is the scripts version number.
- # A version number of nil, or 0 means the script isn't present
- # EG. $ieo_script[[ScriptID, "ScriptName"]]
- $ieo_script = {} if $ieo_script == nil
- $ieo_script[[6, "CustomBattleStatus"]] = 1.0
- #-*--------------------------------------------------------------------------*-#
- #==============================================================================#
- # Window_BattleStatus
- #==============================================================================#
- class Window_BattleStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, (Graphics.width-128), 128) # 128
- @draw_style = 1 # //
- @state_drawstyle = 1 # //
- @spacing = 4
- @members = []
- @state_sprites = []
- @state_drawsizes = []
- @state_viewports = []
- # // This is the scroll speed, icons are 24x24 so setting it to 24 will result
- # // in icon flipping
- @scrolling_speed = 24 #1
- @scrolling_delay = 0
- # // This is the frame delay between scrolling
- @scrolling_delaymax = 3
- # //
- for i in 0...$game_party.members.size
- create_state_sprite(i)
- end
- self.opacity = 0
- refresh
- self.active = false
- end
- def create_state_sprite(index)
- rect = item_rect(index)
- @state_viewports[index] = Viewport.new(rect.x + 96 - 24, rect.y + 96 - 24,
- 24, 24)
- @state_sprites[index] = Plane.new(@state_viewports[index])
- @state_sprites[index].bitmap = Bitmap.new(24*16, 24)
- update_state
- end
- #--------------------------------------------------------------------------#
- # * overwrite method :refresh
- #--------------------------------------------------------------------------#
- def refresh
- case @draw_style
- when 0 ; self.width = (Graphics.width-128)
- when 1 ; self.width = (Graphics.width-96)
- end
- create_contents
- @members = $game_party.members
- @item_max = @members.size
- setup_column_max
- for i in 0...@item_max
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------#
- # * new method :setup_column_max
- #--------------------------------------------------------------------------#
- def setup_column_max
- case @draw_style
- when 0
- @column_max = 2
- when 1
- @column_max = @item_max
- end
- end
- #--------------------------------------------------------------------------#
- # * overwrite method :item_rect
- #--------------------------------------------------------------------------#
- def item_rect(index)
- rect = Rect.new(0, 0, 0, 0)
- case @draw_style
- when 0
- rect.width = (contents.width + @spacing) / @column_max - @spacing
- rect.height = WLH*2
- rect.x = index % @column_max * (rect.width + @spacing)
- rect.y = index / @column_max * WLH*2
- when 1
- rect.width = 96 + 32
- rect.height = 96
- rect.x = index % @column_max * (rect.width + @spacing)
- rect.y = index / @column_max * WLH*2
- end
- return rect
- end
- #--------------------------------------------------------------------------#
- # * overwrite method :draw_item
- #--------------------------------------------------------------------------#
- def draw_item(index)
- rect = item_rect(index)
- rect.x += 4
- rect.width -= 8
- self.contents.clear_rect(rect)
- self.contents.font.color = normal_color
- actor = @members[index]
- case @draw_style
- when 0
- otrect = Rect.new(rect.x+2, rect.y+2, rect.height-4, rect.height-4)
- draw_outlined_actor(actor, otrect, 2, Color.new(0, 0, 0, 96))
- trect = Rect.new(otrect.x+otrect.width+32, rect.y+2, rect.width, 24)
- draw_icon(IEO::Icon.battle_action(actor, actor.action), trect.x-28, rect.y, actor.action.valid?)
- self.contents.font.size = 16
- draw_actor_name(actor, rect.x, rect.y+rect.height-24)
- draw_states(index, actor, trect)
- draw_actor_hp_gauge(actor, trect.x-24, trect.y+8, 96)
- draw_actor_mp_gauge(actor, trect.x-12, trect.y+20, 96)
- self.contents.font.size = 12
- self.contents.draw_text(trect.x, trect.y+12, 120, 24,
- sprintf("%s/%s", actor.hp, actor.maxhp) )
- self.contents.draw_text(trect.x+12, trect.y+24, 120, 24,
- sprintf("%s/%s", actor.mp, actor.maxmp) )
- #draw_actor_hp(actor, trect.x, trect.y+24, 120)
- #draw_actor_mp(actor, 310, rect.y, 70)
- when 1
- self.contents.font.size = 16
- draw_actor_face(actor, rect.x, rect.y)
- draw_actor_name(actor, rect.x, rect.y)
- #draw_actor_state(actor, rect.x, rect.y+96-24, 96)
- trect = rect.clone ; trect.y += 96-24
- draw_states(index, actor, trect)
- brect = rect.clone
- brect.x += rect.width - 24
- brect.width = 12
- brect.y += 16
- brect.height -= 16
- # // HP
- draw_vertical_grad_bar(brect, actor.hp, actor.maxhp,
- hp_gauge_color1, hp_gauge_color2, Color.new(20, 20, 20),
- 2, false, true)
- # //
- self.contents.font.size = 16
- self.contents.draw_text(brect.x, brect.y-16, 24, 24, Vocab.hp_a)
- brect.x += 14
- # // MP
- draw_vertical_grad_bar(brect, actor.mp, actor.maxmp,
- mp_gauge_color1, mp_gauge_color2, Color.new(20, 20, 20),
- 2, false, true)
- # //
- self.contents.font.size = 16
- self.contents.draw_text(brect.x, brect.y-16, 24, 24, Vocab.mp_a)
- end
- end
- #--------------------------------------------------------------------------#
- # * new method :draw_states
- #--------------------------------------------------------------------------#
- def draw_states(index, actor, rect)
- case @state_drawstyle
- when 0
- draw_actor_state(actor, rect.x, rect.y, 96)
- when 1
- c = 0
- @state_drawsizes[index] = actor.states.size
- @state_sprites[index].bitmap.dispose
- @state_sprites[index].bitmap = Bitmap.new([24*@state_drawsizes[index], 24].max, 24)
- for st in actor.states
- @state_sprites[index].bitmap.draw_icon(st.icon_index, c*24, 0) ; c += 1
- end
- end
- end
- #--------------------------------------------------------------------------#
- # * alias method :dispose
- #--------------------------------------------------------------------------#
- alias ieo006_dispose dispose unless $@
- def dispose
- ieo006_dispose
- for sp in @state_sprites.compact ; sp.dispose end
- end
- #--------------------------------------------------------------------------#
- # * alias method :update
- #--------------------------------------------------------------------------#
- alias ieo006_update update unless $@
- def update
- ieo006_update
- update_state
- end
- #--------------------------------------------------------------------------#
- # * alias method :update_state
- #--------------------------------------------------------------------------#
- def update_state
- @scrolling_delay -= 1
- for i in 0...@state_sprites.size
- rect = item_rect(i)
- st = @state_sprites[i]
- vis2 = true ; vis2 = self.viewport.visible unless self.viewport.nil?
- st.visible = (self.visible && vis2)
- if st.bitmap.width > 24 ; st.ox += @scrolling_speed
- else ; st.ox = 0 ; end if @scrolling_delay <= 0
- dx, dy = 0, 0
- unless self.viewport.nil?
- dx, dy = self.viewport.rect.x, self.viewport.rect.y
- dx -= self.viewport.ox
- dy -= self.viewport.oy
- end
- @state_viewports[i].rect.set(
- dx+ self.x + rect.x + 96-4, dy + self.y + rect.y + 96-4,
- 24, 24)
- @state_viewports[i].z = self.z
- @state_viewports[i].update
- end
- if Input.trigger?(Input::F6)
- rec = @state_viewports[0].rect
- [self.viewport.rect.x, self.viewport.rect.y].each { |sx| print sx }
- [self.viewport.ox, self.viewport.oy].each { |sx| print sx }
- #[self.x, self.y].each { |sx| print sx }
- [rec.x, rec.y].each { |xc| print xc }
- end
- @scrolling_delay = @scrolling_delaymax if @scrolling_delay <= 0
- end
- end
- #==============================================================================#
- # Scene_Battle
- #==============================================================================#
- class Scene_Battle < Scene_Base
- alias ieo006_start_party_command_selection start_party_command_selection unless $@
- def start_party_command_selection
- ieo006_start_party_command_selection
- @status_window.refresh
- end
- #~ alias ieo006_end_item_selection end_item_selection unless $@
- #~ def end_item_selection
- #~ ieo006_end_item_selection
- #~ @status_window.refresh
- #~ end
- #~
- #~ alias ieo006_end_skill_selection end_skill_selection unless $@
- #~ def end_skill_selection
- #~ ieo006_end_skill_selection
- #~ @status_window.refresh
- #~ end
- #~
- #~ alias ieo006_end_target_enemy_selection end_target_enemy_selection unless $@
- #~ def end_target_enemy_selection
- #~ ieo006_end_target_enemy_selection
- #~ @status_window.refresh
- #~ end
- #~
- #~ alias ieo006_end_target_actor_selection end_target_actor_selection unless $@
- #~ def end_target_actor_selection
- #~ ieo006_end_target_actor_selection
- #~ @status_window.refresh
- #~ end
- alias ieo006_next_actor next_actor unless $@
- def next_actor
- ieo006_next_actor
- @status_window.refresh
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment