mob
var
Health
Health_Max
Energy
Energy_Max
Mitigation
Critical
Haste
Level
list/Threat[0]
proc
Damaged(var/mob/Attacker,damage)
if(istype(src,/mob/Monster))
Threat += (damage/2)*(Attacker.Mitigation) //What do I put here instead of this?
Health = max(0,min(Health_Max - damage,Health_Max))
DeathCheck()
DeathCheck(var/mob/Attacker)
if(Health <= 0)
Health = 0
Threat = 0
if(istype(src,/mob/Monster)) del src
Problem description:
So what I'm trying to do is make a system so when you're attacking an enemy AI the attacker goes into a list where the value of Threat is saved and when you keep attacking that value goes up. I'm trying to figure out how to add the attackers and their threat value onto the Enemy AI and how to access the values in the list and add onto it. I'm trying hard to remember how to use Associative Lists since this is my first time back coding in 2 years.
Like When Two People Attack the same Enemy I want their names or something to distinguish them saved into the Enemy's Threat List along with a value. The Value will be used to determine which attacker the Enemy will attack. I'll also want to use the list as a list of attackers so when I want the Enemy to attack a random attacker in the list I want to be able to do that.
Should I save the attackers mob inside the list?
Associative Lists?