SHARE
TWEET

Ct hp bar text

Cronokirby Jun 19th, 2016 (edited) 142 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while true do
  2.  
  3. --Colors
  4.     Red=0xb0Ed0032
  5.     TranspRed=0x40ed0032
  6.     Purple=0x909432ff
  7. -- Declarations related to the first enemy's stats
  8. Enemy1MaxHP = mainmemory.read_u16_le(0x5fb2)
  9. Enemy1HP = mainmemory.read_u16_le(0x5fb0)
  10. Enemy1Xpos = mainmemory.read_u8(0x975d)
  11. Enemy1Ypos = mainmemory.read_u8(0x9768)-30
  12. Enemy1ATB = mainmemory.read_u8(0xafae)
  13.  
  14.  
  15.  
  16.  
  17. if  mainmemory.read_u8(0xAFAE) < 100 and Enemy1MaxHP ~= 0 then
  18.  
  19. if Enemy1MaxHP <=100 then
  20. E1MaxRectangleSize =  Enemy1MaxHP*0.04+6
  21. E1RectangleSize = Enemy1HP/Enemy1MaxHP*(Enemy1MaxHP*0.04+6)
  22. elseif Enemy1MaxHP <= 1000 then
  23. E1MaxRectangleSize = ((Enemy1MaxHP-100)*(10/900))+10
  24. E1RectangleSize = Enemy1HP/Enemy1MaxHP*((Enemy1MaxHP-100)*(10/900)+10)
  25. elseif Enemy1MaxHP <= 10000 then
  26. E1MaxRectangleSize = (Enemy1MaxHP-1000)*(10/9000)+20
  27. E1RectangleSize = Enemy1HP/Enemy1MaxHP*((Enemy1MaxHP-1000)*(10/9000)+20)
  28. elseif Enemy1MaxHP > 10000 then
  29. E1MaxRectangleSize = 30
  30. E1RectangleSize =Enemy1HP/Enemy1MaxHP*30
  31. end
  32.  
  33. gui.drawRectangle(Enemy1Xpos,Enemy1Ypos,E1RectangleSize,4,Red,Red)
  34. gui.drawRectangle(Enemy1Xpos,Enemy1Ypos,E1MaxRectangleSize,4,TranspRed,TranspRed)
  35. gui.drawText(Enemy1Xpos,Enemy1Ypos-10,Enemy1HP ,0xFFFFFFFF,8)
  36.  
  37. gui.drawRectangle(Enemy1Xpos,Enemy1Ypos+20,Enemy1ATB,4,Purple,Purple)
  38. gui.drawText(Enemy1Xpos,Enemy1Ypos+10,Enemy1ATB,0xFFFFFFFF,8)
  39. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top