Merge pull request #11376 from NullSnapshot/dev-freeze

Bunch of IPC fixes.
This commit is contained in:
Chinsky
2015-12-04 11:28:25 +03:00
7 changed files with 62 additions and 27 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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]]

View File

@@ -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
/*

View File

@@ -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

View File

@@ -250,7 +250,7 @@
halloss_message_self = "ERROR: Unrecoverable machine check exception.<BR>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)