diff --git a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm index 8fd800b83f837..593c33642b5f7 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/frontiersman.dm @@ -66,6 +66,7 @@ casingtype = null ranged_message = "fires the syringe gun at" ranged_cooldown_time = 30 + armor_base = /obj/item/clothing/suit/frontiersmen /mob/living/simple_animal/hostile/human/frontier/ranged/surgeon/neuter loot = list(/obj/effect/mob_spawn/human/corpse/frontier/surgeon) @@ -115,12 +116,11 @@ /mob/living/simple_animal/hostile/human/frontier/ranged/trooper icon_state = "frontiersmanrangedelite" icon_living = "frontiersmanrangedelite" - maxHealth = 170 - health = 170 projectilesound = 'sound/weapons/gun/shotgun/shot.ogg' casingtype = /obj/item/ammo_casing/shotgun/buckshot loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, /obj/item/gun/ballistic/shotgun/brimstone) + armor_base = /obj/item/clothing/suit/armor/vest/bulletproof/frontier /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/internals icon_state = "frontiersmanrangedelite_mask" @@ -155,6 +155,7 @@ projectiletype = null projectilesound = 'sound/weapons/gun/flamethrower/flamethrower1.ogg' casingtype = null + armor_base = /obj/item/clothing/suit/armor/frontier/fireproof /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/flame/OpenFire() var/turf/T = get_ranged_target_turf_direct(src, target, 4) @@ -176,6 +177,7 @@ casingtype = /obj/item/ammo_casing/a762_40 loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper, /obj/item/gun/ballistic/automatic/assault/skm) + armor_base = /obj/item/clothing/suit/armor/vest/bulletproof/frontier /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/skm/internals icon_state = "frontiersmanrangedak47_mask" @@ -203,6 +205,7 @@ /obj/item/gun/ballistic/rifle/illestren) casingtype = /obj/item/ammo_casing/a8_50r projectilesound = 'sound/weapons/gun/rifle/mosin.ogg' + armor_base = /obj/item/clothing/suit/armor/vest/bulletproof/frontier /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/rifle/internals icon_state = "frontiersmanrangedmosin_mask" @@ -226,13 +229,12 @@ icon_state = "frontiersmanrangedminigun" icon_living = "frontiersmanrangedminigun" projectilesound = 'sound/weapons/laser4.ogg' - maxHealth = 260 - health = 260 rapid = 6 rapid_fire_delay = 1.5 casingtype = null projectiletype = /obj/projectile/beam/weak/penetrator loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/trooper/heavy) + armor_base = /obj/item/clothing/suit/space/hardsuit/security/independent/frontier /mob/living/simple_animal/hostile/human/frontier/ranged/trooper/heavy/internals icon_state = "frontiersmanrangedminigun_mask" @@ -256,13 +258,12 @@ name = "Frontiersman Officer" icon_state = "frontiersmanofficer" icon_living = "frontiersmanofficer" - maxHealth = 65 - health = 65 rapid = 4 projectilesound = 'sound/weapons/gun/pistol/mauler.ogg' casingtype = /obj/item/ammo_casing/c9mm loot = list(/obj/effect/mob_spawn/human/corpse/frontier/ranged/officer, /obj/item/gun/ballistic/automatic/pistol/mauler) + armor_base = /obj/item/clothing/suit/armor/frontier /mob/living/simple_animal/hostile/human/frontier/ranged/officer/internals icon_state = "frontiersmanofficer_mask" diff --git a/code/modules/mob/living/simple_animal/hostile/human/human.dm b/code/modules/mob/living/simple_animal/hostile/human/human.dm index fe90db49e6188..1efe7c02b2613 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/human.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/human.dm @@ -38,3 +38,26 @@ footstep_type = FOOTSTEP_MOB_SHOE faction = list("hermit") + + ///Steals the armor datum from this type of armor + var/obj/item/clothing/armor_base + +/mob/living/simple_animal/hostile/human/Initialize() + . = ..() + if(ispath(armor_base, /obj/item/clothing)) + //sigh. if only we could get the initial() value of list vars + var/obj/item/clothing/instance = new armor_base() + armor = instance.armor + qdel(instance) + +/mob/living/simple_animal/hostile/human/vv_edit_var(var_name, var_value) + switch(var_name) + if (NAMEOF(src, armor_base)) + if(ispath(var_value, /obj/item/clothing)) + var/obj/item/clothing/temp = new var_value + armor = temp.armor + qdel(temp) + datum_flags |= DF_VAR_EDITED + return TRUE + return FALSE + . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/human/nanotrasen.dm b/code/modules/mob/living/simple_animal/hostile/human/nanotrasen.dm index 96b7c3f3a4e02..5898a9c75ea7a 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/nanotrasen.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/nanotrasen.dm @@ -10,6 +10,7 @@ faction = list(ROLE_DEATHSQUAD) check_friendly_fire = TRUE dodging = TRUE + armor_base = /obj/item/clothing/suit/armor/vest /mob/living/simple_animal/hostile/human/nanotrasen/screaming icon_state = "nanotrasen" @@ -61,8 +62,6 @@ icon = 'icons/mob/simple_human.dmi' icon_state = "nanotrasen_ert" icon_living = "nanotrasen_ert" - maxHealth = 150 - health = 150 melee_damage_lower = 13 melee_damage_upper = 18 ranged = TRUE @@ -77,3 +76,4 @@ projectilesound = 'sound/weapons/laser.ogg' loot = list(/obj/effect/gibspawner/human) faction = list(ROLE_DEATHSQUAD) + armor_base = /obj/item/clothing/suit/space/hardsuit/ert/sec diff --git a/code/modules/mob/living/simple_animal/hostile/human/pirate.dm b/code/modules/mob/living/simple_animal/hostile/human/pirate.dm index b5cdd48e77881..1a30b46f263e1 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/pirate.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/pirate.dm @@ -33,6 +33,7 @@ atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 speed = 1 + armor_base = /obj/item/clothing/suit/space /mob/living/simple_animal/hostile/human/pirate/melee/space/Initialize() . = ..() @@ -73,6 +74,7 @@ atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 speed = 1 + armor_base = /obj/item/clothing/suit/space /mob/living/simple_animal/hostile/human/pirate/ranged/space/Initialize() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/human/survivors.dm b/code/modules/mob/living/simple_animal/hostile/human/survivors.dm index d03f0be88083a..8cfeeff0695ad 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/survivors.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/survivors.dm @@ -7,6 +7,7 @@ loot = list( /obj/effect/mob_spawn/human/corpse/damaged/whitesands ) + armor_base = /obj/item/clothing/suit/hooded/survivor /mob/living/simple_animal/hostile/human/hermit/survivor/death(gibbed) move_force = MOVE_FORCE_DEFAULT diff --git a/code/modules/mob/living/simple_animal/hostile/human/syndicate.dm b/code/modules/mob/living/simple_animal/hostile/human/syndicate.dm index 3f81cd145dcd3..8ef8d1ef510f6 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/syndicate.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/syndicate.dm @@ -19,6 +19,7 @@ check_friendly_fire = TRUE dodging = TRUE rapid_melee = 2 + armor_base = /obj/item/clothing/suit/armor/vest ///////////////Melee//////////// @@ -26,12 +27,11 @@ icon_state = "syndicate_space" icon_living = "syndicate_space" name = "Ramzi Clique Commando" - maxHealth = 170 - health = 170 atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 maxbodytemp = 1000 speed = 1 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi /mob/living/simple_animal/hostile/human/syndicate/space/Initialize() . = ..() @@ -42,8 +42,7 @@ icon_state = "syndicate_stormtrooper" icon_living = "syndicate_stormtrooper" name = "Ramzi Clique Assault Trooper" - maxHealth = 250 - health = 250 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi/elite /mob/living/simple_animal/hostile/human/syndicate/melee //dude with a knife and no shields melee_damage_lower = 15 @@ -61,13 +60,11 @@ icon_state = "syndicate_space_knife" icon_living = "syndicate_space_knife" name = "Ramzi Clique Commando" - maxHealth = 170 - health = 170 - atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 maxbodytemp = 1000 speed = 1 projectile_deflect_chance = 50 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi /mob/living/simple_animal/hostile/human/syndicate/melee/space/Initialize() . = ..() @@ -78,9 +75,8 @@ icon_state = "syndicate_stormtrooper_knife" icon_living = "syndicate_stormtrooper_knife" name = "Ramzi Clique Stormtrooper" - maxHealth = 250 - health = 250 projectile_deflect_chance = 50 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi/elite /mob/living/simple_animal/hostile/human/syndicate/melee/sword melee_damage_lower = 30 @@ -114,13 +110,12 @@ icon_state = "syndicate_space_sword" icon_living = "syndicate_space_sword" name = "Ramzi Clique Commando" - maxHealth = 170 - health = 170 atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 maxbodytemp = 1000 speed = 1 projectile_deflect_chance = 50 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi /mob/living/simple_animal/hostile/human/syndicate/melee/sword/space/Initialize() . = ..() @@ -136,9 +131,8 @@ icon_state = "syndicate_stormtrooper_sword" icon_living = "syndicate_stormtrooper_sword" name = "Ramzi Clique Stormtrooper" - maxHealth = 250 - health = 250 projectile_deflect_chance = 50 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi/elite ///////////////Guns//////////// @@ -162,12 +156,11 @@ icon_state = "syndicate_space_pistol" icon_living = "syndicate_space_pistol" name = "Ramzi Clique Commando" - maxHealth = 170 - health = 170 atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 maxbodytemp = 1000 speed = 1 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi /mob/living/simple_animal/hostile/human/syndicate/ranged/space/Initialize() . = ..() @@ -178,8 +171,7 @@ icon_state = "syndicate_stormtrooper_pistol" icon_living = "syndicate_stormtrooper_pistol" name = "Ramzi Clique Stormtrooper" - maxHealth = 250 - health = 250 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi/elite /mob/living/simple_animal/hostile/human/syndicate/ranged/smg rapid = 2 @@ -192,12 +184,11 @@ icon_state = "syndicate_space_smg" icon_living = "syndicate_space_smg" name = "Ramzi Clique Commando" - maxHealth = 170 - health = 170 atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 maxbodytemp = 1000 speed = 1 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi /mob/living/simple_animal/hostile/human/syndicate/ranged/smg/space/Initialize() . = ..() @@ -208,8 +199,7 @@ icon_state = "syndicate_stormtrooper_smg" icon_living = "syndicate_stormtrooper_smg" name = "Ramzi Clique Stormtrooper" - maxHealth = 250 - health = 250 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi/elite /mob/living/simple_animal/hostile/human/syndicate/ranged/shotgun rapid = 2 @@ -223,12 +213,11 @@ icon_state = "syndicate_space_shotgun" icon_living = "syndicate_space_shotgun" name = "Ramzi Clique Commando" - maxHealth = 170 - health = 170 atmos_requirements = IMMUNE_ATMOS_REQS minbodytemp = 0 maxbodytemp = 1000 speed = 1 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi /mob/living/simple_animal/hostile/human/syndicate/ranged/shotgun/space/Initialize() . = ..() @@ -239,8 +228,7 @@ icon_state = "syndicate_stormtrooper_shotgun" icon_living = "syndicate_stormtrooper_shotgun" name = "Ramzi Clique Stormtrooper" - maxHealth = 250 - health = 250 + armor_base = /obj/item/clothing/suit/space/hardsuit/syndi/elite ///////////////Misc//////////// diff --git a/code/modules/mob/living/simple_animal/hostile/human/zombie.dm b/code/modules/mob/living/simple_animal/hostile/human/zombie.dm index e13461a49568a..c70b459fb7b29 100644 --- a/code/modules/mob/living/simple_animal/hostile/human/zombie.dm +++ b/code/modules/mob/living/simple_animal/hostile/human/zombie.dm @@ -7,8 +7,6 @@ mob_biotypes = MOB_ORGANIC|MOB_HUMANOID speak_chance = 0 stat_attack = HARD_CRIT //braains - maxHealth = 100 - health = 100 harm_intent_damage = 5 melee_damage_lower = 21 melee_damage_upper = 21 @@ -41,6 +39,7 @@ //They have claws now. O.r_hand = null O.l_hand = null + armor_base = O.suit var/icon/P = get_flat_human_icon("zombie_[zombiejob]", J , dummy_prefs, "zombie", outfit_override = O) icon = P diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm index b5781a200e614..18be354c2652e 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm @@ -21,16 +21,8 @@ mob_size = MOB_SIZE_LARGE var/icon_aggro = null var/trophy_drop_mod = 25 - var/datum/armor/armor //WS edit - Whitesands /mob/living/simple_animal/hostile/asteroid/Initialize(mapload) - if (islist(armor)) //WS edit begin - Whitesands - armor = getArmor(arglist(armor)) - else if (!armor) - armor = getArmor() - else if (!istype(armor, /datum/armor)) - stack_trace("Invalid type [armor.type] found in .armor during [src.type] Initialize()") //WS edit begin - Whitesands - . = ..() apply_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING) @@ -45,11 +37,6 @@ return icon_state = icon_living -/mob/living/simple_animal/hostile/asteroid/getarmor(def_zone, type) //WS edit begin - Whitesands - if(armor) - return armor.getRating(type) - return 0 // If no armor //WS edit end - /mob/living/simple_animal/hostile/asteroid/bullet_act(obj/projectile/P)//Reduces damage from most projectiles to curb off-screen kills if(!stat) Aggro() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 5ee1d8f102be1..f6dff0f23bb81 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -141,8 +141,18 @@ ///What kind of footstep this mob should have. Null if it shouldn't have any. var/footstep_type + /// Base armor value on this mob for running armor checks + var/datum/armor/armor + + /mob/living/simple_animal/Initialize(mapload) . = ..() + if (islist(armor)) + armor = getArmor(arglist(armor)) + else if (!armor) + armor = getArmor() + else if (!istype(armor, /datum/armor)) + stack_trace("Invalid type [armor.type] found in .armor during [src.type] Initialize()") GLOB.simple_animals[AIStatus] += src if(gender == PLURAL) gender = pick(MALE,FEMALE) @@ -171,6 +181,11 @@ return ..() +/mob/living/simple_animal/getarmor(def_zone, type) + if(armor) + return armor.getRating(type) + return FALSE + /mob/living/simple_animal/attackby(obj/item/O, mob/user, params) if(!is_type_in_list(O, food_type)) ..()