123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #library "tnt_base"
- #include "zcommon.acs"
- #define MAX_VOLUME 127
- #define MAX_PLAYER_HEALTH 200
- //fadescript for map setup
- script "Maplaunch" ENTER
- {
- FadeRange(0,0,0,1.0,0,0,0,0.0,1.5);
- }
- //lowhealth scripts - from BoA
- script "30Health" ENTER
- {
- int width = 640, height = 480;
- SetHudSize(width, height, 0);
- SetFont("M_INJ");
- // Half width and height (in fixed-point).
- int half_width = (width / 2) << 16;
- int half_height = (height / 2) << 16;
- while (true)
- {
- int health = GetActorProperty(0, APROP_HEALTH);
- if (health > 0 && health <= 30)
- {
- HudMessage(s:"A"; HUDMSG_FADEINOUT, 0, CR_WHITE, half_width, half_height, 0.0, 0.5, 0.5);
- // Volume and delay of heartbeat (faster and louder with less health).
- int volume = MAX_VOLUME;
- int delay1 = 10;
- int delay2 = 14;
- if (health > 20)
- {
- volume = MAX_VOLUME - 50;
- delay1 = 21;
- delay2 = 34;
- }
- else if (health > 10)
- {
- volume = MAX_VOLUME - 25;
- delay1 = 18;
- delay2 = 24;
- }
- LocalAmbientSound("hbeat", volume);
- Delay(delay1);
- LocalAmbientSound("hbeat", volume);
- Delay(delay2);
- }
- Delay(1);
- }
- }
|