Skip to content

Commit

Permalink
[MIRROR] Fixes some bitrunning related issues [no gbp] (#2473) (#3311)
Browse files Browse the repository at this point in the history
* Fixes some bitrunning related issues [no gbp] (#83184)

## About The Pull Request
Properly allows bitrunning antagonists to come station side

A few issues were resolved:
- Event title was too lengthy, it's been renamed
- IDs were not being named properly for cyber police. Cybertac would
appear as "unknown"
- Runtime at examining cyber police ID because it had an erroneous
account
- Teleporting station side would delete your organs and leave you a
broken husk of a mob
## Why It's Good For The Game
Fixes #83181
## Changelog
:cl:
fix: Bitrunning antagonists no longer gib on teleport
fix: Cyber tac now have a visible name / ID
fix: Renamed the bitrunning malfunction event to just "Malfunction: x"
/:cl:

---------



* Fixes some bitrunning related issues [no gbp]

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: Jeremiah <[email protected]>
Co-authored-by: Time-Green <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
  • Loading branch information
5 people authored May 15, 2024
1 parent 685064c commit 8790e02
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 11 deletions.
30 changes: 25 additions & 5 deletions code/modules/bitrunning/antagonists/_parent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,33 @@

return TRUE


/// Sets up the agent so that they look like cyber police && don't have an account ID
/datum/antagonist/bitrunning_glitch/proc/convert_agent(mob/living/carbon/human/player, datum/outfit/agent_outfit)
/datum/antagonist/bitrunning_glitch/proc/convert_agent()
if(!ishuman(owner.current))
return

var/mob/living/carbon/human/player = owner.current

player.set_service_style()
player.equipOutfit(agent_outfit)
player.equipOutfit(preview_outfit)
player.fully_replace_character_name(player.name, pick(GLOB.cyberauth_names))
fix_agent_id()


/// Resets the agent's ID and name. Needed so this doesn't show as "unknown"
/datum/antagonist/bitrunning_glitch/proc/fix_agent_id()
if(!ishuman(owner.current))
return

var/mob/living/carbon/human/player = owner.current

var/obj/item/card/id/outfit_id = player.wear_id
if(outfit_id)
outfit_id.registered_account = new()
outfit_id.registered_account.replaceable = FALSE
if(isnull(outfit_id))
return

outfit_id.registered_account = new()
outfit_id.registered_account.replaceable = FALSE
outfit_id.registered_account.account_id = null
outfit_id.registered_name = player.name
outfit_id.update_label()
5 changes: 2 additions & 3 deletions code/modules/bitrunning/antagonists/cyber_police.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
stack_trace("humans only for this position")
return

var/mob/living/player = owner.current
convert_agent(player, /datum/outfit/cyber_police)
convert_agent()

var/datum/martial_art/the_sleeping_carp/carp = new()
carp.teach(player)
carp.teach(owner.current)

/datum/outfit/cyber_police
name = ROLE_CYBER_POLICE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/bitrunning/antagonists/cyber_tac.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
stack_trace("humans only for this position")
return

convert_agent(owner.current, /datum/outfit/cyber_police/tactical)
convert_agent()

/datum/outfit/cyber_police/tactical
name = ROLE_CYBER_TAC
Expand Down
2 changes: 1 addition & 1 deletion code/modules/bitrunning/server/threats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
checked_target = mutation_target,
ignore_category = POLL_IGNORE_GLITCH,
alert_pic = mutation_target,
role_name_text = "Bitrunning Malfunction: [role_name]",
role_name_text = "Malfunction: [role_name]",
)
spawn_glitch(chosen_role, mutation_target, chosen_one)
return mutation_target
Expand Down
6 changes: 5 additions & 1 deletion code/modules/bitrunning/server/util.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@

return initial(selected.key)


/// Removes all blacklisted items from a mob and returns them to base state
/obj/machinery/quantum_server/proc/reset_equipment(mob/living/carbon/human/person)
for(var/item in person.get_contents())
for(var/obj/item in person.get_equipped_items(include_pockets = TRUE, include_accessories = TRUE))
qdel(item)

var/datum/antagonist/bitrunning_glitch/antag_datum = locate() in person.mind?.antag_datums
Expand All @@ -74,6 +75,9 @@

person.equipOutfit(antag_datum.preview_outfit)

antag_datum.fix_agent_id()


/// Severs any connected users
/obj/machinery/quantum_server/proc/sever_connections()
if(isnull(generated_domain) || !length(avatar_connection_refs))
Expand Down

0 comments on commit 8790e02

Please sign in to comment.