#==============================================================================
# □ RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# ○ 视界制限补正値
#--------------------------------------------------------------------------
def sight_power
unless @sight_power
@sight_power = /<视界补正\s*(\-*\d+)\s*>/ =~ @note ? $1.to_i : 0
end
@sight_power
end
end
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# ○ 视界制限补正値
#--------------------------------------------------------------------------
def sight_power
result = 0
feature_objects.each {|object| result += object.sight_power}
result
end
end
#==============================================================================
# □ Sprite_SightShadow
#==============================================================================
class Sprite_SightShadow < Sprite
#--------------------------------------------------------------------------
# ● 物件初期化
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
self.z = 199
self.bitmap = Bitmap.new(Graphics.width, Graphics.height)
@bitmap_shadow = Bitmap.new("Graphics/System/sight_shadow")
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
@bitmap_shadow.dispose
super
end
#--------------------------------------------------------------------------
# ● 帧更新
#--------------------------------------------------------------------------
def update
super
if TMBLSIGHT::SIGHT[$game_map.map_id]
self.visible = true
self.bitmap.clear
w = TMBLSIGHT::SIGHT[$game_map.map_id]
$game_party.battle_members.each{|actor| w = [w + actor.sight_power, 48].max}
w = [w + $game_variables[TMBLSIGHT::VN_SIGHT], 48].max
x = $game_player.screen_x - w / 2
y = $game_player.screen_y - w / 2 - 16
rect = Rect.new(x, y, w, w)
self.bitmap.stretch_blt(rect, @bitmap_shadow, @bitmap_shadow.rect)
color = Color.new(0, 0, 0)
self.bitmap.fill_rect(0, 0, Graphics.width, y, color)
self.bitmap.fill_rect(0, y + w, Graphics.width, Graphics.height - y - w,
color)
self.bitmap.fill_rect(0, y, x, w, color)
self.bitmap.fill_rect(x + w, y, Graphics.width - x - w, w, color)
else
self.visible = false
end
end
end