actor DND_DroppedItem {
	+LOOKALLAROUND
	+NOTIMEFREEZE
	MONSTER
	-COUNTKILL
	-SOLID
	-SHOOTABLE
	-TELESTOMP
	+NOTELEPORT
	+DONTBLAST
	Health 0
	Radius 1
	Height 1
}

Actor DND_Activator : CustomInventory {
	inventory.maxamount 1
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.IGNORESKILL
	+INVENTORY.UNDROPPABLE
}

Actor DnD_Info : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

Actor DnD_ScrollState : Inventory {
	inventory.maxamount 1000
}

Actor DnD_SharedItemTID : DnD_Info { }

Actor DropItemCooldown : PowerDamage {
	powerup.duration -1
	damagefactor "normal", 1.0
}

Actor DnD_Boolean : Inventory {
	inventory.maxamount 1
}

Actor DnD_ErrorNumber : Inventory {
	inventory.maxamount 3
}

Actor DnD_FakeDamager {
	PROJECTILE
	+DONTBLAST
	+MTHRUSPECIES
	States {
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
			TNT1 A 1
		Stop
		Death:
			TNT1 A 1
		Stop
	}
}

Actor BaseExplosionDamage // this is necessary, calling A_Explode in actor can cause unwanted effects.
{
	Speed 0
	Height 4
	Radius 4
	Damage (0)
	+MISSILE
	+DONTBLAST
	+NOBLOCKMAP
	+NOGRAVITY
	+THRUACTORS
	+DONTSPLASH
	-TELESTOMP
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 1
		Stop
	}
}

Actor DnD_PrevHealth : Inventory {
	inventory.maxamount 8192
}

Actor FadeIntensity : Inventory {
	+INVENTORY.UNDROPPABLE
	Inventory.MaxAmount 100
}

Actor ReloadSignal : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 4
}

Actor ForceWeaponRemove : DnD_Boolean { }

Actor NoRewardsGiven : DnD_Boolean { }
Actor StartOnly : DnD_Boolean { }
Actor GotAkimbo : DnD_Boolean { }
Actor GotMagnum : DnD_Boolean { }
Actor GotLaserPistol : DnD_Boolean { }
Actor GotScatterPistol : DnD_Boolean { }
Actor GotRubyWand : DnD_Boolean { }
Actor GotAR : DnD_Boolean { }
Actor GotViper : DnD_Boolean { }
Actor GotChainsaw : DnD_Boolean { }
Actor GotShotgun : DnD_Boolean { }
Actor GotSSG : DnD_Boolean { }
Actor GotSilver : DnD_Boolean { }
Actor GotSlayer : DnD_Boolean { }
Actor GotMG : DnD_Boolean { }
Actor GotCG : DnD_Boolean { }
Actor GotEbony : DnD_Boolean { }
Actor GotRL : DnD_Boolean { }
Actor GotGL : DnD_Boolean { }
Actor GotHML : DnD_Boolean { }
Actor GotPL : DnD_Boolean { }
Actor GotBFG : DnD_Boolean { }
Actor GotGauss : DnD_Boolean { }
Actor GotRail : DnD_Boolean { }
Actor GotNail : DnD_Boolean { }
Actor GotBasilisk : DnD_Boolean { }
Actor GotDeath : DnD_Boolean { }
Actor GotRazor : DnD_Boolean { }
Actor GotSun : DnD_Boolean { }
Actor GotReaver : DnD_Boolean { }
Actor GotSawedoff : DnD_Boolean { }
Actor GotSoul : DnD_Boolean { }
Actor GotSMG : DnD_Boolean { }
Actor GotHell : DnD_Boolean { }
Actor GotGore : DnD_Boolean { }
Actor GotRifle : DnD_Boolean { }
Actor GotVenom : DnD_Boolean { }
ACtor GotHeart : DnD_Boolean { }
Actor GotGloves : DnD_Boolean { }
Actor GotNailgun2 : DnD_Boolean { }
Actor GotBerettas : DnD_Boolean { }
Actor GotPlasmaBolter : DnD_Boolean { }

Actor P_Slot1Replaced : DnD_Boolean { }
Actor P_Slot2Replaced : DnD_Boolean { }
Actor P_Slot3Replaced : DnD_Boolean { }
Actor P_Slot3XReplaced : DnD_Boolean { }
Actor P_Slot4Replaced : DnD_Boolean { }
Actor P_Slot5Replaced : DnD_Boolean { }
Actor P_Slot6Replaced : DnD_Boolean { }
Actor P_Slot7Replaced : DnD_Boolean { }

Actor P_Slot1Luxury : DnD_Boolean { }
Actor P_Slot2Luxury : DnD_Boolean { }
Actor P_Slot3Luxury : DnD_Boolean { }
Actor P_Slot4Luxury : DnD_Boolean { }
Actor P_Slot5Luxury : DnD_Boolean { }
Actor P_Slot6Luxury : DnD_Boolean { }
Actor P_Slot7Luxury : DnD_Boolean { }
Actor P_Slot8Luxury : DnD_Boolean { }

Actor Reloading : DnD_Boolean { }
Actor Mo_Revived : DnD_Boolean { }

Actor P_PlasmaFire : DnD_Boolean { }
Actor P_GreenFire : DnD_Boolean { }
Actor P_PurpleFire : DnD_Boolean { }
Actor P_RedFire : DnD_Boolean { }
Actor P_GrayFire : DnD_Boolean { }

Actor P_Frozen : DnD_Boolean { }
Actor P_StepTaken : DnD_Boolean { }
Actor P_Invulnerable : DnD_Boolean { }
Actor TempWeaponReady : DnD_Boolean { }

Actor RoundsSurvived : Ammo
{
	inventory.amount 1
	inventory.maxamount 0xFFFF
	ammo.backpackamount 0
	ammo.backpackmaxamount 0
	+IGNORESKILL
}

Actor P_Damage : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	ammo.backpackamount 0
	ammo.backpackmaxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor LevelToken : Inventory
{
	inventory.maxamount 1
}

Actor SetMyLives : Inventory
{
	inventory.maxamount 1
}

Actor NoDrop : Inventory
{
	inventory.maxamount 1
}

Actor ShockWaveCounter : Ammo
{
	inventory.amount 1
	inventory.maxamount 100
	ammo.backpackamount 0
	ammo.backpackmaxamount 100
	inventory.icon "STTPRCNT"
	+IGNORESKILL
}

Actor CurrentLives : Ammo
{
	inventory.amount 1
	inventory.maxamount 9
	ammo.backpackamount 0
	ammo.backpackmaxamount 0
	+IGNORESKILL
}

Actor TipBoxOpen : PowerDamage {
	powerup.duration -6
	damagefactor "normal", 1.0
}

Actor UseWeaponTips : Ammo {
  Inventory.MaxAmount 1
  +UNDROPPABLE
  Ammo.BackpackAmount 0
  Ammo.BackpackMaxAmount 1
}

Actor ParsingData : DnD_Boolean { }

Actor WeaponZoom : DnD_Boolean { }
Actor WeaponZoomCooldown : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 15
}

ACTOR ProjBullet : FastProjectile {
	Radius 1
	Height 1
	Damage (random(1, 3) * 5)
	DamageType "Bullet"
	Speed 128
	Scale 0.1
	RenderStyle Add
	Alpha 0.85
	PROJECTILE
	+FORCEXYBILLBOARD
	+BLOODSPLATTER
	States {
		Spawn:
			TNT1 A 0
			TNT1 A 0 Thing_ChangeTID(0, SPECIAL_FX_TID)
			TNT1 A 0 A_ChangeVelocity(velx / 50.0, vely / 50.0, velz / 50.0, CVF_REPLACE)
			TNT1 A 1
			TNT1 A 0 A_ChangeVelocity(velx * 50.0, vely * 50.0, velz * 50.0, CVF_REPLACE)
			TRAC A -1 Bright
		Stop
		Death:
			TNT1 A 1 A_SpawnItem("NewBulletPuff")
		Stop
		XDeath:
			TNT1 A 1
		Stop
	}
}

Actor DnD_Intermission : DnD_Boolean { }

Actor DND_ACK : PowerDamage {
	powerup.duration 2
	damagefactor "normal", 1.0
}

enum {
	DND_SELF = 0,
	DND_USETARGET = 1,
	DND_ISOCCULT = 2,
	DND_ISPISTOL = 4,
	DND_ISBOOMSTICK = 8,
	DND_ISSUPER = 16,
	DND_ISSPECIALAMMO = 32,
	DND_ISARTIFACT = 64,
	DND_USEMASTER = 128,
	DND_SETMASTER = 256, // this is a hack, only use when a monster directly deals damage owned by player, AND DIES AFTER DOING SO
	DND_USETRACER = 512
};

enum {
	SHI_STIMPACK,
	SHI_MEDKIT,
	SHI_GREENARMOR,
	SHI_YELLOWARMOR,
	SHI_BLUEARMOR,
	SHI_REDARMOR,
	SHI_BACKPACK,
	SHI_TALENTCAP
};

enum {
	BONUS_KILL,
	BONUS_ITEM,
	BONUS_SECRET,
	BONUS_BONUS
};

Actor DnD_KillBonusShower : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_GiveInventory("DnD_ShowKillBonus", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("DnD Bonus Message Show", 0, BONUS_KILL)
		Stop
	}
}

Actor DnD_ItemBonusShower : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_GiveInventory("DnD_ShowItemBonus", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("DnD Bonus Message Show", 0, BONUS_ITEM)
		Stop
	}
}

Actor DnD_SecretBonusShower : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_GiveInventory("DnD_ShowSecretBonus", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("DnD Bonus Message Show", 0, BONUS_SECRET)
		Stop
	}
}

Actor DnD_BonusBonusShower : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_GiveInventory("DnD_ShowBonusBonus", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("DnD Bonus Message Show", 0, BONUS_BONUS)
		Stop
	}
}