Advertisement
roninator2

Cozziekuns Earthbound Addon - Odometer roll fix

Dec 17th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.14 KB | None | 0 0
  1. # https://forums.rpgmakerweb.com/index.php?threads/vx-ace-need-help-with-cozziekuns-earthbound-scripts.138226/#post-1200040
  2.  
  3. class Scene_Battle
  4.  
  5.   def update_odometer
  6.     $game_party.members.each { |actor|
  7.       if actor.odometer_hp != 0 or actor.odometer_mp != 0
  8.         if actor.odometer_hp != 0 and Graphics.frame_count % Earthboundish::Odometer_Roll_Speed == 0
  9.           damage = actor.odometer_hp > 0 ? 1 : - 1
  10.           actor.hp -= damage
  11.           actor.odometer_hp -= damage
  12.         end
  13.         if actor.odometer_mp != 0 and Graphics.frame_count % Earthboundish::Odometer_Roll_Speed == 0
  14.           damage = actor.odometer_mp > 0 ? 1 : - 1
  15.           actor.mp -= damage
  16.           actor.odometer_mp -= damage
  17.         end
  18.         @status_window.refresh_hpmp(actor, actor.index)
  19.         if actor.hp == 0 or (actor.hp == actor.mhp) and damage != nil
  20.           damage = 0
  21.           actor.odometer_hp = 0
  22.         end
  23.         if actor.mp == 0 or (actor.mp == actor.mmp) and damage != nil
  24.           damage = 0
  25.           actor.odometer_mp = 0
  26.         end
  27.         @status_window.refresh_hpmp(actor, actor.index)
  28.       end
  29.     }
  30.   end
  31.  
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement