diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1cf1a8bb942..3f36b8b6d55 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1291,7 +1291,7 @@ if(oldspecies.default_genes.len) oldspecies.handle_dna(src, TRUE) // Remove any genes that belong to the old species - oldspecies.handle_pre_change(src) + oldspecies.on_species_loss(src) dna.species = new new_species() @@ -1365,7 +1365,7 @@ dna.real_name = real_name - dna.species.handle_post_spawn(src) + dna.species.on_species_gain(src) see_in_dark = dna.species.get_resultant_darksight(src) if(see_in_dark > 2) @@ -1447,122 +1447,6 @@ W.message = message W.add_fingerprint(src) -// Allows IPC's to change their monitor display -/mob/living/carbon/human/proc/change_monitor() - set category = "IC" - set name = "Change Monitor/Optical Display" - set desc = "Change the display on your monitor or the colour of your optics." - - if(incapacitated()) - to_chat(src, "You cannot change your monitor or optical display in your current state.") - return - - var/obj/item/organ/external/head/head_organ = get_organ("head") - if(!head_organ) //If the rock'em-sock'em robot's head came off during a fight, they shouldn't be able to change their screen/optics. - to_chat(src, "Where's your head at? Can't change your monitor/display without one.") - return - - if(dna.species.bodyflags & ALL_RPARTS) //If they can have a fully cybernetic body... - var/datum/robolimb/robohead = all_robolimbs[head_organ.model] - if(!head_organ) - return - if(!robohead.is_monitor) //If they've got a prosthetic head and it isn't a monitor, they've no screen to adjust. Instead, let them change the colour of their optics! - var/optic_colour = input(src, "Select optic colour", m_colours["head"]) as color|null - if(incapacitated()) - to_chat(src, "You were interrupted while changing the colour of your optics.") - return - if(optic_colour) - change_markings(optic_colour, "head") - - else if(robohead.is_monitor) //Means that the character's head is a monitor (has a screen). Time to customize. - var/list/hair = list() - for(var/i in hair_styles_public_list) - var/datum/sprite_accessory/hair/tmp_hair = hair_styles_public_list[i] - if((head_organ.dna.species.name in tmp_hair.species_allowed) && (robohead.company in tmp_hair.models_allowed)) //Populate the list of available monitor styles only with styles that the monitor-head is allowed to use. - hair += i - - var/new_style = input(src, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair - if(incapacitated()) - to_chat(src, "You were interrupted while changing your monitor display.") - return - if(new_style) - change_hair(new_style) - -//Putting a couple of procs here that I don't know where else to dump. -//Mostly going to be used for Vox and Vox Armalis, but other human mobs might like them (for adminbuse). -/mob/living/carbon/human/proc/leap() - set category = "Abilities" - set name = "Leap" - set desc = "Leap at a target and grab them aggressively." - - if(last_special > world.time) - return - - if(stat || paralysis || stunned || weakened || lying || restrained() || buckled) - to_chat(src, "You cannot leap in your current state.") - return - - var/list/choices = list() - for(var/mob/living/M in view(6,src)) - if(!istype(M,/mob/living/silicon)) - choices += M - choices -= src - - var/mob/living/T = input(src,"Who do you wish to leap at?") as null|anything in choices - - if(!T || !src || src.stat) return - - if(get_dist(get_turf(T), get_turf(src)) > 6) return - - if(last_special > world.time) - return - - if(!canmove) - to_chat(src, "You cannot leap in your current state.") - return - - last_special = world.time + 75 - status_flags |= LEAPING - - src.visible_message("\The [src] leaps at [T]!") - src.throw_at(get_step(get_turf(T),get_turf(src)), 5, 1, src) - playsound(src.loc, 'sound/voice/shriek1.ogg', 50, 1) - - sleep(5) - - if(status_flags & LEAPING) status_flags &= ~LEAPING - - if(!src.Adjacent(T)) - to_chat(src, "You miss!") - return - - T.Weaken(5) - - //Only official raider vox get the grab and no self-prone." - if(src.mind && src.mind.special_role != "Vox Raider") - src.Weaken(5) - return - - var/use_hand = "left" - if(l_hand) - if(r_hand) - to_chat(src, "You need to have one hand free to grab someone.") - return - else - use_hand = "right" - - src.visible_message("\The [src] seizes [T] aggressively!") - - var/obj/item/grab/G = new(src,T) - if(use_hand == "left") - l_hand = G - else - r_hand = G - - G.state = GRAB_AGGRESSIVE - G.icon_state = "grabbed1" - G.synch() - /mob/living/carbon/human/proc/get_eyecon() var/obj/item/organ/internal/eyes/eyes = get_int_organ(/obj/item/organ/internal/eyes) var/obj/item/organ/internal/cyberimp/eyes/eye_implant = get_int_organ(/obj/item/organ/internal/cyberimp/eyes) @@ -1598,43 +1482,6 @@ Eyes need to have significantly high darksight to shine unless the mob has the X return TRUE -/mob/living/carbon/human/proc/gut() - set category = "Abilities" - set name = "Gut" - set desc = "While grabbing someone aggressively, rip their guts out or tear them apart." - - if(last_special > world.time) - return - - if(!canmove) - to_chat(src, "You cannot do that in your current state.") - return - - var/obj/item/grab/G = locate() in src - if(!G || !istype(G)) - to_chat(src, "You are not grabbing anyone.") - return - - if(G.state < GRAB_AGGRESSIVE) - to_chat(src, "You must have an aggressive grab to gut your prey!") - return - - last_special = world.time + 50 - - visible_message("\The [src] rips viciously at \the [G.affecting]'s body with its claws!") - - if(istype(G.affecting,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = G.affecting - H.apply_damage(50,BRUTE) - if(H.stat == 2) - H.gib() - else - var/mob/living/M = G.affecting - if(!istype(M)) return //wut - M.apply_damage(50,BRUTE) - if(M.stat == 2) - M.gib() - /mob/living/carbon/human/assess_threat(var/mob/living/simple_animal/bot/secbot/judgebot, var/lasercolor) if(judgebot.emagged == 2) return 10 //Everyone is a criminal! diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 6ce91d80ddd..b20cdb3823f 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -79,8 +79,6 @@ var/bodyflags = 0 var/dietflags = 0 // Make sure you set this, otherwise it won't be able to digest a lot of foods - var/list/abilities = list() // For species-derived or admin-given powers - var/blood_color = "#A10808" //Red. var/flesh_color = "#FFC896" //Pink. var/single_gib_type = /obj/effect/decal/cleanable/blood/gibs @@ -151,9 +149,7 @@ "l_hand" = list("path" = /obj/item/organ/external/hand), "r_hand" = list("path" = /obj/item/organ/external/hand/right), "l_foot" = list("path" = /obj/item/organ/external/foot), - "r_foot" = list("path" = /obj/item/organ/external/foot/right) - ) - var/list/proc/species_abilities = list() + "r_foot" = list("path" = /obj/item/organ/external/foot/right)) /datum/species/New() //If the species has eyes, they are the default vision organ @@ -259,25 +255,16 @@ . -= 2 return . -/datum/species/proc/handle_post_spawn(mob/living/carbon/C) //Handles anything not already covered by basic species assignment. - grant_abilities(C) +/datum/species/proc/on_species_gain(mob/living/carbon/human/H) //Handles anything not already covered by basic species assignment. + return + +/datum/species/proc/on_species_loss(mob/living/carbon/human/H) + if(H.butcher_results) //clear it out so we don't butcher a actual human. + H.butcher_results = null /datum/species/proc/updatespeciescolor(mob/living/carbon/human/H) //Handles changing icobase for species that have multiple skin colors. return -/datum/species/proc/grant_abilities(mob/living/carbon/human/H) - for(var/proc/ability in species_abilities) - H.verbs += ability - -/datum/species/proc/handle_pre_change(mob/living/carbon/human/H) - if(H.butcher_results) //clear it out so we don't butcher a actual human. - H.butcher_results = null - remove_abilities(H) - -/datum/species/proc/remove_abilities(mob/living/carbon/human/H) - for(var/proc/ability in species_abilities) - H.verbs -= ability - // Do species-specific reagent handling here // Return 1 if it should do normal processing too // Return the parent value if processing does not explicitly stop @@ -297,7 +284,7 @@ H.setOxyLoss(0) H.SetLoseBreath(0) -/datum/species/proc/handle_dna(mob/living/carbon/C, remove) //Handles DNA mutations, as that doesn't work at init. Make sure you call genemutcheck on any blocks changed here +/datum/species/proc/handle_dna(mob/living/carbon/human/H, remove) //Handles DNA mutations, as that doesn't work at init. Make sure you call genemutcheck on any blocks changed here return /datum/species/proc/handle_death(mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns). diff --git a/code/modules/mob/living/carbon/human/species/abductor.dm b/code/modules/mob/living/carbon/human/species/abductor.dm index c205cb6d033..f51870d9e00 100644 --- a/code/modules/mob/living/carbon/human/species/abductor.dm +++ b/code/modules/mob/living/carbon/human/species/abductor.dm @@ -32,15 +32,15 @@ /datum/species/abductor/can_understand(mob/other) //Abductors can understand everyone, but they can only speak over their mindlink to another team-member return TRUE -/datum/species/abductor/handle_post_spawn(mob/living/carbon/human/H) +/datum/species/abductor/on_species_gain(mob/living/carbon/human/H) + ..() H.gender = NEUTER H.languages.Cut() //Under no condition should you be able to speak any language H.add_language("Abductor Mindlink") //other than over the abductor's own mindlink var/datum/atom_hud/abductor_hud = huds[DATA_HUD_ABDUCTOR] abductor_hud.add_hud_to(H) - return ..() -/datum/species/abductor/remove_abilities(mob/living/carbon/human/H) +/datum/species/abductor/on_species_loss(mob/living/carbon/human/H) ..() var/datum/atom_hud/abductor_hud = huds[DATA_HUD_ABDUCTOR] abductor_hud.remove_hud_from(H) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/diona.dm b/code/modules/mob/living/carbon/human/species/diona.dm index 7d7b2acd713..6f53be4d3c8 100644 --- a/code/modules/mob/living/carbon/human/species/diona.dm +++ b/code/modules/mob/living/carbon/human/species/diona.dm @@ -76,17 +76,16 @@ "pulls out a secret stash of herbicide and takes a hearty swig!", "is pulling themselves apart!") -/datum/species/diona/can_understand(var/mob/other) +/datum/species/diona/can_understand(mob/other) if(istype(other, /mob/living/simple_animal/diona)) return 1 return 0 -/datum/species/diona/handle_post_spawn(var/mob/living/carbon/human/H) +/datum/species/diona/on_species_gain(mob/living/carbon/human/H) + ..() H.gender = NEUTER - return ..() - -/datum/species/diona/handle_life(var/mob/living/carbon/human/H) +/datum/species/diona/handle_life(mob/living/carbon/human/H) H.radiation = Clamp(H.radiation, 0, 100) //We have to clamp this first, then decrease it, or there's a few edge cases of massive heals if we clamp and decrease at the same time. var/rads = H.radiation / 25 H.radiation = max(H.radiation-rads, 0) diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm index 772a5ca5ba6..c3fa38611b5 100644 --- a/code/modules/mob/living/carbon/human/species/golem.dm +++ b/code/modules/mob/living/carbon/human/species/golem.dm @@ -42,7 +42,8 @@ "is crumbling into dust!", "is smashing their body apart!") -/datum/species/golem/handle_post_spawn(var/mob/living/carbon/human/H) +/datum/species/golem/on_species_gain(mob/living/carbon/human/H) + ..() if(H.mind) H.mind.assigned_role = "Golem" H.mind.special_role = SPECIAL_ROLE_GOLEM @@ -53,7 +54,6 @@ H.equip_to_slot_or_del(new /obj/item/clothing/shoes/golem(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/golem(H), slot_wear_mask) H.equip_to_slot_or_del(new /obj/item/clothing/gloves/golem(H), slot_gloves) - ..() ////////Adamantine Golem stuff I dunno where else to put it diff --git a/code/modules/mob/living/carbon/human/species/grey.dm b/code/modules/mob/living/carbon/human/species/grey.dm index ad4239c0d05..e8cb6b13083 100644 --- a/code/modules/mob/living/carbon/human/species/grey.dm +++ b/code/modules/mob/living/carbon/human/species/grey.dm @@ -29,19 +29,15 @@ reagent_tag = PROCESS_ORG blood_color = "#A200FF" -/datum/species/grey/handle_dna(var/mob/living/carbon/C, var/remove) - if(!remove) - C.dna.SetSEState(REMOTETALKBLOCK,1,1) - genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED) - else - C.dna.SetSEState(REMOTETALKBLOCK,0,1) - genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED) +/datum/species/grey/handle_dna(mob/living/carbon/human/H, remove) ..() + H.dna.SetSEState(REMOTETALKBLOCK, !remove, 1) + genemutcheck(H, REMOTETALKBLOCK, null, MUTCHK_FORCED) -/datum/species/grey/water_act(var/mob/living/carbon/C, volume, temperature, source) +/datum/species/grey/water_act(mob/living/carbon/human/H, volume, temperature, source) ..() - C.take_organ_damage(5,min(volume,20)) - C.emote("scream") + H.take_organ_damage(5, min(volume, 20)) + H.emote("scream") /datum/species/grey/after_equip_job(datum/job/J, mob/living/carbon/human/H) var/speech_pref = H.client.prefs.speciesprefs diff --git a/code/modules/mob/living/carbon/human/species/machine.dm b/code/modules/mob/living/carbon/human/species/machine.dm index 066677f3104..fa3e4e321a9 100644 --- a/code/modules/mob/living/carbon/human/species/machine.dm +++ b/code/modules/mob/living/carbon/human/species/machine.dm @@ -72,17 +72,64 @@ "is frying their own circuits!", "is blocking their ventilation port!") - species_abilities = list( - /mob/living/carbon/human/proc/change_monitor - ) + var/datum/action/innate/change_monitor/monitor -/datum/species/machine/handle_death(var/mob/living/carbon/human/H) +/datum/species/machine/on_species_gain(mob/living/carbon/human/H) + ..() + monitor = new() + monitor.Grant(H) + +/datum/species/machine/on_species_loss(mob/living/carbon/human/H) + ..() + if(monitor) + monitor.Remove(H) + +/datum/species/machine/handle_death(mob/living/carbon/human/H) var/obj/item/organ/external/head/head_organ = H.get_organ("head") if(!head_organ) return head_organ.h_style = "Bald" head_organ.f_style = "Shaved" spawn(100) - if(H) + if(H && head_organ) H.update_hair() - H.update_fhair() \ No newline at end of file + H.update_fhair() + +// Allows IPC's to change their monitor display +/datum/action/innate/change_monitor + name = "Change Monitor" + check_flags = AB_CHECK_CONSCIOUS + button_icon_state = "scan_mode" + +/datum/action/innate/change_monitor/Activate() + var/mob/living/carbon/human/H = owner + var/obj/item/organ/external/head/head_organ = H.get_organ("head") + + if(!head_organ) //If the rock'em-sock'em robot's head came off during a fight, they shouldn't be able to change their screen/optics. + to_chat(H, "Where's your head at? Can't change your monitor/display without one.") + return + + var/datum/robolimb/robohead = all_robolimbs[head_organ.model] + if(!head_organ) + return + if(!robohead.is_monitor) //If they've got a prosthetic head and it isn't a monitor, they've no screen to adjust. Instead, let them change the colour of their optics! + var/optic_colour = input(H, "Select optic colour", H.m_colours["head"]) as color|null + if(H.incapacitated()) + to_chat(H, "You were interrupted while changing the colour of your optics.") + return + if(optic_colour) + H.change_markings(optic_colour, "head") + + else if(robohead.is_monitor) //Means that the character's head is a monitor (has a screen). Time to customize. + var/list/hair = list() + for(var/i in hair_styles_public_list) + var/datum/sprite_accessory/hair/tmp_hair = hair_styles_public_list[i] + if((head_organ.dna.species.name in tmp_hair.species_allowed) && (robohead.company in tmp_hair.models_allowed)) //Populate the list of available monitor styles only with styles that the monitor-head is allowed to use. + hair += i + + var/new_style = input(H, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair + if(H.incapacitated()) + to_chat(src, "You were interrupted while changing your monitor display.") + return + if(new_style) + H.change_hair(new_style) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm index 4128024a8c9..5e926a23870 100644 --- a/code/modules/mob/living/carbon/human/species/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/monkey.dm @@ -35,7 +35,7 @@ brute_mod = 1.5 burn_mod = 1.5 -/datum/species/monkey/handle_npc(var/mob/living/carbon/human/H) +/datum/species/monkey/handle_npc(mob/living/carbon/human/H) if(H.stat != CONSCIOUS) return if(prob(33) && H.canmove && isturf(H.loc) && !H.pulledby) //won't move if being pulled @@ -46,16 +46,17 @@ /datum/species/monkey/get_random_name() return "[lowertext(name)] ([rand(100,999)])" -/datum/species/monkey/handle_post_spawn(var/mob/living/carbon/human/H) +/datum/species/monkey/on_species_gain(mob/living/carbon/human/H) + ..() H.real_name = "[lowertext(name)] ([rand(100,999)])" H.name = H.real_name H.butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/monkey = 5) +/datum/species/monkey/handle_dna(mob/living/carbon/human/H, remove) ..() - -/datum/species/monkey/handle_dna(var/mob/living/carbon/human/H) - H.dna.SetSEState(MONKEYBLOCK,1) - genemutcheck(H,MONKEYBLOCK,null,MUTCHK_FORCED) + if(!remove) + H.dna.SetSEState(MONKEYBLOCK, TRUE) + genemutcheck(H, MONKEYBLOCK, null, MUTCHK_FORCED) /datum/species/monkey/handle_can_equip(obj/item/I, slot, disable_warning = 0, mob/living/carbon/human/user) switch(slot) diff --git a/code/modules/mob/living/carbon/human/species/nucleation.dm b/code/modules/mob/living/carbon/human/species/nucleation.dm index 4fcfae74282..faf81ea875b 100644 --- a/code/modules/mob/living/carbon/human/species/nucleation.dm +++ b/code/modules/mob/living/carbon/human/species/nucleation.dm @@ -28,14 +28,13 @@ ) vision_organ = /obj/item/organ/internal/eyes/luminescent_crystal -/datum/species/nucleation/handle_post_spawn(var/mob/living/carbon/human/H) +/datum/species/nucleation/on_species_gain(mob/living/carbon/human/H) + ..() H.light_color = "#1C1C00" H.set_light(2) - return ..() -/datum/species/nucleation/handle_death(var/mob/living/carbon/human/H) +/datum/species/nucleation/handle_death(mob/living/carbon/human/H) var/turf/T = get_turf(H) H.visible_message("[H]'s body explodes, leaving behind a pile of microscopic crystals!") explosion(T, 0, 0, 2, 2) // Create a small explosion burst upon death -// new /obj/item/shard/supermatter( T ) qdel(H) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm index 46270219735..dcbdc7d17be 100644 --- a/code/modules/mob/living/carbon/human/species/plasmaman.dm +++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm @@ -162,7 +162,7 @@ H.internal = H.get_item_by_slot(tank_slot) H.update_action_buttons_icon() -/datum/species/plasmaman/handle_life(var/mob/living/carbon/human/H) +/datum/species/plasmaman/handle_life(mob/living/carbon/human/H) if(!istype(H.wear_suit, /obj/item/clothing/suit/space/eva/plasmaman) || !istype(H.head, /obj/item/clothing/head/helmet/space/eva/plasmaman)) var/datum/gas_mixture/environment = H.loc.return_air() if(environment && environment.oxygen && environment.oxygen >= OXYCONCEN_PLASMEN_IGNITION) //Plasmamen so long as there's enough oxygen (0.5 moles, same as it takes to burn gaseous plasma). @@ -178,7 +178,7 @@ H.update_fire() ..() -/datum/species/plasmaman/handle_reagents(var/mob/living/carbon/human/H, var/datum/reagent/R) +/datum/species/plasmaman/handle_reagents(mob/living/carbon/human/H, datum/reagent/R) if(R.id == "plasma") H.adjustBruteLoss(-0.5*REAGENTS_EFFECT_MULTIPLIER) H.adjustFireLoss(-0.5*REAGENTS_EFFECT_MULTIPLIER) diff --git a/code/modules/mob/living/carbon/human/species/shadow.dm b/code/modules/mob/living/carbon/human/species/shadow.dm index 0e8bd2e91e2..03956f81cb0 100644 --- a/code/modules/mob/living/carbon/human/species/shadow.dm +++ b/code/modules/mob/living/carbon/human/species/shadow.dm @@ -28,7 +28,7 @@ "is twisting their own neck!", "is staring into the closest light source!") - var/grant_vision_toggle = 1 + var/grant_vision_toggle = TRUE var/datum/action/innate/shadow/darkvision/vision_toggle /datum/action/innate/shadow/darkvision //Darkvision toggle so shadowpeople can actually see where darkness is @@ -46,19 +46,19 @@ H.vision_type = null to_chat(H, "You adjust your vision to recognize the shadows.") -/datum/species/shadow/grant_abilities(var/mob/living/carbon/human/H) - . = ..() +/datum/species/shadow/on_species_gain(mob/living/carbon/human/H) + ..() if(grant_vision_toggle) vision_toggle = new vision_toggle.Grant(H) -/datum/species/shadow/remove_abilities(var/mob/living/carbon/human/H) - . = ..() +/datum/species/shadow/on_species_loss(mob/living/carbon/human/H) + ..() if(grant_vision_toggle && vision_toggle) H.vision_type = null vision_toggle.Remove(H) -/datum/species/shadow/handle_life(var/mob/living/carbon/human/H) +/datum/species/shadow/handle_life(mob/living/carbon/human/H) var/light_amount = 0 if(isturf(H.loc)) var/turf/T = H.loc diff --git a/code/modules/mob/living/carbon/human/species/shadowling.dm b/code/modules/mob/living/carbon/human/species/shadowling.dm index e7d7982a765..b87d7565d23 100644 --- a/code/modules/mob/living/carbon/human/species/shadowling.dm +++ b/code/modules/mob/living/carbon/human/species/shadowling.dm @@ -20,7 +20,7 @@ "brain" = /obj/item/organ/internal/brain, "eyes" = /obj/item/organ/internal/eyes) -/datum/species/shadow/ling/handle_life(var/mob/living/carbon/human/H) +/datum/species/shadow/ling/handle_life(mob/living/carbon/human/H) if(!H.weakeyes) H.weakeyes = 1 //Makes them more vulnerable to flashes and flashbangs var/light_amount = 0 @@ -65,7 +65,7 @@ oxy_mod = 0 heatmod = 1.1 -/datum/species/shadow/ling/lesser/handle_life(var/mob/living/carbon/human/H) +/datum/species/shadow/ling/lesser/handle_life(mob/living/carbon/human/H) if(!H.weakeyes) H.weakeyes = 1 //Makes them more vulnerable to flashes and flashbangs var/light_amount = 0 diff --git a/code/modules/mob/living/carbon/human/species/skeleton.dm b/code/modules/mob/living/carbon/human/species/skeleton.dm index 8afc35f743a..6a2b74fb671 100644 --- a/code/modules/mob/living/carbon/human/species/skeleton.dm +++ b/code/modules/mob/living/carbon/human/species/skeleton.dm @@ -39,7 +39,7 @@ "brain" = /obj/item/organ/internal/brain/golem, ) //Has default darksight of 2. -/datum/species/skeleton/handle_reagents(var/mob/living/carbon/human/H, var/datum/reagent/R) +/datum/species/skeleton/handle_reagents(mob/living/carbon/human/H, datum/reagent/R) // Crazylemon is still silly if(R.id == "milk") H.heal_overall_damage(4,4) diff --git a/code/modules/mob/living/carbon/human/species/slime.dm b/code/modules/mob/living/carbon/human/species/slime.dm index 77fa54491e0..583835b7358 100644 --- a/code/modules/mob/living/carbon/human/species/slime.dm +++ b/code/modules/mob/living/carbon/human/species/slime.dm @@ -1,3 +1,11 @@ +#define SLIMEPERSON_COLOR_SHIFT_TRIGGER 0.1 +#define SLIMEPERSON_ICON_UPDATE_PERIOD 200 // 20 seconds +#define SLIMEPERSON_BLOOD_SCALING_FACTOR 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. + +#define SLIMEPERSON_HUNGERCOST 50 +#define SLIMEPERSON_MINHUNGER 250 +#define SLIMEPERSON_REGROWTHDELAY 450 // 45 seconds + /datum/species/slime name = "Slime People" name_plural = "Slime People" @@ -41,33 +49,24 @@ "is turning a dull, brown color and melting into a puddle!") var/reagent_skin_coloring = FALSE + var/datum/action/innate/regrow/grow + var/datum/action/innate/slimecolor/recolor - var/datum/action/innate/regrow/grow = new() - - species_abilities = list( - /mob/living/carbon/human/verb/toggle_recolor_verb, - /mob/living/carbon/human/proc/regrow_limbs - ) - -/datum/species/slime/handle_post_spawn(var/mob/living/carbon/human/H) - grow.Grant(H) +/datum/species/slime/on_species_gain(mob/living/carbon/human/H) ..() + grow = new() + grow.Grant(H) + recolor = new() + recolor.Grant(H) -/datum/action/innate/regrow - name = "Regrow limbs" - icon_icon = 'icons/effects/effects.dmi' - button_icon_state = "greenglow" +/datum/species/slime/on_species_loss(mob/living/carbon/human/H) + ..() + if(grow) + grow.Remove(H) + if(recolor) + recolor.Remove(H) -/datum/action/innate/regrow/Activate() - var/mob/living/carbon/human/user = owner - user.regrow_limbs() - - -/datum/species/slime/handle_life(var/mob/living/carbon/human/H) -//This is allegedly for code "style". Like a plaid sweater? -#define SLIMEPERSON_COLOR_SHIFT_TRIGGER 0.1 -#define SLIMEPERSON_ICON_UPDATE_PERIOD 200 // 20 seconds -#define SLIMEPERSON_BLOOD_SCALING_FACTOR 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. +/datum/species/slime/handle_life(mob/living/carbon/human/H) // Slowly shifting to the color of the reagents if(reagent_skin_coloring && H.reagents.total_volume > SLIMEPERSON_COLOR_SHIFT_TRIGGER) var/blood_amount = H.blood_volume @@ -83,118 +82,99 @@ H.update_body() ..() -#undef SLIMEPERSON_COLOR_SHIFT_TRIGGER -#undef SLIMEPERSON_ICON_UPDATE_PERIOD -#undef SLIMEPERSON_BLOOD_SCALING_FACTOR +/datum/action/innate/slimecolor + name = "Toggle Recolor" + check_flags = AB_CHECK_CONSCIOUS + icon_icon = 'icons/effects/effects.dmi' + button_icon_state = "greenglow" -/mob/living/carbon/human/proc/toggle_recolor(silent = FALSE) - if(!isslimeperson(src)) - if(!silent) - to_chat(src, "You're not a slime person!") - return - - var/datum/species/slime/S = dna.species +/datum/action/innate/slimecolor/Activate() + var/mob/living/carbon/human/H = owner + var/datum/species/slime/S = H.dna.species if(S.reagent_skin_coloring) - S.reagent_skin_coloring = TRUE - if(!silent) - to_chat(src, "You adjust your internal chemistry to filter out pigments from things you consume.") + S.reagent_skin_coloring = FALSE + to_chat(H, "You adjust your internal chemistry to filter out pigments from things you consume.") else S.reagent_skin_coloring = TRUE - if(!silent) - to_chat(src, "You adjust your internal chemistry to permit pigments in chemicals you consume to tint you.") + to_chat(H, "You adjust your internal chemistry to permit pigments in chemicals you consume to tint you.") -/mob/living/carbon/human/verb/toggle_recolor_verb() - set category = "IC" - set name = "Toggle Reagent Recoloring" - set desc = "While active, you'll slowly adjust your body's color to that of the reagents inside of you, moderated by how much blood you have." +/datum/action/innate/regrow + name = "Regrow limbs" + check_flags = AB_CHECK_CONSCIOUS + icon_icon = 'icons/effects/effects.dmi' + button_icon_state = "greenglow" - toggle_recolor() - - -/mob/living/carbon/human/proc/regrow_limbs() - set category = "IC" - set name = "Regrow Limbs" - set desc = "Regrow one of your missing limbs at the cost of a large amount of hunger" - -#define SLIMEPERSON_HUNGERCOST 50 -#define SLIMEPERSON_MINHUNGER 250 -#define SLIMEPERSON_REGROWTHDELAY 450 // 45 seconds - - if(stat || paralysis || stunned) - to_chat(src, "You cannot regenerate missing limbs in your current state.") - return - - if(nutrition < SLIMEPERSON_MINHUNGER) - to_chat(src, "You're too hungry to regenerate a limb!") +/datum/action/innate/regrow/Activate() + var/mob/living/carbon/human/H = owner + if(H.nutrition < SLIMEPERSON_MINHUNGER) + to_chat(H, "You're too hungry to regenerate a limb!") return var/list/missing_limbs = list() - for(var/l in bodyparts_by_name) - var/obj/item/organ/external/E = bodyparts_by_name[l] + for(var/l in H.bodyparts_by_name) + var/obj/item/organ/external/E = H.bodyparts_by_name[l] if(!istype(E)) - var/list/limblist = dna.species.has_limbs[l] + var/list/limblist = H.dna.species.has_limbs[l] var/obj/item/organ/external/limb = limblist["path"] var/parent_organ = initial(limb.parent_organ) - var/obj/item/organ/external/parentLimb = bodyparts_by_name[parent_organ] + var/obj/item/organ/external/parentLimb = H.bodyparts_by_name[parent_organ] if(!istype(parentLimb)) continue missing_limbs[initial(limb.name)] = l if(!missing_limbs.len) - to_chat(src, "You're not missing any limbs!") + to_chat(H, "You're not missing any limbs!") return - var/limb_select = input(src, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs + var/limb_select = input(H, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs var/chosen_limb = missing_limbs[limb_select] - visible_message("[src] begins to hold still and concentrate on [p_their()] missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(SLIMEPERSON_REGROWTHDELAY/10)] seconds, and you must hold still.)") - if(do_after(src, SLIMEPERSON_REGROWTHDELAY, needhand=0, target = src)) - if(stat || paralysis || stunned) - to_chat(src, "You cannot regenerate missing limbs in your current state.") + H.visible_message("[H] begins to hold still and concentrate on [H.p_their()] missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(SLIMEPERSON_REGROWTHDELAY/10)] seconds, and you must hold still.)") + if(do_after(H, SLIMEPERSON_REGROWTHDELAY, needhand = 0, target = H)) + if(H.incapacitated()) + to_chat(H, "You cannot regenerate missing limbs in your current state.") return - if(nutrition < SLIMEPERSON_MINHUNGER) - to_chat(src, "You're too hungry to regenerate a limb!") + if(H.nutrition < SLIMEPERSON_MINHUNGER) + to_chat(H, "You're too hungry to regenerate a limb!") return - var/obj/item/organ/external/O = bodyparts_by_name[chosen_limb] + var/obj/item/organ/external/O = H.bodyparts_by_name[chosen_limb] var/stored_brute = 0 var/stored_burn = 0 if(istype(O)) - to_chat(src, "You distribute the damaged tissue around your body, out of the way of your new pseudopod!") + to_chat(H, "You distribute the damaged tissue around your body, out of the way of your new pseudopod!") var/obj/item/organ/external/doomedStump = O stored_brute = doomedStump.brute_dam stored_burn = doomedStump.burn_dam qdel(O) - var/limb_list = dna.species.has_limbs[chosen_limb] + var/limb_list = H.dna.species.has_limbs[chosen_limb] var/obj/item/organ/external/limb_path = limb_list["path"] // Parent check - var/obj/item/organ/external/potential_parent = bodyparts_by_name[initial(limb_path.parent_organ)] + var/obj/item/organ/external/potential_parent = H.bodyparts_by_name[initial(limb_path.parent_organ)] if(!istype(potential_parent)) - to_chat(src, "You've lost the organ that you've been growing your new part on!") + to_chat(H, "You've lost the organ that you've been growing your new part on!") return // No rayman for you // Grah this line will leave a "not used" warning, in spite of the fact that the new() proc WILL do the thing. // Bothersome. - var/obj/item/organ/external/new_limb = new limb_path(src) + var/obj/item/organ/external/new_limb = new limb_path(H) new_limb.open = 0 // This is just so that the compiler won't think that new_limb is unused, because the compiler is horribly stupid. - adjustBruteLoss(stored_brute) - adjustFireLoss(stored_burn) - update_body() - updatehealth() - UpdateDamageIcon() - nutrition -= SLIMEPERSON_HUNGERCOST - visible_message("[src] finishes regrowing [p_their()] missing [new_limb]!", "You finish regrowing your [limb_select]") + H.adjustBruteLoss(stored_brute) + H.adjustFireLoss(stored_burn) + H.update_body() + H.updatehealth() + H.UpdateDamageIcon() + H.nutrition -= SLIMEPERSON_HUNGERCOST + H.visible_message("[H] finishes regrowing [H.p_their()] missing [new_limb]!", "You finish regrowing your [limb_select]") else - to_chat(src, "You need to hold still in order to regrow a limb!") - return + to_chat(H, "You need to hold still in order to regrow a limb!") + +#undef SLIMEPERSON_COLOR_SHIFT_TRIGGER +#undef SLIMEPERSON_ICON_UPDATE_PERIOD +#undef SLIMEPERSON_BLOOD_SCALING_FACTOR #undef SLIMEPERSON_HUNGERCOST #undef SLIMEPERSON_MINHUNGER -#undef SLIMEPERSON_REGROWTHDELAY - -/datum/species/slime/handle_pre_change(mob/living/carbon/human/H) - ..() - if(reagent_skin_coloring) - H.toggle_recolor(silent = 1) \ No newline at end of file +#undef SLIMEPERSON_REGROWTHDELAY \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/tajaran.dm b/code/modules/mob/living/carbon/human/species/tajaran.dm index 0eaede54dbf..d4cdaf95944 100644 --- a/code/modules/mob/living/carbon/human/species/tajaran.dm +++ b/code/modules/mob/living/carbon/human/species/tajaran.dm @@ -54,5 +54,5 @@ "is twisting their own neck!", "is holding their breath!") -/datum/species/tajaran/handle_death(var/mob/living/carbon/human/H) +/datum/species/tajaran/handle_death(mob/living/carbon/human/H) H.stop_tail_wagging(1) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/unathi.dm b/code/modules/mob/living/carbon/human/species/unathi.dm index 243baa0ebfd..5acf2341f9f 100644 --- a/code/modules/mob/living/carbon/human/species/unathi.dm +++ b/code/modules/mob/living/carbon/human/species/unathi.dm @@ -56,12 +56,18 @@ "is twisting their own neck!", "is holding their breath!") - var/datum/action/innate/tail_lash/lash = new() + var/datum/action/innate/tail_lash/lash -/datum/species/unathi/handle_post_spawn(var/mob/living/carbon/human/H) - lash.Grant(H) +/datum/species/unathi/on_species_gain(mob/living/carbon/human/H) ..() + lash = new + lash.Grant(H) + +/datum/species/unathi/on_species_loss(mob/living/carbon/human/H) + ..() + if(lash) + lash.Remove(H) /datum/action/innate/tail_lash name = "Tail lash" @@ -88,5 +94,5 @@ -/datum/species/unathi/handle_death(var/mob/living/carbon/human/H) +/datum/species/unathi/handle_death(mob/living/carbon/human/H) H.stop_tail_wagging(1) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/vox.dm b/code/modules/mob/living/carbon/human/species/vox.dm index e86185a4d9b..799c71af735 100644 --- a/code/modules/mob/living/carbon/human/species/vox.dm +++ b/code/modules/mob/living/carbon/human/species/vox.dm @@ -77,7 +77,7 @@ "is holding their breath!", "is deeply inhaling oxygen!") -/datum/species/vox/handle_death(var/mob/living/carbon/human/H) +/datum/species/vox/handle_death(mob/living/carbon/human/H) H.stop_tail_wagging(1) /datum/species/vox/after_equip_job(datum/job/J, mob/living/carbon/human/H) @@ -95,13 +95,12 @@ H.internal = H.l_hand H.update_action_buttons_icon() -/datum/species/vox/handle_post_spawn(var/mob/living/carbon/human/H) +/datum/species/vox/on_species_gain(mob/living/carbon/human/H) + ..() updatespeciescolor(H) H.update_icons() - //H.verbs += /mob/living/carbon/human/proc/leap - ..() -/datum/species/vox/updatespeciescolor(var/mob/living/carbon/human/H, var/owner_sensitive = 1) //Handling species-specific skin-tones for the Vox race. +/datum/species/vox/updatespeciescolor(mob/living/carbon/human/H, owner_sensitive = 1) //Handling species-specific skin-tones for the Vox race. if(H.dna.species.bodyflags & HAS_ICON_SKIN_TONE) //Making sure we don't break Armalis. var/new_icobase = 'icons/mob/human_races/vox/r_vox.dmi' //Default Green Vox. var/new_deform = 'icons/mob/human_races/vox/r_def_vox.dmi' //Default Green Vox. @@ -132,19 +131,14 @@ H.change_icobase(new_icobase, new_deform, owner_sensitive) //Update the icobase/deform of all our organs, but make sure we don't mess with frankenstein limbs in doing so. H.update_dna() -/datum/species/vox/handle_reagents(var/mob/living/carbon/human/H, var/datum/reagent/R) +/datum/species/vox/handle_reagents(mob/living/carbon/human/H, datum/reagent/R) if(R.id == "oxygen") //Armalis are above such petty things. H.adjustToxLoss(1*REAGENTS_EFFECT_MULTIPLIER) //Same as plasma. H.reagents.remove_reagent(R.id, REAGENTS_METABOLISM) - return 0 //Handling reagent removal on our own. + return FALSE //Handling reagent removal on our own. return ..() -/datum/species/vox/armalis/handle_post_spawn(var/mob/living/carbon/human/H) - H.verbs += /mob/living/carbon/human/proc/leap - H.verbs += /mob/living/carbon/human/proc/gut - ..() - /datum/species/vox/armalis name = "Vox Armalis" name_plural = "Vox Armalis" @@ -198,4 +192,4 @@ "is huffing oxygen!") /datum/species/vox/armalis/handle_reagents() //Skip the Vox oxygen reagent toxicity. Armalis are above such things. - return 1 \ No newline at end of file + return TRUE \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/vulpkanin.dm b/code/modules/mob/living/carbon/human/species/vulpkanin.dm index 5746fe125c9..3e6ebc1d41d 100644 --- a/code/modules/mob/living/carbon/human/species/vulpkanin.dm +++ b/code/modules/mob/living/carbon/human/species/vulpkanin.dm @@ -48,5 +48,5 @@ "is twisting their own neck!", "is holding their breath!") -/datum/species/vulpkanin/handle_death(var/mob/living/carbon/human/H) +/datum/species/vulpkanin/handle_death(mob/living/carbon/human/H) H.stop_tail_wagging(1) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/wryn.dm b/code/modules/mob/living/carbon/human/species/wryn.dm index 5606cd81e9b..04060071ae8 100644 --- a/code/modules/mob/living/carbon/human/species/wryn.dm +++ b/code/modules/mob/living/carbon/human/species/wryn.dm @@ -7,7 +7,6 @@ tail = "wryntail" punchdamagelow = 0 punchdamagehigh = 1 - //primitive = /mob/living/carbon/monkey/wryn slowdown = 1 warning_low_pressure = -300 hazard_low_pressure = 1 @@ -49,11 +48,11 @@ default_hair = "Antennae" -/datum/species/wryn/handle_death(var/mob/living/carbon/human/H) +/datum/species/wryn/handle_death(mob/living/carbon/human/H) for(var/mob/living/carbon/C in living_mob_list) if(C.get_int_organ(/obj/item/organ/internal/wryn/hivenode)) to_chat(C, "Your antennae tingle as you are overcome with pain...") - to_chat(C, "It feels like part of you has died.") + to_chat(C, "It feels like part of you has died.") // This is bullshit /datum/species/wryn/harm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style) if(target.handcuffed && target.get_int_organ(/obj/item/organ/internal/wryn/hivenode)) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 2d024ec786e..a5883fe93f2 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -56,11 +56,7 @@ if(abilities) client.verbs |= abilities - if(istype(src,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = src - if(H.dna.species && H.dna.species.abilities) - client.verbs |= H.dna.species.abilities - + if(ishuman(src)) client.screen += client.void //HUD updates (antag hud, etc)