Code: Select all
class InFlightToken : Inventory{ Default{ Inventory.MaxAmount 1;}}
class ReadyForTeleToken : Inventory{ Default{ Inventory.MaxAmount 1;}}
class Tesseract : Actor
{
Default
{
Projectile;
Damage 10;
Speed 60;
+RIPPER;
+BLOODLESSIMPACT;
Alpha 0.85;
}
States
{
Spawn:
POST ABCDE 1 Bright;
TNT1 A 0 A_GiveInventory("InFlightToken");
Loop;
Death:
TNT1 A 1 A_TeleportPlayer();
TNT1 A 1 A_StartSound("misc/teleport", CHAN_AUTO);
TESS ABABCDEFGH 1 Bright;
TNT1 A 1 A_Print("Teleported");
TNT1 A 1 A_TakeInventory("InFlightToken");
Stop;
}
action void A_TeleportPlayer()
{
if (target == null){ return; }
else
{ target.SetOrigin(pos, false); }
}
}
class TesseractManager : EventHandler
{
override bool InputProcess(InputEvent e)
{
if (e.Type == InputEvent.Type_KeyDown)
{ SendNetworkEvent("tesseract_use", e.KeyScan); }
return false;
}
override void NetworkProcess(ConsoleEvent e)
{
actor plr;
if (e.Name == "tesseract_use")
{
int k1, k2;
let plr = players[e.Player].mo;
[k1, k2] = Bindings.GetKeysForCommand("tesseract");
if ((k1&&k1 == e.Args[0]) || (k2&&k2 == e.Args[0]))
{
//let plr = players[e.Player].mo; //mo = Map Object
plr.SpawnPlayerMissile("Tesseract");
}
}
}
}
1. I am able to "fire" multiple orbs instead of just only once.
2. When I press the "fire" button again while the orb is still in flight, it doesn't teleport me to where the orb currently is in space. The projectile will only teleport me when it hits another object or surface.
Does anyone know what I would need to add/write to make this ability function exactly like the Dire Orb?