From cfa1d1ed1f45fde043895250ddffe58c444a2e7a Mon Sep 17 00:00:00 2001 From: "baloh.matevz@gmail.com" Date: Fri, 25 May 2012 16:34:10 +0000 Subject: [PATCH] - Some runtime-prevention tweaks so that impatient coders don't just break everything somewhere down the line. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3665 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/obj.dm | 14 ++++++++ code/defines/obj/clothing.dm | 13 ------- code/defines/obj/clothing/head.dm | 1 - code/defines/obj/weapon.dm | 6 ++-- .../objects/items/weapons/implants/implant.dm | 35 +++++++++++-------- code/game/objects/items/weapons/paint.dm | 2 +- code/game/objects/radio/headset.dm | 2 +- code/modules/clothing/suit.dm | 2 +- .../living/carbon/alien/humanoid/humanoid.dm | 9 ++--- .../mob/living/carbon/alien/larva/larva.dm | 9 ++--- code/modules/mob/living/carbon/human/human.dm | 22 ++++++------ .../living/carbon/human/human_attackhand.dm | 12 ++++--- .../mob/living/carbon/metroid/metroid.dm | 10 +++--- .../mob/living/carbon/monkey/monkey.dm | 12 ++++--- code/modules/paperwork/paper.dm | 6 ++-- code/modules/paperwork/stamps.dm | 2 +- 16 files changed, 85 insertions(+), 72 deletions(-) diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 9ad02d193e..0cd9a3aa1a 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -292,6 +292,20 @@ // causeerrorheresoifixthis var/obj/item/master = null + //Since any item can now be a piece of clothing, this has to be put here so all items share it. + var/see_face = 1.0 + var/color = null + var/body_parts_covered = 0 //see setup.dm for appropriate bit flags + var/protective_temperature = 0 + var/heat_transfer_coefficient = 1 //0 prevents all transfers, 1 is invisible + var/gas_transfer_coefficient = 1 // for leaking gas from turf to mask and vice-versa (for masks right now, but at some point, i'd like to include space helmets) + var/permeability_coefficient = 1 // for chemicals/diseases + var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit) + var/slowdown = 0 // How much clothing is slowing you down. Negative values speeds you up + var/canremove = 1 //Mostly for Ninja code at this point but basically will not allow the item to be removed if set to 0. /N + var/armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) + var/list/allowed = null //suit storage stuff. + /obj/item/device icon = 'device.dmi' diff --git a/code/defines/obj/clothing.dm b/code/defines/obj/clothing.dm index 0fa01cee78..320e2fb9cf 100644 --- a/code/defines/obj/clothing.dm +++ b/code/defines/obj/clothing.dm @@ -4,20 +4,7 @@ name = "clothing" // var/obj/item/clothing/master = null - var/see_face = 1.0 - var/color = null - var/body_parts_covered = 0 //see setup.dm for appropriate bit flags - - var/protective_temperature = 0 - var/heat_transfer_coefficient = 1 //0 prevents all transfers, 1 is invisible - var/gas_transfer_coefficient = 1 // for leaking gas from turf to mask and vice-versa (for masks right now, but at some point, i'd like to include space helmets) - var/permeability_coefficient = 1 // for chemicals/diseases - var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit) - var/slowdown = 0 // How much clothing is slowing you down. Negative values speeds you up - var/canremove = 1 //Mostly for Ninja code at this point but basically will not allow the item to be removed if set to 0. /N - - var/armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) diff --git a/code/defines/obj/clothing/head.dm b/code/defines/obj/clothing/head.dm index 71d492f17a..f3486526a4 100644 --- a/code/defines/obj/clothing/head.dm +++ b/code/defines/obj/clothing/head.dm @@ -3,7 +3,6 @@ name = "head" icon = 'hats.dmi' body_parts_covered = HEAD - var/list/allowed = list() slot_flags = SLOT_HEAD /obj/item/clothing/head/cakehat diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index b8fb6f11cc..b4723f3906 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -233,7 +233,7 @@ origin_tech = "combat=3" /obj/item/weapon/melee/energy/sword - var/color + color name = "energy sword" desc = "May the force be within you." icon_state = "sword0" @@ -323,7 +323,7 @@ w_class = 1.0 throw_speed = 2 throw_range = 10 - var/color = "white" + color = "white" /obj/item/weapon/bedsheet/blue icon_state = "sheetblue" @@ -547,7 +547,7 @@ icon = 'power.dmi' icon_state = "coil_red" var/amount = MAXCOIL - var/color = "red" + color = "red" desc = "A coil of power cable." throwforce = 10 w_class = 2.0 diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 4c7750e269..3e64931b04 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -1,15 +1,22 @@ /obj/item/weapon/implant name = "implant" - var - implanted = null - mob/imp_in = null - color = "b" - allow_reagents = 0 - proc - trigger(emote, source as mob) - activate() - implanted(source as mob) - get_data() + var/implanted = null + var/mob/imp_in = null + color = "b" + var/allow_reagents = 0 + + proc/trigger(emote, source as mob) + return + + proc/activate() + return + + proc/implanted(source as mob) + return + + proc/get_data() + return + trigger(emote, source as mob) @@ -32,9 +39,8 @@ /obj/item/weapon/implant/uplink name = "uplink" desc = "Summon things." - var - activation_emote = "chuckle" - obj/item/device/uplink/radio/uplink = null + var/activation_emote = "chuckle" + var/obj/item/device/uplink/radio/uplink = null New() @@ -61,8 +67,7 @@ /obj/item/weapon/implant/tracking name = "tracking" desc = "Track with this." - var - id = 1.0 + var/id = 1.0 get_data() diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm index f634eda9a9..983f8c9276 100644 --- a/code/game/objects/items/weapons/paint.dm +++ b/code/game/objects/items/weapons/paint.dm @@ -7,7 +7,7 @@ var/global/list/cached_icons = list() desc = "Used to recolor floors and walls. Can not be removed by the janitor." icon = 'items.dmi' icon_state = "paint_neutral" - var/color = "FFFFFF" + color = "FFFFFF" item_state = "paintcan" w_class = 3.0 diff --git a/code/game/objects/radio/headset.dm b/code/game/objects/radio/headset.dm index 54bf58dcff..76664e02f8 100644 --- a/code/game/objects/radio/headset.dm +++ b/code/game/objects/radio/headset.dm @@ -9,7 +9,7 @@ canhear_range = 1 // can't hear headsets from very far away slot_flags = SLOT_EARS - var/protective_temperature = 0 + protective_temperature = 0 var/translate_binary = 0 var/translate_hive = 0 var/obj/item/device/encryptionkey/keyslot1 = null diff --git a/code/modules/clothing/suit.dm b/code/modules/clothing/suit.dm index 73d1ab4dda..effb8f2d52 100644 --- a/code/modules/clothing/suit.dm +++ b/code/modules/clothing/suit.dm @@ -3,6 +3,6 @@ name = "suit" var/fire_resist = T0C+100 flags = FPRINT | TABLEPASS | ONESIZEFITSALL - 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 diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 29f70e1d89..b95a343256 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -593,11 +593,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) diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 8ed376f989..0bd12c8d35 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -365,11 +365,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) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 22cca9f9b7..6070ab3fa6 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -23,18 +23,18 @@ var/age = 30.0 var/b_type = "A+" - 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/ears = 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/ears = 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 diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 9e5360b97a..690e0a9536 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -9,11 +9,13 @@ visible_message("\red [M] attempted to touch [src]!") 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 [src] has been touched with the stun gloves by [M]!") M.attack_log += text("\[[time_stamp()]\] Stungloved [src.name] ([src.ckey])") src.attack_log += text("\[[time_stamp()]\] Has been stungloved by [M.name] ([M.ckey])") diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 1c44a561c4..0c601069e3 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -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 [src] has been touched with the stun gloves by [M]!", 1, "\red You hear someone fall.", 2) diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index b23877216b..83cc570474 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -157,11 +157,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 diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index d01b871670..62a7d24210 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -10,15 +10,15 @@ layer = 4 pressure_resistance = 1 slot_flags = SLOT_HEAD + see_face = 1 + body_parts_covered = HEAD + protective_temperature = 0 var/info //What's actually written on the paper. var/info_links //A different version of the paper which includes html links at fields and EOF var/stamps //The (text for the) stamps on the paper. var/fields //Amount of user created fields var/list/stamped - var/see_face = 1 - var/body_parts_covered = HEAD - var/protective_temperature = 0 var/rigged = 0 var/spam_flag = 0 diff --git a/code/modules/paperwork/stamps.dm b/code/modules/paperwork/stamps.dm index b1918e9431..cc6582a14e 100644 --- a/code/modules/paperwork/stamps.dm +++ b/code/modules/paperwork/stamps.dm @@ -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