const float m_range_factor = 0.01;

Actor BossBrainProtection : PowerProtection {
	damagefactor "normal", 1.0
	damagefactor "BarrelExplosion", 0.0
	damagefactor "Crush", 0.0
	powerup.duration -3
}

// max 5 stacks
Actor OccultWeaknessStack : Inventory {
	inventory.maxamount 5
}

Actor OccultWeaknessTimeReset : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration 40
}

Actor DnD_SpeedAdjustRunning : DnD_Boolean { }

Actor DnD_ExplosionRepeated : DnD_Boolean { }

Actor DamagePerFlatHPBuffer : DnD_Info { }

Actor SummonedZombiePets : Inventory {
	inventory.maxamount 5
}

Actor Menu_Setup : DnD_Boolean { }

Actor QuestWasPicked : DnD_Boolean { }

// Holds character index of this logged in player
Actor DnD_CharacterID : DnD_Info { }

Actor DnD_NPC_Meet : DnD_Info { }

Actor ExpVisual : Ammo {
	inventory.amount 1
	inventory.maxamount 1000
	+IGNORESKILL
	+NONETID // see if this causes any problems later
}

Actor SpreeXP : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

Actor Level : Ammo {
	inventory.amount 1
	inventory.maxamount 100
	+IGNORESKILL
}

// used to sync client with variables
Actor LevelExpCap : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor Credit : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor Budget : Ammo {
	inventory.amount 1
	inventory.maxamount 1000
	+IGNORESKILL
}

Actor ActiveQuestID : Inventory {
	inventory.maxamount 0xFF
}

Actor CreditGiver : Credit { // test actor
	inventory.amount 0xFFFFFF
}

Actor AttributePoint : Ammo {
	inventory.amount 1
	inventory.maxamount 0xFFF
	+IGNORESKILL
}

Actor TalentPoint : Ammo {
	inventory.amount 1
	inventory.maxamount 0xFFFF
	+IGNORESKILL
}

Actor PerkPoint : Ammo {
	inventory.amount 1
	inventory.maxamount 0x3FF
	+IGNORESKILL
}

Actor PSTAT_Strength : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor PSTAT_Dexterity : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor PSTAT_Intellect : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor PSTAT_Unity : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor Perk_Sharpshooting : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Brutality : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Endurance : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Wisdom : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Greed : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Medic : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Munitionist : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Deadliness : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Savagery : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor Perk_Luck : Ammo {
	inventory.amount 1
	inventory.maxamount 10
	+IGNORESKILL
}

Actor CriticalHit : PowerDamage {
	Damagefactor "normal", 2.0
	powerup.duration 10 // adjust this to the delay in the loop it is given
}

Actor MapDifficultyClientside : Inventory {
	inventory.maxamount 100
}

Actor LeveledUp : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 7
}

Actor PerkedUp : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 5
}

Actor TalentedUp : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 5
}

Actor MenuInput : Inventory {
	inventory.maxamount 255
}

Actor MenuOption : Inventory {
	inventory.maxamount 255
}

// Used for left/right move, 1 = U, 2 = D
Actor MenuUD : Inventory {
	inventory.maxamount 2
}

Actor MenuPosX : Inventory {
	inventory.maxamount 255
}

Actor MenuPosServerX : Inventory {
	inventory.maxamount 255
}

Actor ActivePopupBox : Inventory {
	inventory.maxamount 255
}

Actor MenuMainPosY : Inventory {
	inventory.maxamount 255
}

Actor ShowingMenu : DnD_Boolean { }
Actor ShowingMenu_CS : DnD_Boolean { }
Actor ShowingPrompt : DnD_Boolean { }

Actor DnD_SelectedCharmBox : Inventory {
	inventory.maxamount 255
}

Actor DnD_SelectedInventoryBox : Inventory {
	inventory.maxamount 255
}

Actor DnD_SecondSelectedBox : Inventory {
	inventory.maxamount 255
}

Actor DnD_UsedTwoItemRequirementMaterial : DnD_Boolean { }

Actor Ability_Kick : DnD_Boolean { }
Actor Ability_Reloader : DnD_Boolean { }
Actor Ability_Dash : DnD_Boolean { }
Actor Ability_Arcanery : DnD_Boolean { }
Actor Ability_AntiPoison : DnD_Boolean { }
Actor Ability_ExplosionMastery : DnD_Boolean { }
Actor Ability_HeartSeeker : DnD_Boolean { }
Actor Ability_Regeneration : DnD_Boolean { }
Actor Ability_Temporal : DnD_Boolean { }
Actor Ability_SoulStealer : DnD_Boolean { }
Actor Ability_MonsterInfo : DnD_Boolean { }

Actor TemporalSphere : CustomInventory
{
	inventory.maxamount 1
	inventory.icon "AMSPA0"
	Inventory.UseSound "weapons/pickup"
	+INVBAR
	States
	{
		Use:
			TNT1 A 0 A_JumpIf(1 == ACS_ExecuteWithResult(896), "Success")
		Fail
		Success:
			TNT1 A 0 ACS_ExecuteAlways(897, 0)
		Stop
	}
}

Actor DashDisabled : DnD_Boolean { }

Actor DashEffect : PowerSpeed {
	powerup.duration 16
	Speed 1.0
}

Actor RegenEffect : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_SpawnItem("RegenEffectSpawner")
			TNT1 A 0 A_SetBlend("24 90 24", 0.3, 15)
		Stop
	}
}

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

Actor DnD_SellConfirm : DnD_Boolean { }
Actor DnD_PopupError : DnD_Boolean { }
Actor DnD_PopupSell : DnD_Boolean { }
Actor DnD_PopupReset : DnD_Boolean { }
Actor DnD_PopupResetMade : DnD_Boolean { }
Actor DnD_InventoryView : DnD_Boolean { }
Actor DnD_StashView : DnD_Boolean { }

Actor DnD_ButtonPressTimer : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 5
}

Actor DnD_Trade_CancelButtonPress : DnD_ButtonPressTimer {
	powerup.duration 5
}

Actor DnD_Trade_ConfirmButtonPress : DnD_ButtonPressTimer {
	powerup.duration 5
}

Actor DnD_ButtonPress_1 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_2 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_3 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_4 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_5 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_6 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_7 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_8 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_9 : DnD_ButtonPressTimer { }
Actor DnD_ButtonPress_10 : DnD_ButtonPressTimer { }

Actor DnD_Trade_Cooldown : DnD_ButtonPressTimer {
	damagefactor "normal", 1.0
	powerup.duration -3
}

Actor DnD_Trade_Confirmed : DnD_Boolean { }

Actor DnD_HighlightBlocker : PowerDamage {
	powerup.duration 3
	damagefactor "normal", 1.0
}

Actor DnD_OrbRecipes_1 : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor DnD_OrbRecipes_2 : Ammo {
	inventory.amount 1
	inventory.maxamount 0x7FFFFFFF
	+IGNORESKILL
}

Actor DnD_ShowPopup : PowerDamage {
	powerup.duration 3
	damagefactor "normal", 1.0
}

Actor DnD_ShowSellPopup : PowerDamage {
	powerup.duration 0x7FFFFFFF
	damagefactor "normal", 1.0
}

Actor DnD_ClickTicker : PowerDamage {
	powerup.duration 3
	damagefactor "normal", 1.0
}

Actor DnD_PopupID : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

Actor DnD_Character : Ammo {
	inventory.amount 1
	inventory.maxamount 0xFF
	+IGNORESKILL
}

Actor DnD_ItemPriceTemp : DnD_Info { }
Actor DnD_ItemSelectTemp : DnD_Info { }
Actor DnD_ItemCursorMsg : DnD_Info { }

Actor DnD_Crafting_MaterialPage : Inventory {
	inventory.maxamount 10
}

Actor DnD_Crafting_ItemPage : Inventory {
	inventory.maxamount 10
}

Actor DnD_PlayerInventoryPages : Inventory {
	inventory.maxamount 10
}

Actor DnD_PlayerCurrentPage : Inventory {
	inventory.maxamount 10
}

Actor DnD_PlayerPreviousPage : Inventory {
	inventory.maxamount 10
}

Actor DnD_TradeSpaceFit : DnD_Boolean { }

Actor KillSpreeOn : DnD_Boolean { }

Actor DnD_SpreeCountdownRunning : DnD_Boolean { }

Actor DnD_SpreeTimer : Inventory {
	inventory.maxamount 140 // 4 * 35
}

Actor DnD_MultikillCounter : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

Actor HardcoreDebuff : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration 0x7FFFFFFF
}

Actor Menu_LRCooldown : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 7
}

Actor DashDelay : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration 35
}

Actor CanLoad : DnD_Boolean { }
Actor PlayersNotReady : Inventory {
	inventory.maxamount 64 //MAXPLAYERS
}
Actor PlayerIsLoggedIn : DnD_Boolean { }
Actor DnD_TransfCharacterID : DnD_Info { }

Actor DnD_RefreshPane : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration 3
}

// Two bitsets
Actor DnD_TradeEngaged_1 : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

Actor DnD_TradeEngaged_2 : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

// Two bitsets
Actor DnD_TradeMute_1 : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

Actor DnD_TradeMute_2 : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

Actor DnD_MenuPlayerIcon {
	+NOINTERACTION
	+CLIENTSIDEONLY
	Scale 0.825
	States {
		Spawn:
			DICO Z -1
		Stop
	}
}

Actor DnD_IntermissionState : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration -50
}

Actor DnD_ScoreboardTick : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration -50
}

Actor DnD_ScoreboardRefresher : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 5
}

Actor LifeStealAmount : Inventory {
	inventory.maxamount 0x7FFFFFFF
}

Actor PlayerIsLeeching : DnD_Boolean { }
Actor DnD_EliteException : DnD_Boolean { }
Actor DnD_CleanInventoryRequest : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 3
}

Actor DnD_CleanTradeviewRequest : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 3
}

Actor DnD_CleanCraftingRequest : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 3
}

Actor DnD_CursorDataClearRequest : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration 3
}

Actor DnD_AmmoToken : CustomInventory {
	Renderstyle "Translucent"
	inventory.pickupsound "items/ammo"
	Radius 20
	Height 16
	+VISIBILITYPULSE
	States {
		Spawn:
			ATOK A 525
			TNT1 A 0 A_SetTranslucent(1.0)
			ATOK A 1 A_ChangeFlag("VISIBILITYPULSE", 0)
			ATOK AAAAA 5 A_FadeOut(0.175)
			ATOK AAAAA 5 A_FadeIn(0.175)
			ATOK AAAAA 5 A_FadeOut(0.175)
			ATOK AAAAA 5 A_FadeIn(0.175)
			ATOK AAAAA 4 A_FadeOut(0.175)
			ATOK AAAAA 4 A_FadeIn(0.175)
			ATOK AAAAA 4 A_FadeOut(0.175)
			ATOK AAAAA 4 A_FadeIn(0.175)
			ATOK AAAAA 3 A_FadeOut(0.175)
			ATOK AAAAA 3 A_FadeIn(0.175)
			ATOK AAAAA 3 A_FadeOut(0.175)
			ATOK AAAAA 3 A_FadeIn(0.175)
			ATOK AAAAA 2 A_FadeOut(0.175)
			ATOK AAAAA 2 A_FadeIn(0.175)
			ATOK AAAAA 2 A_FadeOut(0.175)
			ATOK AAAAA 2 A_FadeIn(0.175)
			ATOK AAAAA 1 A_FadeOut(0.175)
			ATOK AAAAA 1 A_FadeIn(0.175)
			ATOK AAAAA 1 A_FadeOut(0.175)
			ATOK AAAAA 1 A_FadeIn(0.175)
		Stop
		Pickup:
			TNT1 A 0 ACS_NamedExecuteAlways("DnD Ammo Token Pickup")
		Stop
	}
}

Actor DnD_SavageryMasteryTimer : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration -5
}

// 7 hits
Actor DnD_DeadlinessMasteryCounter : Inventory {
	inventory.maxamount 7
}

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

Actor DnD_GuaranteeCrit_FromDeadliness : DnD_Boolean { }

Actor DnD_LifeTimeKills : Ammo {
	inventory.amount 1
	inventory.maxamount 999999
	+IGNORESKILL
}

Actor DnD_LifeTimeKills_Millions : Ammo {
	inventory.amount 1
	inventory.maxamount 999
	+IGNORESKILL
}

Actor DnD_LifeTimeKills_Billions : Ammo {
	inventory.amount 1
	inventory.maxamount 1000
	+IGNORESKILL
}

Actor DnD_PercentDamageHalt : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration 7
}

Actor NFT_Token : DnD_Info { }

Actor DnD_HealOnMissingCD : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration -5
}

Actor DnD_DumpCooldown : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration 54
}

Actor DnD_CountdownProtection : DnD_Boolean { }

Actor DnD_CantSalvage : DnD_Boolean { }

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

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

Actor DnD_AutoDumpCooldown : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration 4
}

Actor DnD_SwappedFromMelee : PowerProtection {
	damagefactor "normal", 1.0
	powerup.duration -3
}