I am Mr. Impatience


Code: Select all
//Respawn > Take one Life
script 803 RESPAWN
{
Thing_ChangeTID(0, PLAYER_TID + PlayerNumber());
if (CheckInventory("LifeItem") > 0)
{
// ...etc...
Code: Select all
//Death - Continue?
script 802 DEATH
{
// Stuff
}
else
TeleportOther(ActivatorTID(), PRISONSPOT + PlayerNumber(), 1);
Thing_ChangeTID(0, 0);
}
Code: Select all
/************************** Death *****************************/
//Death - Continue?
script 801 DEATH
{
int counter = 10;
if (CheckInventory("LifeItem") > 0)
{
while(GetActorProperty(0, APROP_HEALTH) <= 0 && counter > 0)
{
SetFont("BigFont");
SetHUDSize(640, 480, 1);
HUDMessage(s: "Continue?"; HUDMSG_PLAIN, 202, CR_WHITE, 320.0, 220.0, 1.0);
HUDMessage(d: counter; HUDMSG_PLAIN, 203, CR_WHITE, 320.0, 240.0, 1.0);
delay(35);
counter--;
}
if (counter == 0)
{
TeleportOther(ActivatorTID(), PRISONSPOT + PlayerNumber(), 1);
}
}
else
{
delay(1);
}
}
/********************* Respawn ************************/
//Static actions executed when the player respawns.
script 670 RESPAWN
{
Thing_ChangeTID(0, PLAYER_TID + PlayerNumber());
if (CheckInventory("LifeItem") > 0)
{
TakeInventory("LifeItem", 1);
}
else
{
TeleportOther(ActivatorTID(), PRISONSPOT + PlayerNumber(), 1);
Thing_ChangeTID(0, 0);
}
// clear messages
HUDMessage(s: ""; HUDMSG_PLAIN, 202, CR_WHITE, 0.0, 0.0, 0.0);
HUDMessage(s: ""; HUDMSG_PLAIN, 203, CR_WHITE, 0.0, 0.0, 0.0);
}
Code: Select all
Script 257 Death
{
Thing_ChangeTID(0, 0);
}
Code: Select all
#include "zcommon.acs"
script 669 enter
{
SetFont("BIGFONT");
SetHUDSize(640, 480, 1);
while (TRUE)
{
HUDMessage(s:"\cG", i:CheckInventory("LifeItem"); HUDMSG_PLAIN, 201, 0, 614.0, 376.0, 0.05);
delay(1);
}
}
script 801 death
{
int counter = 10;
if (CheckInventory("LifeItem") > 0)
{
SetFont("BIGFONT");
SetHUDSize(640, 480, 1);
while (counter > 0)
{
counter--;
HUDMessage(s:"\cG", i:CheckInventory("LifeItem"); HUDMSG_PLAIN, 201, 0, 614.0, 376.0, 0.05);
delay(1);
}
Teleport_NoFog(900+PlayerNumber(), 0, 0);
}
}
script 670 respawn
{
if (CheckInventory("LifeItem") > 0)
{
TakeInventory("LifeItem", 1);
}
else
{
Teleport_NoFog(900+PlayerNumber(), 0, 0);
}
HUDMessage(s: ""; HUDMSG_PLAIN, 202, CR_WHITE, 0.0, 0.0, 0.0);
HUDMessage(s: ""; HUDMSG_PLAIN, 203, CR_WHITE, 0.0, 0.0, 0.0);
}