# ▽△▽ XRXSv9. BaST-VX.TG2. ターゲットアイコン ▽△▽ # # publish 2010/ 4/21 # update - /21b # #============================================================================== # カスタマイズポイント #============================================================================== module XRXSV9 # # 使用するアイコンのインデックス # TGIconIndex = 143 # # ズーム率 # TGZoom = 2.0 # # バトラーの足元からアイコン表示位置のずれ # TG_OX = 0 TG_OY = -48 # # 自動追尾する?(サイドビューなどでの移動に) # TGAutoChase = true end #============================================================================== # ターゲットアイコンスプライト #============================================================================== class Sprite_TargetIcon < Sprite_Base def initialize super self.bitmap = Cache.system("Iconset") rect = Rect.new(XRXSV9::TGIconIndex % 16 * 24, XRXSV9::TGIconIndex / 16 * 24, 24, 24) self.src_rect = rect self.zoom_x = XRXSV9::TGZoom self.zoom_y = XRXSV9::TGZoom self.z = 602 self.ox = 12 self.oy = 24 set_battler(nil) end def set_battler(battler) @battler = battler if @battler @step_count = 0 reset_position self.visible = true else self.visible = false end end def update super if self.visible @step_count = (@step_count + 1) % 40 case @step_count when 0 self.y -= 2 when 10 self.y += 2 when 20 self.y -= 1 when 30 self.y += 1 end reset_position if XRXSV9::TGAutoChase end end def reset_position self.x = [[@battler.screen_x + XRXSV9::TG_OX, 12].max, Graphics.width-12].min self.y = [[@battler.screen_y + XRXSV9::TG_OY, 128].max, 248].min end end #============================================================================== # ■ Window_TargetEnemy #============================================================================== module XRXSV9TG1_Window def refresh @enemies = self.members @item_max = [@enemies.size, 1].max @column_max = @item_max if self.index >= @item_max self.index = @item_max - 1 end refresh_name end def update super @targeticon_sprite.update refresh_name if @last_index != self.index end def refresh_name @last_index = self.index @targeticon_sprite.set_battler(self.enemy) end def dispose @targeticon_sprite.dispose super end def update_cursor self.cursor_rect.empty end end class Window_TargetEnemy < Window_Command include XRXSV9TG1_Window def initialize @targeticon_sprite = Sprite_TargetIcon.new super(36, [""]) self.contents.clear self.opacity = 0 self.index = 0 refresh end def members $game_troop.existing_members end end class Window_TargetActor < Window_Command include XRXSV9TG1_Window def initialize @targeticon_sprite = Sprite_TargetIcon.new super(36, [""]) self.contents.clear self.opacity = 0 self.index = 0 refresh end def enemy @enemies[self.index] end def members $game_party.members end end