From 131fc38e424ab56274129ce28d5a397751bc1450 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 29 Jan 2015 10:53:32 +1030 Subject: [PATCH 1/4] Fixes #7861 (partial), #7957, #7940 --- .../clothing/spacesuits/rig/modules/computer.dm | 7 ++++--- .../clothing/spacesuits/rig/modules/modules.dm | 8 ++++++++ code/modules/clothing/spacesuits/rig/modules/ninja.dm | 1 + code/modules/clothing/spacesuits/rig/rig.dm | 11 ++++++++--- code/modules/clothing/spacesuits/rig/rig_attackby.dm | 2 +- code/modules/clothing/spacesuits/rig/rig_verbs.dm | 6 ++++-- nano/templates/hardsuit.tmpl | 6 +++--- 7 files changed, 29 insertions(+), 12 deletions(-) diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm index 1b2befa59a..3d66c64602 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -334,6 +334,7 @@ var/atom/interfaced_with // Currently draining power from this device. var/total_power_drained = 0 + var/drain_loc /obj/item/rig_module/power_sink/deactivate() @@ -373,6 +374,7 @@ H << "You begin draining power from [target]!" interfaced_with = target + drain_loc = interfaced_with.loc holder.spark_system.start() playsound(H.loc, 'sound/effects/sparks2.ogg', 50, 1) @@ -406,7 +408,7 @@ drain_complete(H) return - if(!interfaced_with || !interfaced_with.Adjacent(H)) + if(!interfaced_with || !interfaced_with.Adjacent(H) || !(interfaced_with.loc == drain_loc)) H << "Your power sink retracts into its casing." drain_complete(H) return @@ -427,8 +429,6 @@ holder.cell.give(target_drained * CELLRATE) total_power_drained += target_drained - - return 1 /obj/item/rig_module/power_sink/proc/drain_complete(var/mob/living/M) @@ -439,5 +439,6 @@ if(M) M << "Total power drained from [interfaced_with]: [round(total_power_drained/1000)]kJ." interfaced_with.drain_power(0,1,0) // Damage the victim. + drain_loc = null interfaced_with = null total_power_drained = 0 \ No newline at end of file diff --git a/code/modules/clothing/spacesuits/rig/modules/modules.dm b/code/modules/clothing/spacesuits/rig/modules/modules.dm index b0ba99016e..830e0d784c 100644 --- a/code/modules/clothing/spacesuits/rig/modules/modules.dm +++ b/code/modules/clothing/spacesuits/rig/modules/modules.dm @@ -147,6 +147,14 @@ usr << "The suit is not initialized." return 0 + if(usr.lying || usr.stat || usr.stunned || usr.paralysis) + usr << "You cannot use the suit in this state." + return 0 + + if(holder.wearer && holder.wearer.lying) + usr << "The suit cannot function while the wearer is prone." + return 0 + if(holder.security_check_enabled && !holder.check_suit_access(usr)) usr << "Access denied." return diff --git a/code/modules/clothing/spacesuits/rig/modules/ninja.dm b/code/modules/clothing/spacesuits/rig/modules/ninja.dm index 12ea8e7fb2..6d572cdcb3 100644 --- a/code/modules/clothing/spacesuits/rig/modules/ninja.dm +++ b/code/modules/clothing/spacesuits/rig/modules/ninja.dm @@ -19,6 +19,7 @@ use_power_cost = 5 active_power_cost = 1 passive_power_cost = 0 + module_cooldown = 30 activate_string = "Enable Cloak" deactivate_string = "Disable Cloak" diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index b308fda2b4..4c7735974c 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -251,13 +251,13 @@ else helmet.flags &= ~AIRTIGHT helmet.update_light(wearer) - + //sealed pieces become airtight, protecting against diseases if (!seal_target) piece.armor["bio"] = 100 else piece.armor["bio"] = src.armor["bio"] - + else failed_to_seal = 1 @@ -515,6 +515,8 @@ return if(href_list["toggle_piece"]) + if(ishuman(usr) && (usr.stat || usr.stunned || usr.lying)) + return 0 toggle_piece(href_list["toggle_piece"], usr) else if(href_list["toggle_seals"]) toggle_seals(usr) @@ -543,7 +545,7 @@ usr.set_machine(src) src.add_fingerprint(usr) - return + return 1 /obj/item/weapon/rig/proc/notify_ai(var/message) if(!message || !installed_modules || !installed_modules.len) @@ -579,6 +581,9 @@ if(!istype(wearer) || !wearer.back == src) return + if(usr == wearer && (usr.stat||usr.paralysis||usr.stunned)) // If the usr isn't wearing the suit it's probably an AI. + return + var/obj/item/check_slot var/equip_to var/obj/item/use_obj diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm index 061973c137..c0d119b0b4 100644 --- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm +++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm @@ -180,7 +180,7 @@ installed_modules -= removed update_icon() - return + return // If we've gotten this far, all we have left to do before we pass off to root procs // is check if any of the loaded modules want to use the item we've been given. diff --git a/code/modules/clothing/spacesuits/rig/rig_verbs.dm b/code/modules/clothing/spacesuits/rig/rig_verbs.dm index 9ec6f03df7..ce20244734 100644 --- a/code/modules/clothing/spacesuits/rig/rig_verbs.dm +++ b/code/modules/clothing/spacesuits/rig/rig_verbs.dm @@ -120,8 +120,8 @@ /obj/item/weapon/rig/verb/toggle_seals_verb() - set name = "Toggle Seals" - set desc = "Activates or deactivates your rig seals." + set name = "Toggle Hardsuit" + set desc = "Activates or deactivates your rig." set category = "Hardsuit" set src = usr.contents @@ -208,6 +208,8 @@ var/obj/item/rig_module/module = input("Which module do you wish to select?") as null|anything in selectable if(!istype(module)) + selected_module = null + usr << "Primary system is now: deselected." return selected_module = module diff --git a/nano/templates/hardsuit.tmpl b/nano/templates/hardsuit.tmpl index a8d3e59ac7..b32bb621c8 100644 --- a/nano/templates/hardsuit.tmpl +++ b/nano/templates/hardsuit.tmpl @@ -78,12 +78,12 @@ Used In File(s): /code/modules/clothing/spacesuits/rig/rig.dm
{{if data.sealing == 1}} -
SEALING
+
PROCESSING
{{else}} {{if data.seals == 1}} -
OPEN
+
INACTIVE
{{else}} -
SEALED
+
ACTIVE
{{/if}} {{/if}}
From 01bd0875fec4841ce4f1b6c38fd591ec1f67332c Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 29 Jan 2015 11:08:22 +1030 Subject: [PATCH 2/4] Fixes #7973 --- code/game/machinery/autolathe.dm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 53b95c712c..7b44e443c4 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -21,10 +21,16 @@ var/datum/wires/autolathe/wires = null +/obj/machinery/autolathe/proc/update_recipe_list() + if(!machine_recipes) + machine_recipes = autolathe_recipes + /obj/machinery/autolathe/interact(mob/user as mob) + update_recipe_list() + if(..() || (disabled && !panel_open)) - user << "\red \The [src] is disabled!" + user << "\The [src] is disabled!" return if (shocked) @@ -97,7 +103,7 @@ return if (busy) - user << "\red \The [src] is busy. Please wait for completion of previous operation." + user << "\The [src] is busy. Please wait for completion of previous operation." return if(istype(O, /obj/item/weapon/screwdriver)) @@ -157,7 +163,7 @@ mass_per_sheet += eating.matter[material] if(!filltype) - user << "\red \The [src] is full. Please remove material from the autolathe in order to insert more." + user << "\The [src] is full. Please remove material from the autolathe in order to insert more." return else if(filltype == 1) user << "You fill \the [src] to capacity with \the [eating]." @@ -189,7 +195,7 @@ add_fingerprint(usr) if(busy) - usr << "\red The autolathe is busy. Please wait for completion of previous operation." + usr << "The autolathe is busy. Please wait for completion of previous operation." return if(href_list["change_category"]) @@ -262,11 +268,6 @@ component_parts += new /obj/item/weapon/stock_parts/console_screen(src) RefreshParts() - -/obj/machinery/autolathe/initialize() - ..() - machine_recipes = autolathe_recipes - //Updates overall lathe storage size. /obj/machinery/autolathe/RefreshParts() ..() From d0f76833d90d07cf0ef525c41f69fb7893253020 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 29 Jan 2015 11:09:25 +1030 Subject: [PATCH 3/4] Fixes #7976 --- code/modules/mob/holder.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index 81e8137f04..96eb6f11a3 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -40,8 +40,9 @@ /mob/living/var/holder_type /mob/living/proc/get_scooped(var/mob/living/carbon/grabber) - if(!holder_type) + if(!holder_type || buckled || pinned.len) return + var/obj/item/weapon/holder/H = new holder_type(loc) src.loc = H H.name = loc.name From b280cb6d42139cc2b2c0a844538c68410fdc6c75 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 29 Jan 2015 11:17:56 +1030 Subject: [PATCH 4/4] Fixes #7919 --- code/game/objects/items/bodybag.dm | 2 +- .../objects/structures/crates_lockers/closets.dm | 15 ++++++--------- code/modules/mob/living/carbon/alien/alien.dm | 1 + code/modules/mob/living/living_defines.dm | 3 ++- code/modules/mob/living/simple_animal/bees.dm | 1 + .../mob/living/simple_animal/constructs.dm | 2 ++ .../mob/living/simple_animal/friendly/cat.dm | 3 ++- .../mob/living/simple_animal/friendly/corgi.dm | 2 ++ .../mob/living/simple_animal/friendly/crab.dm | 1 + .../mob/living/simple_animal/friendly/lizard.dm | 3 ++- .../mob/living/simple_animal/friendly/mouse.dm | 1 + .../living/simple_animal/friendly/spiderbot.dm | 1 + 12 files changed, 22 insertions(+), 13 deletions(-) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index b1b46654bc..12267914d8 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -39,7 +39,7 @@ close_sound = 'sound/items/zip.ogg' var/item_path = /obj/item/bodybag density = 0 - storage_capacity = (mob_size * 2) - 1 + storage_capacity = (default_mob_size * 2) - 1 var/contains_body = 0 /obj/structure/closet/body_bag/attackby(W as obj, mob/user as mob) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 4aaae90a9a..2a5a331c25 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -21,7 +21,7 @@ var/store_items = 1 var/store_mobs = 1 - var/const/mob_size = 15 + var/const/default_mob_size = 15 /obj/structure/closet/initialize() if(!opened) // if closed, any item at the crate's loc is put in the contents @@ -121,20 +121,17 @@ /obj/structure/closet/proc/store_mobs(var/stored_units) var/added_units = 0 - for(var/mob/M in src.loc) - if(stored_units + added_units + mob_size > storage_capacity) - break - if(istype (M, /mob/dead/observer)) - continue + for(var/mob/living/M in src.loc) if(M.buckled || M.pinned.len) continue - + var/current_mob_size = (M.mob_size ? M.mob_size : default_mob_size) + if(stored_units + added_units + current_mob_size > storage_capacity) + break if(M.client) M.client.perspective = EYE_PERSPECTIVE M.client.eye = src - M.loc = src - added_units += mob_size + added_units += current_mob_size return added_units /obj/structure/closet/proc/toggle(mob/user as mob) diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 67a134ec9b..c9b3175eb8 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -7,6 +7,7 @@ pass_flags = PASSTABLE health = 100 maxHealth = 100 + mob_size = 4 var/adult_form var/dead_icon diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 3c1c8a935c..ecbc51db37 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -37,4 +37,5 @@ var/tod = null // Time of death var/update_slimes = 1 - var/silent = null //Can't talk. Value goes down every life proc. \ No newline at end of file + var/silent = null // Can't talk. Value goes down every life proc. + var/mob_size // Used by lockers. \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/bees.dm b/code/modules/mob/living/simple_animal/bees.dm index 5ee2e2b10a..3a5f2f17e5 100644 --- a/code/modules/mob/living/simple_animal/bees.dm +++ b/code/modules/mob/living/simple_animal/bees.dm @@ -4,6 +4,7 @@ icon = 'icons/obj/apiary_bees_etc.dmi' icon_state = "bees1" icon_dead = "bees1" + mob_size = 1 var/strength = 1 var/feral = 0 var/mut = 0 diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index 79295a9b5b..5e3e91b90f 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -129,6 +129,7 @@ melee_damage_lower = 30 melee_damage_upper = 30 attacktext = "smashed their armoured gauntlet into" + mob_size = 20 speed = 3 wall_smash = 1 attack_sound = 'sound/weapons/punch3.ogg' @@ -259,6 +260,7 @@ speed = 5 wall_smash = 1 attack_sound = 'sound/weapons/punch4.ogg' + mob_size = 20 var/energy = 0 var/max_energy = 1000 diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index c3d88300ca..7913d23d7e 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -22,6 +22,7 @@ minbodytemp = 223 //Below -50 Degrees Celcius maxbodytemp = 323 //Above 50 Degrees Celcius holder_type = /obj/item/weapon/holder/cat + mob_size = 5 /mob/living/simple_animal/cat/Life() //MICE! @@ -50,7 +51,7 @@ if(turns_since_scan > 5) walk_to(src,0) turns_since_scan = 0 - + if((movement_target) && !(isturf(movement_target.loc) || ishuman(movement_target.loc) )) movement_target = null stop_automated_movement = 0 diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 162038dd07..8cce2342df 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -18,6 +18,8 @@ response_disarm = "bops" response_harm = "kicks" see_in_dark = 5 + mob_size = 8 + var/obj/item/inventory_head var/obj/item/inventory_back var/facehugger diff --git a/code/modules/mob/living/simple_animal/friendly/crab.dm b/code/modules/mob/living/simple_animal/friendly/crab.dm index c85f5bc734..bf59a7e546 100644 --- a/code/modules/mob/living/simple_animal/friendly/crab.dm +++ b/code/modules/mob/living/simple_animal/friendly/crab.dm @@ -17,6 +17,7 @@ response_harm = "stomps" stop_automated_movement = 1 friendly = "pinches" + mob_size = 5 var/obj/item/inventory_head var/obj/item/inventory_mask diff --git a/code/modules/mob/living/simple_animal/friendly/lizard.dm b/code/modules/mob/living/simple_animal/friendly/lizard.dm index d4677ef5d3..66fb31406a 100644 --- a/code/modules/mob/living/simple_animal/friendly/lizard.dm +++ b/code/modules/mob/living/simple_animal/friendly/lizard.dm @@ -14,4 +14,5 @@ melee_damage_upper = 2 response_help = "pets" response_disarm = "shoos" - response_harm = "stomps on" \ No newline at end of file + response_harm = "stomps on" + mob_size = 1 diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index c6f3cfb87c..5b207ce2a7 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -28,6 +28,7 @@ maxbodytemp = 323 //Above 50 Degrees Celcius universal_speak = 0 universal_understand = 1 + mob_size = 1 /mob/living/simple_animal/mouse/Life() ..() diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 1aff173aa7..89cfe60b65 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -5,6 +5,7 @@ max_co2 = 0 minbodytemp = 0 maxbodytemp = 500 + mob_size = 5 var/obj/item/device/radio/borg/radio = null var/mob/living/silicon/ai/connected_ai = null