diff --git a/code/_helpers/turfs.dm b/code/_helpers/turfs.dm index e59bf929996..a28061d55e3 100644 --- a/code/_helpers/turfs.dm +++ b/code/_helpers/turfs.dm @@ -25,6 +25,22 @@ return 0 return 1 +/proc/get_random_turf_in_range(var/atom/origin, var/outer_range, var/inner_range) + origin = get_turf(origin) + if(!origin) + return + var/list/turfs = list() + for(var/turf/T in orange(origin, outer_range)) + if(!(T.z in current_map.sealed_levels)) // Picking a turf outside the map edge isn't recommended + if(T.x >= world.maxx-TRANSITIONEDGE || T.x <= TRANSITIONEDGE) + continue + if(T.y >= world.maxy-TRANSITIONEDGE || T.y <= TRANSITIONEDGE) + continue + if(!inner_range || get_dist(origin, T) >= inner_range) + turfs += T + if(turfs.len) + return pick(turfs) + // This proc will check if a neighboring tile in the stated direction "dir" is dense or not // Will return 1 if it is dense and zero if not /proc/check_neighbor_density(turf/T, var/dir) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index df334f450c5..051049f118d 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -317,7 +317,7 @@ var/list/slot_equipment_priority = list( \ /mob/living/carbon/throw_item(atom/target) src.throw_mode_off() - if(usr.stat || !target) + if(stat || !target) return if(target.type == /obj/screen) return diff --git a/code/modules/mob/living/carbon/human/species/station/human/human.dm b/code/modules/mob/living/carbon/human/species/station/human/human.dm index 1737629de29..f209c99cbf4 100644 --- a/code/modules/mob/living/carbon/human/species/station/human/human.dm +++ b/code/modules/mob/living/carbon/human/species/station/human/human.dm @@ -41,4 +41,51 @@ zombie_type = "Zombie" base_color = "#25032" - character_color_presets = list("Dark" = "#000000", "Warm" = "#250302", "Cold" = "#1e1e29") \ No newline at end of file + character_color_presets = list("Dark" = "#000000", "Warm" = "#250302", "Cold" = "#1e1e29") + +/datum/species/human/handle_npc(var/mob/living/carbon/human/H) + if(H.stat != CONSCIOUS) + return + + if(H.get_shock() && H.shock_stage < 40 && prob(3)) + H.emote(pick("moan","groan")) + + if(H.shock_stage > 10 && prob(3)) + H.emote(pick("cry","whimper")) + + if(H.shock_stage >= 40 && prob(3)) + H.emote("scream") + + if(!H.restrained() && H.lying && H.shock_stage >= 60 && prob(3)) + H.custom_emote("thrashes in agony") + + if(!H.restrained() && H.shock_stage < 40 && prob(3)) + var/maxdam = 0 + var/obj/item/organ/external/damaged_organ = null + for(var/obj/item/organ/external/E in H.organs) + if(!E.can_feel_pain()) + continue + var/dam = E.get_damage() + // make the choice of the organ depend on damage, + // but also sometimes use one of the less damaged ones + if(dam > maxdam && (maxdam == 0 || prob(50)) ) + damaged_organ = E + maxdam = dam + var/datum/gender/T = gender_datums[H.get_gender()] + if(damaged_organ) + if(damaged_organ.status & ORGAN_BLEEDING) + H.custom_emote("clutches [T.his] [damaged_organ.name], trying to stop the blood.") + else if(damaged_organ.status & ORGAN_BROKEN) + H.custom_emote("holds [T.his] [damaged_organ.name] carefully.") + else if(damaged_organ.burn_dam > damaged_organ.brute_dam && damaged_organ.organ_tag != BP_HEAD) + H.custom_emote("blows on [T.his] [damaged_organ.name] carefully.") + else + H.custom_emote("rubs [T.his] [damaged_organ.name] carefully.") + + for(var/obj/item/organ/I in H.internal_organs) + if((I.status & ORGAN_DEAD) || BP_IS_ROBOTIC(I)) + continue + if(I.damage > 2) + if(prob(2)) + var/obj/item/organ/external/parent = H.get_organ(I.parent_organ) + H.custom_emote("clutches [T.his] [parent.name]!") diff --git a/code/modules/mob/living/carbon/human/species/station/monkey.dm b/code/modules/mob/living/carbon/human/species/station/monkey.dm index 658ea038803..daefe1f9449 100644 --- a/code/modules/mob/living/carbon/human/species/station/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/station/monkey.dm @@ -48,14 +48,49 @@ pass_flags = PASSTABLE holder_type = /obj/item/holder/monkey + var/static/list/no_touchie = list(/obj/item/mirror) + /datum/species/monkey/handle_npc(var/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 + if(prob(33) && isturf(H.loc) && !H.pulledby) //won't move if being pulled step(H, pick(cardinal)) + + var/obj/held = H.get_active_hand() + if(held && prob(1)) + var/turf/T = get_random_turf_in_range(H, 7, 2) + if(T) + if(istype(held, /obj/item/gun) && prob(80)) + var/obj/item/gun/G = held + G.Fire(T, H) + else + H.throw_item(T) + else + H.drop_item() + if(!held && !H.restrained() && prob(5)) + var/list/touchables = list() + for(var/obj/O in range(1,get_turf(H))) + if(O.simulated && O.Adjacent(H) && !is_type_in_list(O, no_touchie)) + touchables += O + if(touchables.len) + var/obj/touchy = pick(touchables) + touchy.attack_hand(H) + if(prob(1)) H.emote(pick("scratch","jump","roll","tail")) + if(H.get_shock() && H.shock_stage < 40 && prob(3)) + H.custom_emote("chimpers pitifully") + + if(H.shock_stage > 10 && prob(3)) + H.emote(pick("cry","whimper")) + + if(H.shock_stage >= 40 && prob(3)) + H.emote("scream") + + if(!H.restrained() && H.lying && H.shock_stage >= 60 && prob(3)) + H.custom_emote("thrashes in agony") + /datum/species/monkey/get_random_name() return "[lowertext(name)] ([rand(100,999)])" diff --git a/html/changelogs/mattatlas-monkey.yml b/html/changelogs/mattatlas-monkey.yml new file mode 100644 index 00000000000..1e344d35885 --- /dev/null +++ b/html/changelogs/mattatlas-monkey.yml @@ -0,0 +1,42 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Human NPCs and monkeys now have some more interactions." + - rscadd: "Monkeys can now take items and throw them. Or shoot guns. Or activate things." diff --git a/icons/mob/human_races/masks/blood_resomi.dmi b/icons/mob/human_races/masks/blood_resomi.dmi deleted file mode 100644 index 104eb8f94dd..00000000000 Binary files a/icons/mob/human_races/masks/blood_resomi.dmi and /dev/null differ diff --git a/icons/mob/human_races/masks/dam_mask_resomi.dmi b/icons/mob/human_races/masks/dam_mask_resomi.dmi deleted file mode 100644 index c3166d5945d..00000000000 Binary files a/icons/mob/human_races/masks/dam_mask_resomi.dmi and /dev/null differ diff --git a/icons/mob/human_races/masks/dam_resomi.dmi b/icons/mob/human_races/masks/dam_resomi.dmi deleted file mode 100644 index 2241c3943c9..00000000000 Binary files a/icons/mob/human_races/masks/dam_resomi.dmi and /dev/null differ diff --git a/icons/mob/human_races/monkeys/monkey_body.dmi b/icons/mob/human_races/monkeys/monkey_body.dmi new file mode 100644 index 00000000000..e9c497331cd Binary files /dev/null and b/icons/mob/human_races/monkeys/monkey_body.dmi differ