// Replace with the MAPINFO version later (way later)!
DamageType Ignition
{
Factor 0
}

actor CanBeGrabBustered : Once { +INVENTORY.UNDROPPABLE }
actor CanBeMegaArmed : Once { +INVENTORY.UNDROPPABLE }

actor BaseFlagPack : CustomInventory
{
  +INVENTORY.AUTOACTIVATE
  States
  {
  Use:
      PLY1 H 0 A_GiveInventory("MM8BDMPlayer", 1)
      PLY1 H 0 A_GiveInventory("CanBeGrabBustered", 1)
      PLY1 H 0 A_GiveInventory("CanBeMegaArmed", 1)
      stop
  }
}

actor DeathFlagPack : BaseFlagPack
{
    States
    {
    Use:
        PLY1 H 0 A_TakeInventory("WeaponCharge",999)
        PLY1 H 0 A_TakeInventory("ConcreteTime", 999)
        PLY1 H 0 A_GiveInventory("CutterFlag",999)
        PLY1 H 0 A_GiveInventory("IsDead",1)
        PLY1 H 0 A_GiveToTarget("KilledMeStock",1)
        PLY1 H 0 A_GiveToTarget("KilledMe", 1)
        stop
    }
}

actor BlowDeathTimer : Inventory
{
    inventory.amount 1
    inventory.maxamount 35
}

actor MM8BDMPlayer : Once { +INVENTORY.UNDROPPABLE }

// V6 Water Actors
actor WaterGravityOn : CustomInventory
{
    States
    {
    Pickup:
        TNT1 A 1 ACS_ExecuteAlways(204,0,1)
        stop
    }
}

actor WaterGravityOff : CustomInventory
{
    States
    {
    Pickup:
        TNT1 A 1 ACS_ExecuteAlways(204,0,0)
        stop
    }
}

// Legacy Water items
actor LowGravity : CustomInventory
{
States
{
Pickup:
TNT1 A 1 ACS_ExecuteAlways(204,0,1)
TNT1 A 1 A_GiveInventory("IsUnderWater", 1)
TNT1 A 1 A_GiveInventory("HasFeetInWater", 1)
stop
}
}

actor NormalGravity : CustomInventory
{
States
{
Pickup:
TNT1 A 1 ACS_ExecuteAlways(204,0,0)
TNT1 A 1 A_TakeInventory("IsUnderWater", 1)
TNT1 A 1 A_TakeInventory("HasFeetInWater", 1)
stop
}
}

actor TeleportFlag : PowerUp 
{
powerup.duration 5
}

actor IsUnderWater : Once {}
actor HasFeetInWater : IsUnderWater {}

actor FlyActivate : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 1
loop
Pickup:
TNT1 A 0 A_GiveInventory("IsFlying", 1)
TNT1 A 1 SetPlayerProperty(0,1,3)
stop
}
}

actor FlyDeactivate : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 1
loop
Pickup:
TNT1 A 0 A_JumpIfInventory("TrebleFlightFlag",1,"Nope")
TNT1 A 0 A_JumpIfInventory("RushJetCounter",1,"Nope")
TNT1 A 0 A_JumpIfInventory("BeatCounter",1,"Nope")
TNT1 A 0 A_JumpIfInventory("RushMarineCounter",1,"UnderWaterCheck")
Goto DeactivateNow
UnderWaterCheck:
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Nope")
Goto DeactivateNow
DeactivateNow:
TNT1 A 0 A_TakeInventory("IsFlying", 1)
TNT1 A 1 SetPlayerProperty(0,0,3)
stop
Nope:
TNT1 A 0
stop
}
}

actor IsFlying : Once {}
actor BoostFlag : Once {}

actor ImOnFire
{
+MISSILE
+RIPPER
+NOGRAVITY
+NOINTERACTION
States
{
Spawn:
TNT1 A 20
TNT1 A 0 A_GiveToTarget("OnFireDamage",1)
TNT1 A 20
TNT1 A 0 A_GiveToTarget("OnFireDamage",1)
TNT1 A 20
TNT1 A 0 A_GiveToTarget("OnFireDamage",1)
TNT1 A 20
TNT1 A 0 A_GiveToTarget("ImNotOnFireNow",1)
stop
}
}

actor ImFrozen
{
+MISSILE
+NOGRAVITY
+NOINTERACTION
States
{
Spawn:
TNT1 A 60
TNT1 A 0 A_GiveToTarget("ImNotFrozenNow",1)
stop
}
}

actor OnFireDamage : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 DamageThing(4)
stop
}
}

actor ImNotOnFireNow : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 SetPlayerProperty(0,0,4)
TNT1 A 0 A_TakeInventory("FireVision",1)
stop
}
}

actor ImNotFrozenNow : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 SetPlayerProperty(0,0,4)
TNT1 A 0 A_TakeInventory("IceVision",1)
stop
}
}

actor FireVision : PowerSpeed
{
Powerup.Duration 1200
Speed 0.3
Powerup.Color Red, 0.5
}

actor IceVision : PowerProtection
{
Powerup.Duration 1200
damagefactor "Normal", 0.0
Powerup.Color Blue, 0.5
}

actor KilledMeStock : Inventory
{
inventory.amount 1
inventory.maxamount 9999
}

actor IsDead : Once {}

actor GravityForce4 : PowerProtection
{
Powerup.Duration 20
damagefactor "GravityHold", 5.0
}

actor GravityForce3 : PowerProtection
{
Powerup.Duration 20
damagefactor "GravityHold", 4.0
}

actor GravityForce2 : PowerProtection
{
Powerup.Duration 20
damagefactor "GravityHold", 3.0
}

actor GravityForce1 : PowerProtection
{
Powerup.Duration 20
damagefactor "GravityHold", 2.0
}

actor DarkDamager
{
PROJECTILE
obituary "%o was squashed by %k."
height 1
damagetype "QuickBoomerang"
radius 1
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(1,64,0)
stop
}
}

actor Shocked : PowerupGiver
{
  inventory.maxamount 0
  powerup.duration 35
  powerup.color "00 00 00", 0.0
  powerup.type "PowerShock"
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  states
  {
  Spawn:
    TNT1 A 6
    loop
  }
}

actor PowerShock : PowerSpeed
{
Speed 0.0
}

actor TempInvince : PowerupGiver
{
  inventory.pickupmessage ""
  inventory.icon "TNT1A0"
  //inventory.respawntics 4230
  powerup.duration 48
  powerup.type "Invulnerable"
  +INVENTORY.AUTOACTIVATE
  -INVBAR
  states
  {
  Spawn:
    INVU ABCD 3
    loop
  }
}

actor MonsterBlock : CustomInventory
{
States
{
Pickup:
TNT1 A 1 A_ChangeFlag("NOBLOCKMONST", false)
stop
}
}

actor MonsterUnblock : CustomInventory
{
States
{
Pickup:
TNT1 A 1 A_ChangeFlag("NOBLOCKMONST", true)
stop
}
}

actor Pushable : CustomInventory
{
States
{
Pickup:
TNT1 A 1 A_ChangeFlag("PUSHABLE", true)
stop
}
}

actor JumpCancler : Once {}

actor KilledMe : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
TNT1 A 1
stop
}
}

actor LMSInvincible : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
SKLB G 0 A_ChangeFlag("SHOOTABLE", false)
SKLB G 1 A_ChangeFlag("DONTRIP", true)
stop
}
}

actor IGMovement : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 ACS_ExecuteAlways(191,0,APROP_SPEED,5,4)
TNT1 A 0 ACS_ExecuteAlways(191,0,APROP_JUMPZ,13,1)
//TNT1 A 0 A_GiveInventory("HighJumpRune", 1)
stop
}
}

actor DontTakeAmmo : Once {}

actor ThruActors : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
SKLB G 1 A_ChangeFlag("THRUACTORS", true)
stop
}
}

actor PlayerPropertyFrozen : Inventory
{
inventory.amount 1
inventory.maxamount 99999
}

actor PlayerPropertyStopped : PlayerPropertyFrozen {}
actor PlayerPropertyFlight : PlayerPropertyFrozen {}
actor PlayerPropertyCantseek : PlayerPropertyFrozen {}

actor PlayerPropertyCantseekOff : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
States
{
Spawn:
TNT1 A 1
loop
Pickup:
TNT1 A 1 A_ChangeFlag(CANTSEEK, false)
stop
}
}

actor PlayerPropertyCantseekOn : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
States
{
Spawn:
TNT1 A 1
loop
Pickup:
TNT1 A 1 A_ChangeFlag(CANTSEEK, true)
stop
}
}

// To get around the centerview "feature"...
actor PlayerPropertyFlightOff : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
States
{
Spawn:
TNT1 A 1
loop
Pickup:
TNT1 A 1 SetPlayerProperty(0,0,3)
stop
}
}

actor PlayerPropertyFlightOn : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
States
{
Spawn:
TNT1 A 1
loop
Pickup:
TNT1 A 1 SetPlayerProperty(0,1,3)
stop
}
}

actor EasyModeDamageReduction : PowerProtection
{
powerup.duration -9999
DamageFactor "normal", 0.7
DamageFactor "Beam", 1.0
}


actor Repulsion : ArtiBlastRadius
{
	+AUTOACTIVATE
	States
	{
		Use:
		TNT1 A 0 A_Blast(0, 255, 192, 20.0)
		stop
	}
}

actor NoTeamTranslation : Once {}

actor NoJumpCancel : NoTeamTranslation {}

actor NoHealthBar : Once {}

actor NoHud : NoHealthBar {}

actor NoWeaponTranslation : NoHealthBar {}

actor NoPickups : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
TNT1 A 0 A_ChangeFlag("PICKUP",0)
stop
}
}

actor YesPickups : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
TNT1 A 0 A_ChangeFlag("PICKUP",1)
stop
}
}

actor HealthNumberFlag : Once {}

actor AmmoNumberFlag : Once {}

actor TranslationID : Inventory {}

actor FallDeathExplodeFlag : Once {}

actor NoWeaponSwitchSound : Once {}

actor SetSolid : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
TNT1 A 0 A_ChangeFlag("SOLID", 1)
stop
}
}

actor SetUnsolid : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
states
{
Spawn:
TNT1 A 1
stop
Pickup:
TNT1 A 0 A_ChangeFlag("SOLID", 0)
stop
}
}
