Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malf AI overload blacklists #83226

Merged
merged 6 commits into from
May 17, 2024
Merged

Conversation

Sadboysuss
Copy link
Contributor

@Sadboysuss Sadboysuss commented May 14, 2024

About The Pull Request

adds more machines to the malf AI overload ability blacklist: shuttle consoles and gateway console
closes #83223

Why It's Good For The Game

bug fix

Changelog

馃啈
fix: fixed malf AI being able to overload shuttle consoles and the gateway control console
/:cl:

@tgstation-server tgstation-server added the Fix Rewrites a bug so it appears in different circumstances label May 14, 2024
@Helg2
Copy link
Contributor

Helg2 commented May 14, 2024

Shouldn't it just automatically return if the machine is indestructible?

@Sadboysuss
Copy link
Contributor Author

Shouldn't it just automatically return if the machine is indestructible?

well apparently it didn't

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Copy link
Member

@ShizCalev ShizCalev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it just automatically return if the machine is indestructible?

well apparently it didn't

it didn't because the abilities DON'T check for indestructible.

/datum/action/innate/ai/ranged/overload_machine/do_ability(mob/living/caller, atom/clicked_on)
if(caller.incapacitated())
unset_ranged_ability(caller)
return FALSE
if(!ismachinery(clicked_on))
to_chat(caller, span_warning("You can only overload machines!"))
return FALSE
var/obj/machinery/clicked_machine = clicked_on
if(is_type_in_typecache(clicked_machine, GLOB.blacklisted_malf_machines))
to_chat(caller, span_warning("You cannot overload that device!"))
return FALSE
caller.playsound_local(caller, SFX_SPARKS, 50, 0)
adjust_uses(-1)
if(uses)
desc = "[initial(desc)] It has [uses] use\s remaining."
build_all_button_icons()
clicked_machine.audible_message(span_userdanger("You hear a loud electrical buzzing sound coming from [clicked_machine]!"))
addtimer(CALLBACK(src, PROC_REF(detonate_machine), caller, clicked_machine), 5 SECONDS) //kaboom!
unset_ranged_ability(caller, span_danger("Overcharging machine..."))
return TRUE

/datum/action/innate/ai/ranged/override_machine/do_ability(mob/living/caller, atom/clicked_on)
if(caller.incapacitated())
unset_ranged_ability(caller)
return FALSE
if(!ismachinery(clicked_on))
to_chat(caller, span_warning("You can only animate machines!"))
return FALSE
var/obj/machinery/clicked_machine = clicked_on
if(!clicked_machine.can_be_overridden() || is_type_in_typecache(clicked_machine, GLOB.blacklisted_malf_machines))
to_chat(caller, span_warning("That machine can't be overridden!"))
return FALSE
caller.playsound_local(caller, 'sound/misc/interference.ogg', 50, FALSE, use_reverb = FALSE)
clicked_machine.audible_message(span_userdanger("You hear a loud electrical buzzing sound coming from [clicked_machine]!"))
addtimer(CALLBACK(src, PROC_REF(animate_machine), caller, clicked_machine), 5 SECONDS) //kabeep!
unset_ranged_ability(caller, span_danger("Sending override signal..."))
adjust_uses(-1) //adjust after we unset the active ability since we may run out of charges, thus deleting the ability
if(uses)
desc = "[initial(desc)] It has [uses] use\s remaining."
build_all_button_icons()
return TRUE

just need to change the typecache check in those two procs to check for the flag


	if((clicked_machine.resistance_flags & INDESTRUCTIBLE) || is_type_in_typecache(clicked_machine, GLOB.blacklisted_malf_machines))

@Sadboysuss Sadboysuss requested a review from ShizCalev May 17, 2024 08:49
@ZephyrTFA ZephyrTFA marked this pull request as draft May 17, 2024 09:03
@tgstation-server tgstation-server added the Merge Conflict Adding upstream files to your repo via drag and drop won't resolve conflicts label May 17, 2024
@tgstation-server tgstation-server removed the Merge Conflict Adding upstream files to your repo via drag and drop won't resolve conflicts label May 17, 2024
@Sadboysuss Sadboysuss marked this pull request as ready for review May 17, 2024 09:23
@Sadboysuss Sadboysuss requested a review from ZephyrTFA May 17, 2024 09:23
@ZephyrTFA ZephyrTFA enabled auto-merge (squash) May 17, 2024 09:28
@ZephyrTFA ZephyrTFA merged commit e81a94d into tgstation:master May 17, 2024
18 of 19 checks passed
github-actions bot added a commit that referenced this pull request May 17, 2024
comfyorange added a commit that referenced this pull request May 17, 2024
@Sadboysuss Sadboysuss deleted the malf-ai-fix branch May 17, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Rewrites a bug so it appears in different circumstances
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Malf AI's Machine Overload can delete Escape Shuttle Consoles, despite them being flagged as INDESTRUCTIBLE
6 participants