Enelvon

SES - XP-style Passage setting

Dec 6th, 2012
157
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module SES module Map
  2.   # This is the number of the terrain tag that signifies that the new passage
  3.   # setting should be used for the tile. Make sure to set the normal passage
  4.   # to ☆ or it won't work.
  5.   XPPass = 1
  6. end end
  7.      
  8.   class Game_CharacterBase
  9.     attr_accessor :z
  10.     alias en_xpp_gcb_sz screen_z
  11.     def screen_z
  12.       @z || en_xpp_gcb_sz
  13.     end
  14.   end
  15.  
  16.   class Game_Map
  17.     def tile_above_char(c)
  18.       x, y = c.x, c.y - 1
  19.       all_tiles(x, y).each do |tile_id|
  20.         flag = tileset.flags[tile_id]
  21.         return true if (flag & 0x10 != 0) && (terrain_tag(x, y) == SES::Map::XPPass)
  22.       end
  23.       return false
  24.     end
  25.   end
  26.      
  27.   class Spriteset_Map
  28.     alias en_xpp_sm_ut update_tilemap
  29.     def update_tilemap
  30.       @character_sprites.each do |c|
  31.         if $game_map.tile_above_char(c.character) && c.character.priority_type == 1
  32.           c.character.z = 205
  33.         else c.character.z = nil if !c.character.z.nil? && !c.character.moving? end
  34.       end
  35.     en_xpp_sm_ut
  36.   end
  37. end
RAW Paste Data