2016-10-16 22:21:52 +00:00
|
|
|
|
|
|
|
// Teleport (self) ----------------------------------------------------------
|
|
|
|
|
2016-11-25 18:52:35 +00:00
|
|
|
class ArtiTeleport : Inventory
|
2016-10-16 22:21:52 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+COUNTITEM
|
|
|
|
+FLOATBOB
|
|
|
|
+INVENTORY.INVBAR
|
|
|
|
Inventory.PickupFlash "PickupFlash";
|
|
|
|
+INVENTORY.FANCYPICKUPSOUND
|
|
|
|
Inventory.DefMaxAmount;
|
|
|
|
Inventory.Icon "ARTIATLP";
|
|
|
|
Inventory.PickupSound "misc/p_pkup";
|
|
|
|
Inventory.PickupMessage "$TXT_ARTITELEPORT";
|
|
|
|
Tag "$TAG_ARTITELEPORT";
|
|
|
|
}
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
ATLP ABCB 4;
|
|
|
|
Loop;
|
|
|
|
}
|
2016-11-25 18:52:35 +00:00
|
|
|
|
|
|
|
override bool Use (bool pickup)
|
|
|
|
{
|
|
|
|
Vector3 dest;
|
|
|
|
int destAngle;
|
|
|
|
|
|
|
|
if (deathmatch)
|
|
|
|
{
|
2019-01-28 01:44:05 +00:00
|
|
|
[dest, destAngle] = level.PickDeathmatchStart();
|
2016-11-25 18:52:35 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-01-28 01:44:05 +00:00
|
|
|
[dest, destAngle] = level.PickPlayerStart(Owner.PlayerNumber());
|
2016-11-25 18:52:35 +00:00
|
|
|
}
|
|
|
|
dest.Z = ONFLOORZ;
|
|
|
|
Owner.Teleport (dest, destAngle, TELF_SOURCEFOG | TELF_DESTFOG);
|
|
|
|
bool canlaugh = true;
|
|
|
|
Playerinfo p = Owner.player;
|
|
|
|
if (p && p.morphTics && (p.MorphStyle & MRF_UNDOBYCHAOSDEVICE))
|
|
|
|
{ // Teleporting away will undo any morph effects (pig)
|
2018-11-24 07:39:35 +00:00
|
|
|
if (!p.mo.UndoPlayerMorph (p, MRF_UNDOBYCHAOSDEVICE) && (p.MorphStyle & MRF_FAILNOLAUGH))
|
2016-11-25 18:52:35 +00:00
|
|
|
{
|
|
|
|
canlaugh = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (canlaugh)
|
|
|
|
{ // Full volume laugh
|
2020-01-04 13:15:32 +00:00
|
|
|
Owner.A_StartSound ("*evillaugh", CHAN_VOICE, CHANF_DEFAULT, 1., ATTN_NONE);
|
2016-11-25 18:52:35 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-10-16 22:21:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|