TG: - Some runtime-prevention tweaks so that impatient coders don't just break

everything somewhere down the line.
Revision: r3665
Author: 	 baloh.matevz
This commit is contained in:
Erthilo
2012-05-29 00:33:25 +01:00
parent 7f77c0ec91
commit 112fb5433e
18 changed files with 134 additions and 103 deletions
+21 -17
View File
@@ -3,10 +3,11 @@
atom/var/list/suit_fibers
atom/proc/add_fibers(mob/living/carbon/human/M)
if(M.gloves)
if(M.gloves.transfer_blood) //bloodied gloves transfer blood to touched objects
if(add_blood(M.gloves.bloody_hands_mob)) //only reduces the bloodiness of our gloves if the item wasn't already bloody
M.gloves.transfer_blood--
if(M.gloves && istype(M.gloves,/obj/item/clothing/))
var/obj/item/clothing/gloves/G = M.gloves
if(G.transfer_blood) //bloodied gloves transfer blood to touched objects
if(add_blood(G.bloody_hands_mob)) //only reduces the bloodiness of our gloves if the item wasn't already bloody
G.transfer_blood--
else if(M.bloody_hands)
if(add_blood(M.bloody_hands_mob))
M.bloody_hands--
@@ -613,10 +614,11 @@ turf/Exited(mob/living/carbon/human/M)
M.track_blood--
src.add_bloody_footprints(M.track_blood_mob,1,M.dir,get_tracks(M),M.track_blood_type)
else if(istype(M,/mob/living/carbon/human))
if(M.shoes)
if(M.shoes.track_blood > 0)
M.shoes.track_blood--
src.add_bloody_footprints(M.shoes.track_blood_mob,1,M.dir,M.shoes.name,M.shoes.track_blood_type) // And bloody tracks end here
if(M.shoes && istype(M.shoes,/obj/item/clothing/shoes))
var/obj/item/clothing/shoes/S = M.shoes
if(S.track_blood > 0)
S.track_blood--
src.add_bloody_footprints(S.track_blood_mob,1,M.dir,S.name,S.track_blood_type) // And bloody tracks end here
. = ..()
turf/Entered(mob/living/carbon/human/M)
if(istype(M,/mob/living) && !istype(M,/mob/living/carbon/metroid))
@@ -631,10 +633,11 @@ turf/Entered(mob/living/carbon/human/M)
M.track_blood--
src.add_bloody_footprints(M.track_blood_mob,0,M.dir,get_tracks(M),M.track_blood_type)
else if(istype(M,/mob/living/carbon/human))
if(M.shoes && !istype(src,/turf/space))
if(M.shoes.track_blood > 0)
M.shoes.track_blood--
src.add_bloody_footprints(M.shoes.track_blood_mob,0,M.dir,M.shoes.name,M.shoes.track_blood_type)
if(M.shoes && istype(M.shoes,/obj/item/clothing/shoes) && !istype(src,/turf/space))
var/obj/item/clothing/shoes/S = M.shoes
if(S.track_blood > 0)
S.track_blood--
src.add_bloody_footprints(S.track_blood_mob,0,M.dir,S.name,S.track_blood_type)
for(var/obj/effect/decal/cleanable/B in src)
@@ -649,11 +652,12 @@ turf/Entered(mob/living/carbon/human/M)
track_type = "oil"
if(istype(M,/mob/living/carbon/human))
if(M.shoes)
M.shoes.add_blood(B.blood_owner)
M.shoes.track_blood_mob = B.blood_owner
M.shoes.track_blood = max(M.shoes.track_blood,8)
M.shoes.track_blood_type = track_type
if(M.shoes && istype(M.shoes,/obj/item/clothing/shoes))
var/obj/item/clothing/shoes/S = M.shoes
S.add_blood(B.blood_owner)
S.track_blood_mob = B.blood_owner
S.track_blood = max(S.track_blood,8)
S.track_blood_type = track_type
else
M.add_blood(B.blood_owner)
M.track_blood_mob = B.blood_owner
-1
View File
@@ -4,7 +4,6 @@
icon = 'hats.dmi'
body_parts_covered = HEAD
slot_flags = SLOT_HEAD
var/list/allowed = list()
/obj/item/clothing/head/cakehat
name = "cake-hat"
+1 -1
View File
@@ -3,6 +3,6 @@
name = "suit"
var/fire_resist = T0C+100
flags = FPRINT | TABLEPASS
var/list/allowed = list(/obj/item/weapon/tank/emergency_oxygen)
allowed = list(/obj/item/weapon/tank/emergency_oxygen)
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
slot_flags = SLOT_OCLOTHING
@@ -601,11 +601,12 @@
..()
if(M.gloves)
if(M.gloves.cell)
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
var/obj/item/clothing/gloves/G = M.gloves
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(M.gloves.cell.charge >= 2500)
M.gloves.cell.charge -= 2500
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
Weaken(5)
if (stuttering < 5)
@@ -367,11 +367,12 @@
..()
if(M.gloves)
if(M.gloves.cell)
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
var/obj/item/clothing/gloves/G = M.gloves
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(M.gloves.cell.charge >= 2500)
M.gloves.cell.charge -= 2500
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
Weaken(5)
if (stuttering < 5)
+12 -12
View File
@@ -27,19 +27,19 @@
var/list/skills = null
// var/b_type
var/obj/item/clothing/suit/wear_suit = null
var/obj/item/clothing/under/w_uniform = null
var/obj/item/clothing/shoes/shoes = null
var/obj/item/weapon/belt = null
var/obj/item/clothing/gloves/gloves = null
var/obj/item/clothing/glasses/glasses = null
var/obj/item/clothing/head/head = null
var/obj/item/clothing/ears/l_ear = null
var/obj/item/clothing/ears/r_ear = null
var/obj/item/wear_suit = null
var/obj/item/w_uniform = null
var/obj/item/shoes = null
var/obj/item/belt = null
var/obj/item/gloves = null
var/obj/item/glasses = null
var/obj/item/head = null
var/obj/item/l_ear = null
var/obj/item/r_ear = null
var/obj/item/weapon/card/id/wear_id = null
var/obj/item/weapon/r_store = null
var/obj/item/weapon/l_store = null
var/obj/item/weapon/s_store = null
var/obj/item/r_store = null
var/obj/item/l_store = null
var/obj/item/s_store = null
var/icon/stand_icon = null
var/icon/lying_icon = null
@@ -9,11 +9,13 @@
visible_message("\red <B>[M] attempted to touch [src]!</B>")
return 0
if(M.gloves)
if(M.gloves.cell)
if(M.a_intent == "hurt")
if(M.gloves.cell.charge >= 2500)
M.gloves.cell.charge -= 2500
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
var/obj/item/clothing/gloves/G = M.gloves
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
visible_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Stungloved [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stungloved by [M.name] ([M.ckey])</font>")
@@ -153,10 +153,11 @@ emp_act
if(H.wear_suit) H.wear_suit.add_blood(src)
else if(H.w_uniform) H.w_uniform.add_blood(src)
if(H.shoes) H.shoes.add_blood(src)
if (H.gloves)
H.gloves.add_blood(H)
H.gloves.transfer_blood = 2
H.gloves.bloody_hands_mob = H
if (H.gloves && istype(H.gloves,/obj/item/clothing/gloves))
var/obj/item/clothing/gloves/G = H.gloves
G.add_blood(H)
G.transfer_blood = 2
G.bloody_hands_mob = H
else
H.add_blood(H)
H.bloody_hands = 2
+14 -2
View File
@@ -1334,8 +1334,20 @@
else
blind.layer = 0
if ((disabilities & 1 && ((glasses && !glasses.prescription) || !glasses)) || (glasses && glasses.prescription && !(disabilities & 1)))
client.screen += hud_used.vimpaired
if(disabilities & 1)
if(!glasses)
client.screen += hud_used.vimpaired
else if (glasses && istype(glasses,/obj/item/clothing/glasses))
var/obj/item/clothing/glasses/G = glasses
if(!G.prescription)
client.screen += hud_used.vimpaired
else
client.screen += hud_used.vimpaired
else
if(glasses && istype(glasses,/obj/item/clothing/glasses))
var/obj/item/clothing/glasses/G = glasses
if(G.prescription)
client.screen += hud_used.vimpaired
if (eye_blurry)
client.screen += hud_used.blurry
@@ -384,7 +384,7 @@
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[M.name] has bit [src]!</B>"), 1)
bruteloss += rand(1, 3)
adjustBruteLoss(rand(1, 3))
updatehealth()
return
@@ -463,11 +463,13 @@
if(M.gloves)
if(M.gloves.cell)
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
var/obj/item/clothing/gloves/G = M.gloves
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(M.gloves.cell.charge >= 2500)
M.gloves.cell.charge -= 2500
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>", 1, "\red You hear someone fall.", 2)
@@ -210,11 +210,13 @@
if (istype(loc, /turf) && istype(loc.loc, /area/start))
M << "No attacking people at spawn, you jackass."
return
if(M.gloves)
if(M.gloves.cell)
if(M.a_intent == "hurt")
if(M.gloves.cell.charge >= 2500)
M.gloves.cell.charge -= 2500
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
var/obj/item/clothing/gloves/G = M.gloves
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
Weaken(5)
if (stuttering < 5)
stuttering = 5
+1 -1
View File
@@ -10,7 +10,7 @@
throw_speed = 7
throw_range = 15
m_amt = 60
var/color = "cargo"
color = "cargo"
pressure_resistance = 5
/obj/item/weapon/stamp/captain