Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- # Shade Terrain Tag
- # Author: ForeverZer0
- # Version: 1.0
- # Date: 6.27.2012
- #+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- #
- # Simply shades characters by blending a color with their sprites whenever they
- # are stepping on a tile with a specific terrain tag. Not a whole lote more to
- # it than that.
- #
- # See below to adjust the blend color and terrain tag number.
- #
- ##+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
- #===============================================================================
- # ** Game_Character
- #===============================================================================
- class Game_Character
- #-----------------------------------------------------------------------------
- # * Configuration
- #-----------------------------------------------------------------------------
- SHADE_TERRAIN_TAG = 7
- SHADE_COLOR = Color.new(0, 0, 0, 60)
- #-----------------------------------------------------------------------------
- # * Public Instance Variables
- #-----------------------------------------------------------------------------
- attr_reader :shaded
- #-----------------------------------------------------------------------------
- # * Frame Update (alias)
- #-----------------------------------------------------------------------------
- alias shade_terrain_tag_update update
- def update
- @shaded = self.terrain_tag == SHADE_TERRAIN_TAG
- shade_terrain_tag_update
- end
- end
- #===============================================================================
- # ** Sprite_Character
- #===============================================================================
- class Sprite_Character
- #-----------------------------------------------------------------------------
- # * Frame Update (alias)
- #-----------------------------------------------------------------------------
- alias shaded_blend_update update
- def update
- if @character.shaded && @blended == nil
- self.color = Game_Character::SHADE_COLOR
- @blended = true
- elsif !@character.shaded && @blended != nil
- self.color = Color.new(0, 0, 0, 0)
- @blended = nil
- end
- shaded_blend_update
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement