class Game_Event < Game_Character
def has_shadow()
for p in @event.pages
for command in p.list
if command.code == 108
if command.parameters[0]=="Shadow"
return 1
elsif command.parameters[0]=="Red Shadow"
return 2
end
end
end
end
return 0
end
end
class Game_Temp
attr_accessor :shadow_under_hero
attr_accessor :shadows_enabled
alias shadow_initialize initialize
def initialize
@shadow_under_hero=false
@shadows_enabled=true
# Original call
shadow_initialize
end
end
class Sprite_Character
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If tile ID, file name, or hue are different from current ones
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# Remember tile ID, file name, and hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# If tile ID value is valid
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# If tile ID value is invalid
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
# charlie
if $game_temp.shadows_enabled
if @character == $game_player
if $game_temp.shadow_under_hero
base_bitmap=Bitmap.new(self.bitmap.width,self.bitmap.height)
shadow_bitmap=Bitmap.new("Graphics/Pictures/shadow")
base_bitmap.stretch_blt(base_bitmap.rect, shadow_bitmap,
shadow_bitmap.rect)
base_bitmap.stretch_blt(base_bitmap.rect, self.bitmap,
self.bitmap.rect)
self.bitmap=base_bitmap
end
elsif @character.has_shadow==1
base_bitmap=Bitmap.new(self.bitmap.width,self.bitmap.height)
shadow_bitmap=Bitmap.new("Graphics/Pictures/shadow")
base_bitmap.stretch_blt(base_bitmap.rect, shadow_bitmap,
shadow_bitmap.rect)
base_bitmap.stretch_blt(base_bitmap.rect, self.bitmap,
self.bitmap.rect)
self.bitmap=base_bitmap
elsif @character.has_shadow==2
base_bitmap=Bitmap.new(self.bitmap.width,self.bitmap.height)
shadow_bitmap=Bitmap.new("Graphics/Pictures/red_shadow")
base_bitmap.stretch_blt(base_bitmap.rect, shadow_bitmap,
shadow_bitmap.rect)
base_bitmap.stretch_blt(base_bitmap.rect, self.bitmap,
self.bitmap.rect)
self.bitmap=base_bitmap
end
end
#charlie
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
# Set visible situation
self.visible = (not @character.transparent)
# If graphic is character
if @tile_id == 0
# Set rectangular transfer
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
# Set sprite coordinates
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# Set opacity level, blend method, and bush depth
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animation
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
end
class Scene_Map
def remake_spriteset
# Remake sprite set
@spriteset.dispose
@spriteset = Spriteset_Map.new
end
end