Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script SAMSARA_MEGAHEALTH (int hpcount, int hpPerSec, int delayTics)
- {
- int hpGiven = GetActorProperty(0, APROP_Health);
- SetActorProperty(0, APROP_Health, min(hpGiven + hpcount, 250));
- hpGiven = GetActorProperty(0, APROP_Health) - hpGiven;
- hpPerSec = itof(hpPerSec) / 35;
- int takeCounter, hpToTake;
- while (1)
- {
- if (UnloadingNow)
- {
- SetActorProperty(0, APROP_Health, GetActorProperty(0, APROP_HEALTH) - hpGiven);
- break;
- }
- if (delayTics > 0) { delayTics--; }
- else
- {
- takeCounter += hpPerSec;
- hpToTake = min(ftoi(takeCounter), hpGiven);
- hpGiven -= hpToTake;
- SetActorProperty(0, APROP_Health, GetActorProperty(0, APROP_Health) - hpToTake);
- takeCounter -= itof(hpToTake);
- }
- if (hpGiven <= 0) { break; }
- Delay(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement