Guest User

Untitled

a guest
Feb 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1.     pointlist = []
  2.     hp = state.entities[game.focus_object_id].hp
  3.     maxhp = state.entities[game.focus_object_id].maxhp
  4.     proportion = hp/maxhp
  5.     y = round(proportion*18)+10# 18=Total size of the whole thing; 10=Offset of the cross.
  6.  
  7. '''
  8. Coordinates:
  9.  
  10.        27|10   35|10
  11.  
  12. 22|15   27|15   35|15   40|15
  13.  
  14. 22|23   27|23   35|23   40|23
  15.  
  16.        27|28   35|28
  17. '''
  18.  
  19.     if hp != 0:
  20.  
  21.         pointlist.append((27, 28))# The bottom-left corner.
  22.  
  23.         if proportion > 2.0/9.0:
  24.             pointlist.append((27, 23))
  25.             pointlist.append((22, 23))
  26.  
  27.             if proportion > 13.0/18.0:
  28.                 pointlist.append((22, 15))
  29.                 pointlist.append((27, 15))
  30.  
  31.                 if maxhp == hp:
  32.                     pointlist.append((27, 10))
  33.                     pointlist.append((35, 10))
  34.  
  35.                 else:
  36.                     pointlist.append((27, y))
  37.                     pointlist.append((35, y))
  38.  
  39.                 pointlist.append((35, 15))
  40.                 pointlist.append((40, 15))
  41.  
  42.             else:
  43.                 pointlist.append((22, y))
  44.                 pointlist.append((40, y))
  45.  
  46.             pointlist.append((40, 23))
  47.             pointlist.append((35, 23))
  48.  
  49.         else:
  50.             pointlist.append((27, y))
  51.             pointlist.append((35, y))
  52.  
  53.         pointlist.append((35, 28))
Add Comment
Please, Sign In to add comment