diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index aed2e9c7495..d2cb3baa6a3 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1027,15 +1027,17 @@ GLOBAL_LIST_EMPTY(friendly_animal_types) return 0 //For creating consistent icons for human looking simple animals -/proc/get_flat_human_icon(icon_id, datum/job/J, datum/preferences/prefs, dummy_key, showDirs = GLOB.cardinals) +/proc/get_flat_human_icon(icon_id, datum/job/J, datum/preferences/prefs, dummy_key, showDirs = GLOB.cardinals, outfit_override = null) var/static/list/humanoid_icon_cache = list() if(!icon_id || !humanoid_icon_cache[icon_id]) var/mob/living/carbon/human/dummy/body = generate_or_wait_for_human_dummy(dummy_key) if(prefs) - prefs.copy_to(body) + prefs.copy_to(body,TRUE,FALSE) if(J) - J.equip(body, TRUE, FALSE) + J.equip(body, TRUE, FALSE, outfit_override = outfit_override) + else if (outfit_override) + body.equipOutfit(outfit_override,visualsOnly = TRUE) var/icon/out_icon = icon('icons/effects/effects.dmi', "nothing") diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index 55cf1c9f8b5..3763b8062be 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -224,6 +224,8 @@ death = FALSE roundstart = FALSE //you could use these for alive fake humans on roundstart but this is more common scenario +/obj/effect/mob_spawn/human/corpse/delayed + instant = FALSE //Non-human spawners diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 5437682140d..56dfe5e6a11 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1467,20 +1467,21 @@ GLOBAL_LIST_EMPTY(preferences_datums) ShowChoices(user) return 1 -/datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1) +/datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1, roundstart_checks = TRUE) if(be_random_name) real_name = pref_species.random_name(gender) if(be_random_body) random_character(gender) - if(CONFIG_GET(flag/humans_need_surnames) && (pref_species.id == "human")) - var/firstspace = findtext(real_name, " ") - var/name_length = length(real_name) - if(!firstspace) //we need a surname - real_name += " [pick(GLOB.last_names)]" - else if(firstspace == name_length) - real_name += "[pick(GLOB.last_names)]" + if(roundstart_checks) + if(CONFIG_GET(flag/humans_need_surnames) && (pref_species.id == "human")) + var/firstspace = findtext(real_name, " ") + var/name_length = length(real_name) + if(!firstspace) //we need a surname + real_name += " [pick(GLOB.last_names)]" + else if(firstspace == name_length) + real_name += "[pick(GLOB.last_names)]" character.real_name = real_name character.name = character.real_name @@ -1509,7 +1510,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) character.dna.features = features.Copy() character.dna.real_name = character.real_name var/datum/species/chosen_species - if(pref_species.id in GLOB.roundstart_races) + if(!roundstart_checks || (pref_species.id in GLOB.roundstart_races)) chosen_species = pref_species.type else chosen_species = /datum/species/human diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index 58bd24d2b63..ea5573b89fb 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -74,7 +74,7 @@ return antag_rep //Don't override this unless the job transforms into a non-human (Silicons do this for example) -/datum/job/proc/equip(mob/living/carbon/human/H, visualsOnly = FALSE, announce = TRUE, latejoin = FALSE) +/datum/job/proc/equip(mob/living/carbon/human/H, visualsOnly = FALSE, announce = TRUE, latejoin = FALSE, datum/outfit/outfit_override = null) if(!H) return FALSE @@ -86,8 +86,8 @@ //Equip the rest of the gear H.dna.species.before_equip_job(src, H, visualsOnly) - if(outfit) - H.equipOutfit(outfit, visualsOnly) + if(outfit_override || outfit) + H.equipOutfit(outfit_override ? outfit_override : outfit, visualsOnly) H.dna.species.after_equip_job(src, H, visualsOnly) diff --git a/code/modules/jobs/job_types/silicon.dm b/code/modules/jobs/job_types/silicon.dm index 0738f20b244..150372de017 100644 --- a/code/modules/jobs/job_types/silicon.dm +++ b/code/modules/jobs/job_types/silicon.dm @@ -17,7 +17,7 @@ AI exp_type_department = EXP_TYPE_SILICON var/do_special_check = TRUE -/datum/job/ai/equip(mob/living/carbon/human/H, visualsOnly, announce, latejoin) +/datum/job/ai/equip(mob/living/carbon/human/H, visualsOnly, announce, latejoin, outfit_override) . = H.AIize(latejoin) /datum/job/ai/after_spawn(mob/H, mob/M, latejoin) @@ -81,7 +81,7 @@ Cyborg exp_requirements = 120 exp_type = EXP_TYPE_CREW -/datum/job/cyborg/equip(mob/living/carbon/human/H, visualsOnly = FALSE, announce = TRUE, latejoin = FALSE) +/datum/job/cyborg/equip(mob/living/carbon/human/H, visualsOnly = FALSE, announce = TRUE, latejoin = FALSE, outfit_override = null) return H.Robotize(FALSE, latejoin) /datum/job/cyborg/after_spawn(mob/living/silicon/robot/R, mob/M) diff --git a/code/modules/mob/living/simple_animal/hostile/zombie.dm b/code/modules/mob/living/simple_animal/hostile/zombie.dm new file mode 100644 index 00000000000..21c2d4804ae --- /dev/null +++ b/code/modules/mob/living/simple_animal/hostile/zombie.dm @@ -0,0 +1,58 @@ +/mob/living/simple_animal/hostile/zombie + name = "Shambling Corpse" + desc = "When there is no more room in hell, the dead will walk in outer space." + icon = 'icons/mob/simple_human.dmi' + icon_state = "zombie" + icon_living = "zombie" + mob_biotypes = list(MOB_ORGANIC, MOB_HUMANOID) + speak_chance = 0 + stat_attack = UNCONSCIOUS //braains + maxHealth = 100 + health = 100 + harm_intent_damage = 5 + melee_damage_lower = 21 + melee_damage_upper = 21 + attacktext = "bites" + attack_sound = 'sound/hallucinations/growl1.ogg' + a_intent = INTENT_HARM + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + minbodytemp = 0 + spacewalk = FALSE + status_flags = CANPUSH + del_on_death = 1 + var/zombiejob = "Medical Doctor" + var/infection_chance = 0 + var/obj/effect/mob_spawn/human/corpse/delayed/corpse + +/mob/living/simple_animal/hostile/zombie/Initialize(mapload) + . = ..() + setup_visuals() + +/mob/living/simple_animal/hostile/zombie/proc/setup_visuals() + var/datum/preferences/dummy_prefs = new + dummy_prefs.pref_species = new /datum/species/zombie + dummy_prefs.be_random_body = TRUE + var/datum/job/J = SSjob.GetJob(zombiejob) + var/datum/outfit/O + if(J.outfit) + O = new J.outfit + //They have claws now. + O.r_hand = null + O.l_hand = null + + var/icon/P = get_flat_human_icon("zombie_[zombiejob]", J , dummy_prefs, "zombie", outfit_override = O) + icon = P + corpse = new(src) + corpse.outfit = O + corpse.mob_species = /datum/species/zombie + corpse.mob_name = name + +/mob/living/simple_animal/hostile/zombie/AttackingTarget() + . = ..() + if(. && ishuman(target) && prob(infection_chance)) + try_to_zombie_infect(target) + +/mob/living/simple_animal/hostile/zombie/drop_loot() + . = ..() + corpse.forceMove(drop_location()) + corpse.create() \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 708707c62e2..44104070e8d 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -294,14 +294,17 @@ stat(null, "Health: [round((health / maxHealth) * 100)]%") return 1 +/mob/living/simple_animal/proc/drop_loot() + if(loot.len) + for(var/i in loot) + new i(loc) + /mob/living/simple_animal/death(gibbed) movement_type &= ~FLYING if(nest) nest.spawned_mobs -= src nest = null - if(loot.len) - for(var/i in loot) - new i(loc) + drop_loot() if(dextrous) drop_all_held_items() if(!gibbed) diff --git a/code/modules/zombie/items.dm b/code/modules/zombie/items.dm index 03d2ac39218..8b56ccf00dd 100644 --- a/code/modules/zombie/items.dm +++ b/code/modules/zombie/items.dm @@ -31,11 +31,11 @@ return else if(isliving(target)) if(ishuman(target)) - check_infection(target, user) + try_to_zombie_infect(target) else check_feast(target, user) -/obj/item/zombie_hand/proc/check_infection(mob/living/carbon/human/target, mob/user) +/proc/try_to_zombie_infect(mob/living/carbon/human/target) CHECK_DNA_AND_SPECIES(target) if(NOZOMBIE in target.dna.species.species_traits) @@ -50,6 +50,7 @@ infection.Insert(target) + /obj/item/zombie_hand/suicide_act(mob/user) user.visible_message("[user] is ripping [user.p_their()] brains out! It looks like [user.p_theyre()] trying to commit suicide!") if(isliving(user)) diff --git a/icons/mob/simple_human.dmi b/icons/mob/simple_human.dmi index 0dff8ee8631..bd6472ed42b 100644 Binary files a/icons/mob/simple_human.dmi and b/icons/mob/simple_human.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 8def12c9559..521ba3eb62a 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2052,6 +2052,7 @@ #include "code\modules\mob\living\simple_animal\hostile\venus_human_trap.dm" #include "code\modules\mob\living\simple_animal\hostile\wizard.dm" #include "code\modules\mob\living\simple_animal\hostile\wumborian_fugu.dm" +#include "code\modules\mob\living\simple_animal\hostile\zombie.dm" #include "code\modules\mob\living\simple_animal\hostile\bosses\boss.dm" #include "code\modules\mob\living\simple_animal\hostile\bosses\paperwizard.dm" #include "code\modules\mob\living\simple_animal\hostile\gorilla\emotes.dm"