shadowm

Untitled

Jun 4th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # unit's hitpoints drop by $dehydration_loss, but cannot kill it
  2. [if]
  3. [variable]
  4. name=dehydrating_units[$i].hitpoints
  5. greater_than=$dehydration_loss
  6. [/variable]
  7. [then]
  8. {VARIABLE_OP dehydrating_units[$i].hitpoints add -$dehydration_loss}
  9. [/then]
  10. [else]
  11. {VARIABLE dehydrating_units[$i].hitpoints 1}
  12. [/else]
  13. [/if]
  14.  
  15. -->
  16.  
  17. -- HP drops by dehydration_loss, but cannot drop to zero.
  18. u.hitpoints = math.max(1, u.hitpoints - dehydration_loss)
Advertisement
Add Comment
Please, Sign In to add comment