From cad9b59c25362b876a6586d68a2257da04acccb2 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Mon, 8 Jun 2015 09:10:33 +0200 Subject: [PATCH 1/5] AI restrictions and rejuvenation. Ensures the AI cannot use Topics() while unpowered. Ensures the AI is properly rejuvenated by the AI verb, as a functional AI will now never be lying down. --- code/modules/mob/living/silicon/ai/ai.dm | 12 ++++++++---- code/modules/mob/living/silicon/ai/life.dm | 7 ++++--- code/modules/nano/interaction/base.dm | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 9c874f54b17..ac626586ce9 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -678,16 +678,20 @@ var/list/ai_verbs_default = list( set desc = "Augment visual feed with internal sensor overlays" toggle_sensor_mode() -/mob/living/silicon/ai/proc/check_unable(var/flags = 0) +/mob/living/silicon/ai/proc/check_unable(var/flags = 0, var/feedback = 1) if(stat == DEAD) - src << "You are dead!" + if(feedback) src << "You are dead!" + return 1 + + if(aiRestorePowerRoutine) + if(feedback) src << "You lack power!" return 1 if((flags & AI_CHECK_WIRELESS) && src.control_disabled) - src << "Wireless control is disabled!" + if(feedback) src << "Wireless control is disabled!" return 1 if((flags & AI_CHECK_RADIO) && src.aiRadio.disabledAi) - src << "System Error - Transceiver Disabled!" + if(feedback) src << "System Error - Transceiver Disabled!" return 1 return 0 diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 5e0b0589c53..ed8c650f7a9 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -1,5 +1,5 @@ /mob/living/silicon/ai/Life() - if (src.stat == 2) + if (src.stat == DEAD) return else //I'm not removing that shitton of tabs, unneeded as they are. -- Urist //Being dead doesn't mean your temperature never changes @@ -33,8 +33,8 @@ aiRestorePowerRoutine = 0 // Necessary if AI activated it's APU AFTER losing primary power. adjustOxyLoss(-1) - // Handle EMP-stun - handle_stunned() + handle_stunned() // Handle EMP-stun + lying = 0 // Handle lying down malf_process() @@ -176,3 +176,4 @@ /mob/living/silicon/ai/rejuvenate() ..() add_ai_verbs(src) + diff --git a/code/modules/nano/interaction/base.dm b/code/modules/nano/interaction/base.dm index 10cda75162e..602185bb8ab 100644 --- a/code/modules/nano/interaction/base.dm +++ b/code/modules/nano/interaction/base.dm @@ -21,7 +21,7 @@ /mob/living/silicon/ai/shared_nano_interaction() if(lacks_power()) return STATUS_CLOSE - if (check_unable(1)) + if (check_unable(1, 0)) return STATUS_CLOSE return ..() From f2f34b9a3898959894e3637bd29d91d34f30821c Mon Sep 17 00:00:00 2001 From: Techhead0 Date: Mon, 8 Jun 2015 04:43:01 -0400 Subject: [PATCH 2/5] Minor tweaks to voidsuits. Component removal uses a dialogue box instead of removing items in a set order. Renames "Eject Tank" to avoid duplicate verb names. Changes order of components when equipping voidsuits. Two user message changes. --- code/modules/clothing/spacesuits/void/void.dm | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 246f37c0e44..aef27243492 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -83,6 +83,10 @@ if(H.wear_suit != src) return + if(boots) + if (H.equip_to_slot_if_possible(boots, slot_shoes)) + boots.canremove = 0 + if(helmet) if(H.head) M << "You are unable to deploy your suit's helmet as \the [H.head] is in the way." @@ -90,10 +94,6 @@ M << "Your suit's helmet deploys with a hiss." helmet.canremove = 0 - if(boots) - if (H.equip_to_slot_if_possible(boots, slot_shoes)) - boots.canremove = 0 - if(tank) if(H.s_store) //In case someone finds a way. M << "Alarmingly, the valve on your suit's installed tank fails to engage." @@ -101,6 +101,7 @@ M << "The valve on your suit's installed tank safely engages." tank.canremove = 0 + /obj/item/clothing/suit/space/void/dropped() ..() @@ -151,7 +152,7 @@ helmet.loc = src else if(H.head) - H << "You cannot deploy your helmet while wearing another helmet." + H << "You cannot deploy your helmet while wearing \the [H.head]." return if(H.equip_to_slot_if_possible(helmet, slot_head)) helmet.pickup(H) @@ -161,7 +162,7 @@ /obj/item/clothing/suit/space/void/verb/eject_tank() - set name = "Eject Tank" + set name = "Eject Voidsuit Tank" set category = "Object" set src in usr @@ -187,22 +188,26 @@ if(!istype(user,/mob/living)) return if(istype(src.loc,/mob/living)) - user << "How do you propose to modify a hardsuit while it is being worn?" + user << "How do you propose to modify a voidsuit while it is being worn?" return if(istype(W,/obj/item/weapon/screwdriver)) - if(tank) - user << "You pop \the [tank] out of \the [src]'s storage compartment." - tank.loc = get_turf(src) - src.tank = null - else if(helmet) - user << "You detatch \the [helmet] from \the [src]'s helmet mount." - helmet.loc = get_turf(src) - src.helmet = null - else if (boots) - user << "You detatch \the [boots] from \the [src]'s boot mounts." - boots.loc = get_turf(src) - src.boots = null + if(helmet || boots || tank) + var/choice = input("What component would you like to remove?") as null|anything in list(helmet,boots,tank) + if(!choice) return + + if(choice == tank) //No, a switch doesn't work here. Sorry. ~Techhead + user << "You pop \the [tank] out of \the [src]'s storage compartment." + tank.loc = get_turf(src) + src.tank = null + else if(choice == helmet) + user << "You detatch \the [helmet] from \the [src]'s helmet mount." + helmet.loc = get_turf(src) + src.helmet = null + else if(choice == boots) + user << "You detatch \the [boots] from \the [src]'s boot mounts." + boots.loc = get_turf(src) + src.boots = null else user << "\The [src] does not have anything installed." return From 37f02ebc933cf6df47412928e974cff0c16927d7 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Mon, 8 Jun 2015 12:41:58 +0300 Subject: [PATCH 3/5] Fixes #9738 - reagents always overdose --- code/modules/reagents/Chemistry-Reagents.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 0e0da75e2a6..f222b4b6b3b 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -38,7 +38,7 @@ return if(!affects_dead && M.stat == DEAD) return - if(overdose && (location == CHEM_BLOOD)) + if(overdose && (dose > overdose) && (location == CHEM_BLOOD)) overdose(M, alien) var/removed = metabolism if(ingest_met && (location == CHEM_INGEST)) From 13cb32fa7fa85743387af7daf4c9af7813c6e175 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Mon, 8 Jun 2015 17:37:56 +0200 Subject: [PATCH 4/5] Another MayRespawn() fix. Being unable to reenter your body now allows you to respawn, even if your body lives. --- code/modules/mob/dead/observer/observer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index f65b07b2c79..c7dea3bb9d1 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -622,7 +622,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp mob/dead/observer/MayRespawn(var/feedback = 0) if(!client) return 0 - if(mind && mind.current && mind.current.stat != DEAD) + if(mind && mind.current && mind.current.stat != DEAD && can_reenter_corpse) if(feedback) src << "Your non-dead body prevent you from respawning." return 0 From ec68454f63f255722c24d87cae9ea81105e9eacf Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 9 Jun 2015 08:47:53 +0200 Subject: [PATCH 5/5] Fixes #9753. Being admin jumped or jumping to another location now cancels ghost tracking. Also adds proper permission checks. --- code/modules/admin/verbs/adminjump.dm | 32 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index ab9e8c1cd36..1ff9a1d1cc6 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -1,12 +1,19 @@ +/mob/proc/on_mob_jump() + return + +/mob/dead/observer/on_mob_jump() + following = null + /client/proc/Jump(var/area/A in return_sorted_areas()) set name = "Jump to Area" set desc = "Area to jump to" set category = "Admin" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return if(config.allow_admin_jump) + usr.on_mob_jump() usr.loc = pick(get_area_turfs(A)) log_admin("[key_name(usr)] jumped to [A]") @@ -18,12 +25,13 @@ /client/proc/jumptoturf(var/turf/T in world) set name = "Jump to Turf" set category = "Admin" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return if(config.allow_admin_jump) log_admin("[key_name(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]") message_admins("[key_name_admin(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]", 1) + usr.on_mob_jump() usr.loc = T feedback_add_details("admin_verb","JT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else @@ -34,7 +42,7 @@ set category = "Admin" set name = "Jump to Mob" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return @@ -46,6 +54,7 @@ var/turf/T = get_turf(M) if(T && isturf(T)) feedback_add_details("admin_verb","JM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + A.on_mob_jump() A.loc = T else A << "This mob is not located in the game world." @@ -56,13 +65,14 @@ set category = "Admin" set name = "Jump to Coordinate" - if (!holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return if (config.allow_admin_jump) if(src.mob) var/mob/A = src.mob + A.on_mob_jump() A.x = tx A.y = ty A.z = tz @@ -76,7 +86,7 @@ set category = "Admin" set name = "Jump to Key" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return @@ -91,6 +101,7 @@ var/mob/M = selection:mob log_admin("[key_name(usr)] jumped to [key_name(M)]") message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1) + usr.on_mob_jump() usr.loc = M.loc feedback_add_details("admin_verb","JK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else @@ -100,12 +111,13 @@ set category = "Admin" set name = "Get Mob" set desc = "Mob to teleport" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return if(config.allow_admin_jump) log_admin("[key_name(usr)] teleported [key_name(M)]") message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)]", 1) + M.on_mob_jump() M.loc = get_turf(usr) feedback_add_details("admin_verb","GM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else @@ -116,7 +128,7 @@ set name = "Get Key" set desc = "Key to teleport" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return @@ -134,6 +146,7 @@ log_admin("[key_name(usr)] teleported [key_name(M)]") message_admins("[key_name_admin(usr)] teleported [key_name(M)]", 1) if(M) + M.on_mob_jump() M.loc = get_turf(usr) feedback_add_details("admin_verb","GK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else @@ -142,16 +155,17 @@ /client/proc/sendmob(var/mob/M in sortmobs()) set category = "Admin" set name = "Send Mob" - if(!src.holder) + if(!check_rights(R_ADMIN, user = src)) src << "Only administrators may use this command." return var/area/A = input(usr, "Pick an area.", "Pick an area") in return_sorted_areas() if(A) if(config.allow_admin_jump) + M.on_mob_jump() M.loc = pick(get_area_turfs(A)) feedback_add_details("admin_verb","SMOB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] teleported [key_name(M)] to [A]") message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]", 1) else - alert("Admin jumping disabled") \ No newline at end of file + alert("Admin jumping disabled")