Fix some RTs - 03JUL2017 (#2938)

Fix the most common RTs from Sunday's testing.

Also works on orebags. Limits their capacity to 200, as anything higher than that breaks the fancy inventory system something awful. Maybe I should write a UT to test and confirm this. Expanding: I don't think TICK_CHECK in inventory procs is a good idea, without fully implementing a non-fancy storage subclass. Non-fancy would just be speedy without all of the fancy inventory orientation bullshit. But CBA to do that now and I'm not sure if it's worth it for the edgecase of drone satchels atm.
This commit is contained in:
skull132
2017-07-05 23:26:35 +03:00
committed by GitHub
parent 6637052899
commit e92f1fdd2e
11 changed files with 50 additions and 24 deletions
@@ -138,7 +138,12 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
if (pref.rlimb_data)
pref.rlimb_data = params2list(pref.rlimb_data)
if (pref.body_markings)
pref.body_markings = json_decode(pref.body_markings)
var/before = pref.body_markings
try
pref.body_markings = json_decode(pref.body_markings)
catch (var/exception/e)
log_debug("BODY MARKINGS: Caught [e]. Initial value: [before]")
pref.body_markings = list()
pref.r_hair = sanitize_integer(pref.r_hair, 0, 255, initial(pref.r_hair))
pref.g_hair = sanitize_integer(pref.g_hair, 0, 255, initial(pref.g_hair))
@@ -601,7 +606,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
var/disability_flag = text2num(href_list["disabilities"])
pref.disabilities ^= disability_flag
return TOPIC_REFRESH
else if(href_list["toggle_clothing"])
pref.dress_mob = !pref.dress_mob
return TOPIC_REFRESH
+3 -1
View File
@@ -266,9 +266,11 @@
//sealed pieces become airtight, protecting against diseases
if (!seal_target)
LAZYINITLIST(piece.armor)
piece.armor["bio"] = 100
else
piece.armor["bio"] = src.armor["bio"]
LAZYINITLIST(piece.armor)
piece.armor["bio"] = LAZYACCESS(src.armor, "bio") || 0
else
failed_to_seal = 1
+7 -1
View File
@@ -27,11 +27,17 @@
icon_state = "[initial(icon_state)]"
item_state = "[initial(item_state)]"
suittoggled = 0
// Hood got nuked. Probably because of RIGs or the like.
if (!hood)
MakeHood()
return
if(ishuman(hood.loc))
var/mob/living/carbon/H = hood.loc
H.unEquip(hood, 1)
H.update_inv_wear_suit()
hood.loc = src
hood.forceMove(src)
/obj/item/clothing/suit/storage/hooded/dropped()
RemoveHood()
@@ -67,7 +67,7 @@
var/obj/item/clothing/head/helmet = get_equipped_item(slot_head)
if(istype(helmet) && (helmet.body_parts_covered & HEAD) && (helmet.flags & STOPPRESSUREDAMAGE))
//we don't do an armor_check here because this is not an impact effect like a weapon swung with momentum, that either penetrates or glances off.
damage_mod = 1.0 - (helmet.armor["melee"]/100)
damage_mod = 1.0 - (LAZYACCESS(helmet.armor, "melee")/100)
var/total_damage = 0
for(var/i in 1 to 3)
@@ -79,12 +79,12 @@
if ((worn_suit.flags & THICKMATERIAL))
prob_mult -= 0.7
else
prob_mult -= 0.01 * (min(worn_suit.armor["bio"],70)) // Is it sealed? I can't get to 70% of your body.
prob_mult -= 0.01 * (min(LAZYACCESS(worn_suit.armor, "bio"), 70)) // Is it sealed? I can't get to 70% of your body.
if(worn_helmet)
if ((worn_helmet.flags & THICKMATERIAL))
prob_mult -= 0.3
else
prob_mult -= 0.01 *(min(worn_helmet.armor["bio"],30))// Is your helmet sealed? I can't get to 30% of your body.
prob_mult -= 0.01 *(min(LAZYACCESS(worn_helmet.armor, "bio"), 30))// Is your helmet sealed? I can't get to 30% of your body.
if( prob(sting_prob*prob_mult) && (M.stat == CONSCIOUS || (M.stat == UNCONSCIOUS && prob(25*prob_mult))) ) // Try to sting! If you're not moving, think about stinging.
M.apply_damage(min(strength*0.85,2)+mut, BURN, sharp=1) // Stinging. The more mutated I am, the harder I sting.
M.apply_damage(max(strength*1.7,(round(feral/10,1)*(max((round(strength/20,1)),1)))+toxic), TOX) // Bee venom based on how angry I am and how many there are of me!
+6 -4
View File
@@ -171,7 +171,7 @@
if(owner)
replaced(owner)
sync_colour_to_human(owner)
addtimer(CALLBACK(src, .proc/get_icon), 1)
if ((status & ORGAN_PLANT))
@@ -229,7 +229,7 @@
brute -= brute / 2
if(status & ORGAN_BROKEN && prob(40) && brute)
if (!(owner.species && (owner.species.flags & NO_PAIN)))
if (owner && !(owner.species && (owner.species.flags & NO_PAIN)))
owner.emote("scream") //getting hit on broken hand hurts
if(used_weapon)
add_autopsy_data("[used_weapon]", brute + burn)
@@ -272,12 +272,14 @@
spillover += max(0, burn - can_inflict)
//If there are still hurties to dispense
if (spillover)
if (spillover && owner)
owner.shock_stage += spillover * config.organ_damage_spillover_multiplier
// sync the organ's damage with its wounds
src.update_damages()
owner.updatehealth() //droplimb will call updatehealth() again if it does end up being called
if (owner)
owner.updatehealth() //droplimb will call updatehealth() again if it does end up being called
//If limb took enough damage, try to cut or tear it off
if(owner && loc == owner && !is_stump())
+3 -3
View File
@@ -17,14 +17,14 @@ var/global/list/gps_by_type = list()
/obj/item/device/gps/Initialize()
. = ..()
GPS_list.Add(src)
GPS_list += src
LAZYADD(gps_by_type["[type]"], src)
gpstag = "[gps_prefix][LAZYLEN(gps_by_type["[type]"])]"
name = "global positioning system ([gpstag])"
add_overlay("working")
/obj/item/device/gps/Destroy()
GPS_list.Remove(src)
GPS_list -= src
var/list/typelist = gps_by_type["[type]"]
LAZYREMOVE(typelist, src)
return ..()
@@ -57,7 +57,7 @@ var/global/list/gps_by_type = list()
var/turf/pos = get_turf(G)
var/area/gps_area = get_area(G)
var/tracked_gpstag = G.gpstag
if(G.emped == 1)
if(G.emped == 1 || !pos)
t += "<BR>[tracked_gpstag]: ERROR"
else
t += "<BR>[tracked_gpstag]: [format_text(gps_area.name)] ([pos.x], [pos.y], [pos.z])"
+3 -2
View File
@@ -17,7 +17,8 @@ proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne")
var/obj/item/I = M.wear_mask
//masks provide a small bonus and can replace overall bio protection
if(I)
score = max(score, round(0.06*I.armor["bio"]))
var/bio_armor = LAZYACCESS(I.armor, "bio") || 0
score = max(score, round(0.06 * bio_armor))
if (istype(I, /obj/item/clothing/mask))
score += 1 //this should be added after
@@ -51,7 +52,7 @@ proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne")
if (vector == "Airborne")
var/obj/item/I = M.wear_mask
if (istype(I))
protection = max(protection, I.armor["bio"])
protection = max(protection, LAZYACCESS(I.armor, "bio") || 0)
return prob(protection)