refin.acs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #library "refin.acs"
  2. #include "zcommon.acs"
  3. #define MAX_VOLUME 127
  4. #define MAX_PLAYER_HEALTH 200
  5. //fadescript for map setup
  6. script "Maplaunch" ENTER
  7. {
  8. FadeRange(0,0,0,1.0,0,0,0,0.0,1.5);
  9. }
  10. //lowhealth scripts - from BoA
  11. script "30Health" ENTER
  12. {
  13. int width = 640, height = 480;
  14. SetHudSize(width, height, 0);
  15. SetFont("M_INJ");
  16. // Half width and height (in fixed-point).
  17. int half_width = (width / 2) << 16;
  18. int half_height = (height / 2) << 16;
  19. while (true)
  20. {
  21. int health = GetActorProperty(0, APROP_HEALTH);
  22. if (health > 0 && health <= 30)
  23. {
  24. HudMessage(s:"A"; HUDMSG_FADEINOUT, 0, CR_WHITE, half_width, half_height, 0.0, 0.5, 0.5);
  25. // Volume and delay of heartbeat (faster and louder with less health).
  26. int volume = MAX_VOLUME;
  27. int delay1 = 10;
  28. int delay2 = 14;
  29. if (health > 20)
  30. {
  31. volume = MAX_VOLUME - 50;
  32. delay1 = 21;
  33. delay2 = 34;
  34. }
  35. else if (health > 10)
  36. {
  37. volume = MAX_VOLUME - 25;
  38. delay1 = 18;
  39. delay2 = 24;
  40. }
  41. LocalAmbientSound("hbeat", volume);
  42. Delay(delay1);
  43. LocalAmbientSound("hbeat", volume);
  44. Delay(delay2);
  45. }
  46. Delay(1);
  47. }
  48. }