Here's my code:
Code: Select all
ACTOR GrenadeTimer : Inventory
{
Inventory.MaxAmount 230
+INVENTORY.IGNORESKILL
}
ACTOR CoolGrenade
{
PROJECTILE
-NOGRAVITY
+RANDOMIZE
+DEHEXPLOSION
+NOTELESTOMP
+NOICEDEATH
+DONTTRANSLATE
+BOUNCEONWALLS
+BOUNCEONFLOORS
+BOUNCEONCEILINGS
+USEBOUNCESTATE
Radius 4
Height 8
BounceFactor 0.9
WallBounceFactor 0.25
Mass 5
Speed 35
Damage 100
BounceType "Grenade"
States
{
Spawn:
TNT1 A 0 A_GiveInventory("GrenadeTimer", 0)
Spawned:
SGRN A 1 Bright
Loop
SpawnBounced:
SGRN A 1 Bright A_TakeInventory("GrenadeTimer", 1)
TNT1 A 0 A_JumpIfInventory("GrenadeTimer", 1, "SpawnBounced")
Goto Death
Bounce:
SGRN A 0
{
A_SetAngle(angle + random(-5, 5));
A_ChangeVelocity(((abs(velx) + abs(vely)) * cos(angle)) * frandom(BounceFactor - 0.3, BounceFactor + 0.1), ((abs(velx) + abs(vely)) * sin(angle)) * frandom(BounceFactor - 0.3, BounceFactor + 0.1), velz * frandom(BounceFactor - 0.3, BounceFactor + 0.1), CVF_REPLACE);
}
Goto SpawnBounced
Sit:
SGRN A 1 Bright
Goto Death
Death:
MISL A 0 A_ScreamAndUnblock
MISL B 8 Bright A_Explode
MISL C 6 Bright
MISL D 4 Bright
Stop
}
}Im using an actor as a timer and i dont think that works on projectiles though... But I hope you can see what im trying to do here and help me get unstuck if you know what i mean.
~Thank you.