Advertisement
ijontichy

<stdin>

Nov 15th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. script SAMSARA_MEGAHEALTH (int hpcount, int hpPerSec, int delayTics)
  2. {
  3. int hpGiven = GetActorProperty(0, APROP_Health);
  4. SetActorProperty(0, APROP_Health, min(hpGiven + hpcount, 250));
  5. hpGiven = GetActorProperty(0, APROP_Health) - hpGiven;
  6.  
  7. hpPerSec = itof(hpPerSec) / 35;
  8.  
  9. int takeCounter, hpToTake;
  10.  
  11. while (1)
  12. {
  13. if (UnloadingNow)
  14. {
  15. SetActorProperty(0, APROP_Health, GetActorProperty(0, APROP_HEALTH) - hpGiven);
  16. break;
  17. }
  18.  
  19. if (delayTics > 0) { delayTics--; }
  20. else
  21. {
  22. takeCounter += hpPerSec;
  23. hpToTake = min(ftoi(takeCounter), hpGiven);
  24. hpGiven -= hpToTake;
  25.  
  26. SetActorProperty(0, APROP_Health, GetActorProperty(0, APROP_Health) - hpToTake);
  27. takeCounter -= itof(hpToTake);
  28. }
  29.  
  30. if (hpGiven <= 0) { break; }
  31. Delay(1);
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement