Skip to content

Commit

Permalink
Allows MODSuit AIs to count towards Steal AI Traitor Objective (tgsta…
Browse files Browse the repository at this point in the history
…tion#72902)

## About The Pull Request

On the tin. It was simpler than it looked, just had to genericize the
behavior a tad bit (the proc is not called unless the type in either
targetitem or altitems is matched in
`/datum/objective/steal/check_completion()`). I decided that since the
current framework restricts us to only having a set range of items that
we may as well be safe and check the var that references the "stored"
AI, which works well enough.
## Why It's Good For The Game


![image](https://user-images.githubusercontent.com/34697715/213986912-506c8f27-131f-43e1-ab57-63635b9ed852.png)

Very cool!

Fixes tgstation#72205. Almost certainly an oversight, because if you create an AI
that is lawed to obey you regardless of anything in order to serve as
your modsuit buddy... it's just a pain and completely un-intuitive to
have to pop it out of the modsuit just so you can get the epic
greentext.
## Changelog
:cl:
fix: After over a year of continuous research, the Syndicate have
finally managed to crack Nanotrasen's Protocol for transferring AIs from
an intelliCard into a MODsuit, and vice-versa in order to extract the
valuable AI in a method fit-for-sale. In short: The "Steal a Functional
AI" objective will work if the "captured" AI is in a MODsuit.
/:cl:
  • Loading branch information
san7890 committed Jan 24, 2023
1 parent 47f6583 commit 8c9970e
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions code/game/gamemodes/objective_items.dm
Expand Up @@ -279,10 +279,26 @@
targetitem = /obj/item/aicard
difficulty = 20 //beyond the impossible

/datum/objective_item/steal/functionalai/check_special_completion(obj/item/aicard/C)
for(var/mob/living/silicon/ai/A in C)
if(isAI(A) && A.stat != DEAD) //See if any AI's are alive inside that card.
return TRUE
/datum/objective_item/steal/functionalai/New()
. = ..()
altitems += typesof(/obj/item/mod/control) // only here so we can account for AIs tucked away in a MODsuit.

/datum/objective_item/steal/functionalai/check_special_completion(obj/item/potential_storage)
var/mob/living/silicon/ai/being

if(istype(potential_storage, /obj/item/aicard))
var/obj/item/aicard/card = potential_storage
being = card.AI // why is this one capitalized and the other one not? i wish i knew.
else if(istype(potential_storage, /obj/item/mod/control))
var/obj/item/mod/control/suit = potential_storage
being = suit.ai
else
stack_trace("check_special_completion() called on [src] with [potential_storage] ([potential_storage.type])! That's not supposed to happen!")
return FALSE

if(isAI(being) && being.stat != DEAD)
return TRUE

return FALSE

/datum/objective_item/steal/blueprints
Expand Down

0 comments on commit 8c9970e

Please sign in to comment.