Vlue

Script Things

Mar 27th, 2015
126
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Sprite_Character < Sprite_Base
  2.   def set_character_bitmap
  3.     self.bitmap = Cache.character(@character_name)
  4.     @sign = @character_name[/^[\!\$\@]./]
  5.     if @sign && @sign.include?('@')
  6.       @cw = bitmap.width / 8
  7.       @ch = bitmap.height / 4
  8.     elsif @sign && @sign.include?('$')
  9.       @cw = bitmap.width / 3
  10.       @ch = bitmap.height / 4
  11.     else
  12.       @cw = bitmap.width / 12
  13.       @ch = bitmap.height / 8
  14.     end
  15.     self.ox = @cw / 2
  16.     self.oy = @ch
  17.   end
  18.   def update_src_rect
  19.     if @tile_id == 0
  20.       index = @character.character_index
  21.       max = (@sign && @sign.include?('@')) ? 8 : 3
  22.       pattern = @character.pattern < max ? @character.pattern : 1
  23.       sx = (index % 3 * 3 + pattern) * @cw
  24.       sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
  25.       self.src_rect.set(sx, sy, @cw, @ch)
  26.     end
  27.   end
  28. end
  29.  
  30. class Game_CharacterBase
  31.   def update_anime_pattern
  32.     if !@step_anime && @stop_count > 0
  33.       @pattern = @original_pattern
  34.     else
  35.       @pattern = (@pattern + 1) % pattern_max
  36.     end
  37.   end
  38.   def pattern_max
  39.     sign = @character_name[/^[\!\$\@]./]
  40.     sign && sign.include?('@') ? 9 : 4
  41.   end
  42. end
  43.  
  44. class Game_Player
  45.   def move_by_input
  46.     return if !movable? || $game_map.interpreter.running?
  47.     input = Input.dir8
  48.     return unless input > 0
  49.     return move_straight(input) if input % 2 == 0
  50.     vert = input > 6 ? 8 : 2
  51.     horz = input % 3 == 0 ? 6 : 4
  52.     move_diagonal(horz,vert)
  53.   end
  54. end
  55.  
  56. class Game_Interpreter
  57.   def overlap?(string)
  58.     event = $game_map.events[@event_id]
  59.     $game_map.events_xy(event.x,event.y).each do |event|
  60.       return true if event.name == string
  61.     end
  62.     return false
  63.   end
  64. end
  65.  
  66. class Game_Event
  67.   def name
  68.     @event.name
  69.   end
  70. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×