diff --git a/code/__defines/damage_organs.dm b/code/__defines/damage_organs.dm index 6c2590f840..6a2fa0c267 100644 --- a/code/__defines/damage_organs.dm +++ b/code/__defines/damage_organs.dm @@ -30,15 +30,15 @@ #define AIR_DAMAGE_MODIFIER 2.025 // More means less damage from hot air scalding lungs, less = more damage. (default 2.025) // Organ defines. -#define ORGAN_CUT_AWAY 1<<0 -#define ORGAN_BLEEDING 1<<1 -#define ORGAN_BROKEN 1<<2 -#define ORGAN_DESTROYED 1<<3 -#define ORGAN_ROBOT 1<<4 -#define ORGAN_SPLINTED 1<<5 -#define ORGAN_DEAD 1<<6 -#define ORGAN_MUTATED 1<<7 -#define ORGAN_ASSISTED 1<<8 +#define ORGAN_CUT_AWAY (1<<0) +#define ORGAN_BLEEDING (1<<1) +#define ORGAN_BROKEN (1<<2) +#define ORGAN_DESTROYED (1<<3) +#define ORGAN_ROBOT (1<<4) +#define ORGAN_SPLINTED (1<<5) +#define ORGAN_DEAD (1<<6) +#define ORGAN_MUTATED (1<<7) +#define ORGAN_ASSISTED (1<<8) #define DROPLIMB_EDGE 0 #define DROPLIMB_BLUNT 1 diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index ac5ae8d8c7..980a2b3ee2 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -88,7 +88,7 @@ //Processes the occupant, drawing from the internal power cell if needed. /obj/machinery/recharge_station/proc/process_occupant() - if(istype(occupant, /mob/living/silicon/robot)) + if(isrobot(occupant)) var/mob/living/silicon/robot/R = occupant if(R.module) @@ -103,6 +103,12 @@ R.adjustBruteLoss(-weld_rate) if(wire_rate && R.getFireLoss() && cell.checked_use(wire_power_use * wire_rate * CELLRATE)) R.adjustFireLoss(-wire_rate) + else if(ishuman(occupant)) + var/mob/living/carbon/human/H = occupant + if(!isnull(H.internal_organs_by_name["cell"]) && H.nutrition < 450) + H.nutrition = min(H.nutrition+10, 450) + cell.use(7000/450*10) + /obj/machinery/recharge_station/examine(mob/user) ..(user) @@ -199,24 +205,30 @@ /obj/machinery/recharge_station/Bumped(var/mob/living/silicon/robot/R) go_in(R) -/obj/machinery/recharge_station/proc/go_in(var/mob/living/silicon/robot/R) - if(!istype(R)) - return +/obj/machinery/recharge_station/proc/go_in(var/mob/M) if(occupant) return - - if(R.incapacitated()) - return - if(!R.cell) + if(!hascell(M)) return - add_fingerprint(R) - R.reset_view(src) - R.forceMove(src) - occupant = R + add_fingerprint(M) + M.reset_view(src) + M.forceMove(src) + occupant = M update_icon() return 1 +/obj/machinery/recharge_station/proc/hascell(var/mob/M) + if(isrobot(M)) + var/mob/living/silicon/robot/R = M + if(R.cell) + return 1 + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(!isnull(H.internal_organs_by_name["cell"])) + return 1 + return 0 + /obj/machinery/recharge_station/proc/go_out() if(!occupant) return @@ -243,4 +255,6 @@ set name = "Enter Recharger" set src in oview(1) + if(!usr.incapacitated()) + return go_in(usr) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 9627cd65b3..08f991dacd 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1183,7 +1183,12 @@ datum/preferences if("name") var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null if (!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.) - var/new_name = sanitizeName(raw_name) + var/new_name + var/datum/species/S = all_species[species] + if(istype(S)) + new_name = S.sanitize_name(raw_name) + else + new_name = sanitizeName(raw_name) if(new_name) real_name = new_name else diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index a67efd084c..3de456d9e7 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -188,11 +188,16 @@ //Sanitize metadata = sanitize_text(metadata, initial(metadata)) - real_name = sanitizeName(real_name) if(isnull(species) || !(species in playable_species)) species = "Human" + var/datum/species/cur_species = all_species[species] + if(istype(cur_species)) + real_name = cur_species.sanitize_name(real_name) + else + real_name = sanitizeName(real_name) + if(isnum(underwear)) var/list/undies = gender == MALE ? underwear_m : underwear_f underwear = undies[undies[underwear]] diff --git a/code/modules/mob/language/station.dm b/code/modules/mob/language/station.dm index 3d45e84f99..e391dd2d0f 100644 --- a/code/modules/mob/language/station.dm +++ b/code/modules/mob/language/station.dm @@ -108,10 +108,9 @@ /datum/language/machine/get_random_name() if(prob(70)) - name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]" + return "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]" else - name = pick(ai_names) - return name + return pick(ai_names) //Syllable Lists /* diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 0e7adc09cd..2b201a3805 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -157,6 +157,9 @@ for(var/u_type in unarmed_types) unarmed_attacks += new u_type() +/datum/species/proc/sanitize_name(var/new_name) + return sanitizeName(new_name) + /datum/species/proc/get_station_variant() return name diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index 77f40ad0c4..a6b76dca62 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -250,7 +250,7 @@ halloss_message_self = "ERROR: Unrecoverable machine check exception.
System halted, rebooting..." warning_low_pressure = 50 - hazard_low_pressure = 0 + hazard_low_pressure = -1 cold_level_1 = 50 cold_level_2 = -1 @@ -292,8 +292,17 @@ "r_foot" = list("path" = /obj/item/organ/external/foot/right/ipc) ) + + heat_discomfort_level = 373.15 + heat_discomfort_strings = list( + "Your CPU temperature probes warn you that you are approaching critical heat levels!" + ) + /datum/species/machine/handle_death(var/mob/living/carbon/human/H) ..() H.h_style = "" spawn(100) if(H) H.update_hair() + +/datum/species/machine/sanitize_name(var/new_name) + return sanitizeName(new_name,allow_numbers=1)