From 2a1028324cd0d52ad1529a3615daf3ffc24df654 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Sat, 21 Feb 2015 07:26:25 -0500 Subject: [PATCH] Thickmaterial Flag --- code/datums/supplypacks.dm | 2 +- code/datums/uplink_item.dm | 9 +- code/game/gamemodes/game_mode.dm | 2 +- .../items/weapons/storage/uplink_kits.dm | 2 +- code/modules/clothing/clothing.dm | 4 +- code/modules/clothing/suits/armor.dm | 5 ++ code/modules/clothing/suits/bio.dm | 4 +- code/modules/clothing/suits/utility.dm | 8 +- code/modules/mob/living/carbon/human/human.dm | 37 +++++--- code/modules/mob/living/silicon/silicon.dm | 9 +- code/modules/mob/mob_helpers.dm | 9 +- code/modules/paperwork/pen.dm | 87 ++++++------------- .../reagents/reagent_containers/hypospray.dm | 9 +- .../reagents/reagent_containers/syringes.dm | 5 ++ .../research/xenoarchaeology/finds/finds.dm | 2 +- code/setup.dm | 3 +- 16 files changed, 103 insertions(+), 94 deletions(-) diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index a3fbd9c9f86..126255e5ad0 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -146,7 +146,7 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine /obj/item/weapon/grenade/smokebomb, /obj/item/weapon/grenade/smokebomb, /obj/item/weapon/grenade/smokebomb, - /obj/item/weapon/pen/paralysis, + /obj/item/weapon/pen/sleepy, /obj/item/weapon/grenade/chem_grenade/incendiary) cost = 20 containertype = /obj/structure/closet/crate diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 832749d6bcc..9006433602a 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -371,10 +371,11 @@ var/list/uplink_items = list() /datum/uplink_item/stealthy_weapons category = "Stealthy and Inconspicuous Weapons" -/datum/uplink_item/stealthy_weapons/para_pen - name = "Paralysis Pen" - desc = "A syringe disguised as a functional pen, filled with a neuromuscular-blocking drug that renders a target mute on injection that will eventually cause them to pass out. The pen holds one dose of paralyzing agent,though it can be refilled." - item = /obj/item/weapon/pen/paralysis +/datum/uplink_item/stealthy_weapons/sleepy_pen + name = "Sleepy Pen" + desc = "A syringe disguised as a functional pen, filled with a potent mix of drugs, including a strong anaesthetic and a chemical that is capable of blocking the movement of the vocal chords. \ + The pen holds one dose of the mixture. The pen can be refilled." + item = /obj/item/weapon/pen/sleepy cost = 8 excludefrom = list("nuclear emergency") diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index a54d336c5dd..09453727f4b 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -42,7 +42,7 @@ /obj/item/weapon/storage/box/emps:3:5 EMP Grenades; Whitespace:Seperator; Stealthy and Inconspicuous Weapons; -/obj/item/weapon/pen/paralysis:3:Paralysis Pen; +/obj/item/weapon/pen/sleepy:3:Sleepy Pen; /obj/item/weapon/soap/syndie:1:Syndicate Soap; /obj/item/weapon/cartridge/syndicate:3:Detomatix PDA Cartridge; Whitespace:Seperator; diff --git a/code/game/objects/items/weapons/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm index 6b4fc5a43bd..1d7e72fd1bc 100644 --- a/code/game/objects/items/weapons/storage/uplink_kits.dm +++ b/code/game/objects/items/weapons/storage/uplink_kits.dm @@ -12,7 +12,7 @@ if("stealth") new /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow(src) - new /obj/item/weapon/pen/paralysis(src) + new /obj/item/weapon/pen/sleepy(src) new /obj/item/device/chameleon(src) return diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 86905b08b8a..fd68636f599 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -280,7 +280,7 @@ BLIND // can't see anything name = "Space helmet" icon_state = "space" desc = "A special helmet designed for work in a hazardous, low-pressure environment." - flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE + flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE | THICKMATERIAL item_state = "s_helmet" permeability_coefficient = 0.01 armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 50) @@ -301,7 +301,7 @@ BLIND // can't see anything w_class = 4//bulky item gas_transfer_coefficient = 0.01 permeability_coefficient = 0.02 - flags = STOPSPRESSUREDMAGE + flags = STOPSPRESSUREDMAGE | THICKMATERIAL body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit) slowdown = 2 diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index c642aed8b20..2995df68f1a 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -198,6 +198,7 @@ w_class = 4//bulky item body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs,/obj/item/weapon/tank/emergency_oxygen) + flags = THICKMATERIAL flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS min_cold_protection_temperature = SPACE_SUIT_MIN_COLD_PROTECTION_TEMPERATURE @@ -210,6 +211,7 @@ item_state = "swat_suit" w_class = 4//bulky item gas_transfer_coefficient = 0.90 + flags = THICKMATERIAL body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS slowdown = 3 flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT @@ -218,6 +220,9 @@ /obj/item/clothing/suit/armor/tdome body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT + flags = THICKMATERIAL + cold_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS + heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS /obj/item/clothing/suit/armor/tdome/red name = "Thunderdome suit (red)" diff --git a/code/modules/clothing/suits/bio.dm b/code/modules/clothing/suits/bio.dm index 4527c6395c2..6764838430b 100644 --- a/code/modules/clothing/suits/bio.dm +++ b/code/modules/clothing/suits/bio.dm @@ -4,7 +4,7 @@ icon_state = "bio" desc = "A hood that protects the head and face from biological comtaminants." permeability_coefficient = 0.01 - flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR + flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR | THICKMATERIAL armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 20) flags_inv = HIDEMASK|HIDEEARS|HIDEEYES siemens_coefficient = 0.9 @@ -18,7 +18,7 @@ w_class = 4//bulky item gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 - flags = ONESIZEFITSALL + flags = ONESIZEFITSALL | THICKMATERIAL body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS slowdown = 1.0 allowed = list(/obj/item/weapon/tank/emergency_oxygen,/obj/item/weapon/pen,/obj/item/device/flashlight/pen) diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index ca86eb92755..08d3757a95f 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -21,7 +21,7 @@ allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen,/obj/item/weapon/extinguisher) slowdown = 1.0 flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL - flags = STOPSPRESSUREDMAGE + flags = STOPSPRESSUREDMAGE | THICKMATERIAL heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS max_heat_protection_temperature = FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS @@ -55,7 +55,7 @@ name = "bomb hood" desc = "Use in case of bomb." icon_state = "bombsuit" - flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR + flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR | THICKMATERIAL armor = list(melee = 40, bullet = 0, laser = 20,energy = 10, bomb = 100, bio = 0, rad = 0) flags_inv = HIDEMASK|HIDEEARS|HIDEEYES cold_protection = HEAD @@ -74,6 +74,7 @@ w_class = 4//bulky item gas_transfer_coefficient = 0.01 permeability_coefficient = 0.01 + flags = THICKMATERIAL body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS slowdown = 2 armor = list(melee = 40, bullet = 0, laser = 20,energy = 10, bomb = 100, bio = 0, rad = 0) @@ -102,7 +103,7 @@ name = "Radiation Hood" icon_state = "rad" desc = "A hood with radiation protective properties. Label: Made with lead, do not eat insulation" - flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR + flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR|THICKMATERIAL armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 60, rad = 100) loose = 8 @@ -114,6 +115,7 @@ w_class = 4//bulky item gas_transfer_coefficient = 0.90 permeability_coefficient = 0.50 + flags = THICKMATERIAL body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen) slowdown = 1.5 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d28557cdaef..778f9079d59 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -42,7 +42,7 @@ // Set up DNA. if(!delay_ready_dna) dna.ready_dna(src) - + /mob/living/carbon/human/dummy real_name = "Test Dummy" status_flags = GODMODE|CANPUSH @@ -539,8 +539,8 @@ if(id) return id.rank ? id.rank : if_no_job else - return if_no_id - + return if_no_id + //gets assignment from ID or ID inside PDA or PDA itself //Useful when player do something with computers /mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job") @@ -1073,6 +1073,21 @@ xylophone=0 return +/mob/living/carbon/human/can_inject(var/mob/user, var/error_msg, var/target_zone) + . = 1 // Default to returning true. + if(user && !target_zone) + target_zone = user.zone_sel.selecting + // If targeting the head, see if the head item is thin enough. + // If targeting anything else, see if the wear suit is thin enough. + if(above_neck(target_zone)) + if(head && head.flags & THICKMATERIAL) + . = 0 + else + if(wear_suit && wear_suit.flags & THICKMATERIAL) + . = 0 + if(!. && error_msg && user) + // Might need re-wording. + user << "There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"]." /mob/living/carbon/human/proc/vomit(hairball=0) if(stat==2)return @@ -1301,7 +1316,7 @@ usr << "\blue [self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]." /mob/living/carbon/human/proc/set_species(var/new_species, var/force_organs, var/default_colour) - + var/datum/species/oldspecies = species if(!dna) if(!new_species) @@ -1318,26 +1333,26 @@ if(species.language) remove_language(species.language) - + if(species.default_language) - remove_language(species.default_language) - + remove_language(species.default_language) + species = all_species[new_species] - + if(oldspecies) if(oldspecies.default_genes.len) oldspecies.handle_dna(src,1) // Remove any genes that belong to the old species if(force_organs || !organs || !organs.len) species.create_organs(src) - + if(vessel) vessel = null make_blood() if(species.language) add_language(species.language) - + if(species.default_language) add_language(species.default_language) @@ -1359,7 +1374,7 @@ r_skin = 0 g_skin = 0 b_skin = 0 - + if(!dna) dna = new /datum/dna(null) dna.species = species.name diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 1eb36aa0c19..9b46dbba82f 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -124,6 +124,11 @@ /mob/living/silicon/proc/damage_mob(var/brute = 0, var/fire = 0, var/tox = 0) return +/mob/living/silicon/can_inject(var/mob/user, var/error_msg) + if(error_msg) + user << "Their outer shell is too tough." + return 0 + /mob/living/silicon/IsAdvancedToolUser() return 1 @@ -207,7 +212,7 @@ show_emergency_shuttle_eta() show_system_integrity() show_malf_ai() - + //Silicon mob language procs /mob/living/silicon/can_speak(datum/language/speaking) @@ -290,7 +295,7 @@ set category = "IC" flavor_text = sanitize(copytext(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text, 1)) - + /mob/living/silicon/binarycheck() return 1 diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4c5a6d09372..74ebd7eeefc 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -213,6 +213,13 @@ proc/hassensorlevel(A, var/level) return zone +/proc/above_neck(zone) + var/list/zones = list("head", "mouth", "eyes") + if(zones.Find(zone)) + return 1 + else + return 0 + /proc/stars(n, pr) if (pr == null) pr = 25 @@ -491,4 +498,4 @@ var/list/intents = list("help","disarm","grab","harm") else // Everyone else (dead people who didn't ghost yet, etc.) lname = name lname = "[lname] " - M << "[lname][follow][message]" + M << "[lname][follow][message]" diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 6c96b62a328..6a6ffdc2d55 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -18,8 +18,8 @@ slot_flags = SLOT_BELT | SLOT_EARS throwforce = 0 w_class = 1.0 - throw_speed = 7 - throw_range = 15 + throw_speed = 3 + throw_range = 7 m_amt = 10 var/colour = "black" //what colour the ink is! pressure_resistance = 2 @@ -41,72 +41,37 @@ colour = "white" -/obj/item/weapon/pen/attack(mob/M as mob, mob/user as mob) - if(!ismob(M)) +/obj/item/weapon/pen/attack(mob/living/M, mob/user) + if(!istype(M)) return - user << "You stab [M] with the pen." -// M << "\red You feel a tiny prick!" //That's a whole lot of meta! - M.attack_log += text("\[[time_stamp()]\] Has been stabbed with [name] by [user.name] ([user.ckey])") - user.attack_log += text("\[[time_stamp()]\] Used the [name] to stab [M.name] ([M.ckey])") - if(!iscarbon(user)) - M.LAssailant = null - else - M.LAssailant = user - return + if(M.can_inject(user, 1)) + user << "You stab [M] with the pen." +// M << "You feel a tiny prick!" + . = 1 + + add_logs(user, M, "stabbed", object="[name]") /* - * Sleepy Pens + * Sleepypens */ -/obj/item/weapon/pen/sleepypen - desc = "It's a black ink pen with a sharp point and a carefully engraved \"Waffle Co.\"" +/obj/item/weapon/pen/sleepy flags = OPENCONTAINER origin_tech = "materials=2;syndicate=5" -/obj/item/weapon/pen/sleepypen/New() - var/datum/reagents/R = new/datum/reagents(30) //Used to be 300 - reagents = R - R.my_atom = src - R.add_reagent("chloralhydrate", 22) //Used to be 100 sleep toxin//30 Chloral seems to be fatal, reducing it to 22./N +/obj/item/weapon/pen/sleepy/attack(mob/living/M, mob/user) + if(!istype(M)) return + + if(..()) + if(reagents.total_volume) + if(M.reagents) + reagents.trans_to(M, 55) + + +/obj/item/weapon/pen/sleepy/New() + create_reagents(55) + reagents.add_reagent("stoxin", 30) + reagents.add_reagent("mutetoxin", 15) + reagents.add_reagent("tirizene", 10) ..() - return - - -/obj/item/weapon/pen/sleepypen/attack(mob/M as mob, mob/user as mob) - if(!ismob(M)) - return - ..() - msg_admin_attack("[user.name] ([user.ckey]) Used the [name] to stab [M.name] ([M.ckey]) (JMP)") - if(reagents.total_volume) - if(M.reagents) reagents.trans_to(M, 50) //used to be 150 - return - - -/* - * Parapens - */ -/obj/item/weapon/pen/paralysis - flags = OPENCONTAINER - origin_tech = "materials=2;syndicate=5" - - -/obj/item/weapon/pen/paralysis/New() - var/datum/reagents/R = new/datum/reagents(55) - reagents = R - R.my_atom = src - R.add_reagent("stoxin", 30) - R.add_reagent("mutetoxin", 15) - R.add_reagent("tirizene", 10) - ..() - return - - -/obj/item/weapon/pen/paralysis/attack(mob/M as mob, mob/user as mob) - if(!ismob(M)) - return - ..() - msg_admin_attack("[user.name] ([user.ckey]) Used the [name] to stab [M.name] ([M.ckey]) (JMP)") - if(reagents.total_volume) - if(M.reagents) reagents.trans_to(M, 55) //used to be 150 - return \ No newline at end of file diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm index 4d19e402f3d..e690f0ac52e 100644 --- a/code/modules/reagents/reagent_containers/hypospray.dm +++ b/code/modules/reagents/reagent_containers/hypospray.dm @@ -14,18 +14,19 @@ possible_transfer_amounts = list(1,2,3,4,5,10,15,20,25,30) flags = OPENCONTAINER slot_flags = SLOT_BELT + var/ignore_flags = 0 /obj/item/weapon/reagent_containers/hypospray/attack_paw(mob/user as mob) return src.attack_hand(user) -/obj/item/weapon/reagent_containers/hypospray/attack(mob/M as mob, mob/user as mob) +/obj/item/weapon/reagent_containers/hypospray/attack(mob/living/M, mob/user) if(!reagents.total_volume) user << "\red [src] is empty." return - if (!( istype(M, /mob) )) + if(!istype(M)) return - if (reagents.total_volume) + if(reagents.total_volume && (ignore_flags || M.can_inject(user, 1))) user << "\blue You inject [M] with [src]." M << "\red You feel a tiny prick!" @@ -61,6 +62,7 @@ possible_transfer_amounts = list(10) icon_state = "combat_hypo" volume = 60 + ignore_flags = 1 // So they can heal their comrades. /obj/item/weapon/reagent_containers/hypospray/combat/New() ..() @@ -75,6 +77,7 @@ amount_per_transfer_from_this = 10 possible_transfer_amounts = list(10) volume = 10 + ignore_flags = 1 //so you can medipen through hardsuits flags = null /obj/item/weapon/reagent_containers/hypospray/autoinjector/New() diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 7ef798f86e5..34ae1e1d65c 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -55,6 +55,11 @@ if(!proximity) return if(!target.reagents) return + if(isliving(target)) + var/mob/living/M = target + if(!M.can_inject(user, 1)) + return + if(mode == SYRINGE_BROKEN) user << "\red This syringe is broken!" return diff --git a/code/modules/research/xenoarchaeology/finds/finds.dm b/code/modules/research/xenoarchaeology/finds/finds.dm index 6b07fbb16a9..f657b006ccf 100644 --- a/code/modules/research/xenoarchaeology/finds/finds.dm +++ b/code/modules/research/xenoarchaeology/finds/finds.dm @@ -250,7 +250,7 @@ if(prob(75)) new_item = new /obj/item/weapon/pen(src.loc) else - new_item = new /obj/item/weapon/pen/sleepypen(src.loc) + new_item = new /obj/item/weapon/pen/sleepy(src.loc) if(prob(30)) apply_image_decorations = 1 if(16) diff --git a/code/setup.dm b/code/setup.dm index 9781a8db326..80851813e7d 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -216,7 +216,8 @@ var/MAX_EX_FLASH_RANGE = 14 #define HEADBANGPROTECT 4096 #define EARBANGPROTECT 1024 -#define NOSLIP 1024 //prevents from slipping on wet floors, in space etc +#define THICKMATERIAL 1024 //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body. (NOTE: flag shared with NOSLIP) +#define NOSLIP 1024 //prevents from slipping on wet floors, in space etc (NOTE: flag shared with THICKMATERIAL for external suits and helmet) #define OPENCONTAINER 4096 // is an open container for chemistry purposes