Skip to content

Commit

Permalink
Artifact ported
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKins committed Apr 24, 2019
1 parent c6170ba commit 8f546fa
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
71 changes: 71 additions & 0 deletions metadoom-dev/actors/inventory/theartifact.zsc
@@ -1,3 +1,74 @@
// The Artifact!!!
class ArtifactSoundToken : _Boolean {}

class ArtifactPickup : CustomInventory
{
Default
{
inventory.pickupmessage "$GOTARTIFACT";
Tag "$TAGARTIFACT";
inventory.icon "INVARTI";
inventory.pickupsound "inventory/artifact/get";
+INVENTORY.ALWAYSPICKUP
+FLOATBOB
scale 0.75;
+BLOCKASPLAYER
}

states
{
Spawn:
ARTI ZYXY 10 bright;
loop;
Pickup:
TNT1 A 0 A_GiveInventory ("Artifact", 1);
TNT1 A 0 A_GiveInventory ("GrenadeAmmo", 3);
stop;
}
}

class Artifact : CustomInventory
{
Default
{
inventory.pickupmessage "$GOTARTIFACT";
Tag "$TAGARTIFACT";
inventory.icon "INVARTI";
inventory.pickupsound "inventory/artifact/get";
inventory.amount 1;
inventory.maxamount 1;
+INVENTORY.INVBAR
scale 0.75;
+FLOATBOB
}

states
{
Spawn:
ARTI ZYXY 10;
loop;
Use:
TNT1 A 0 A_JumpIfInventory("InventoryCooldownToken", 1, "FailureCooldown");
TNT1 A 0 A_JumpIfInventory("ArtifactTimer", 1, "FailureCooldown");
TNT1 A 0 ACS_NamedExecuteWithResult("InventoryCooldown");
TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, "Fire");
goto Failure;
Fire:
TNT1 A 0 A_PlaySound("inventory/artifact/on");
TNT1 A 0 A_GiveInventory("ArtifactTimer", 175);
TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1);
fail;
Failure:
TNT1 A 0 A_PlaySound("menu/invalid");
TNT1 A 0 A_Log("You don't have any grenades!", 1);
fail;
FailureCooldown:
TNT1 A 0;
TNT1 A 0;
fail;
}
}

class ArtifactEffect : PowerupGiver
{
Default
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion metadoom-dev/decorate.dec
Expand Up @@ -60,7 +60,7 @@ Index
#include "actors/inventory/siphongrenade.dec"
#include "actors/inventory/hologram.dec"
//#include "actors/inventory/kineticmine.dec"
#include "actors/inventory/theartifact.dec"
//#include "actors/inventory/theartifact.dec"
#include "actors/inventory/dogcollar.dec"
#include "actors/weapons/doggun.dec"

Expand Down

0 comments on commit 8f546fa

Please sign in to comment.