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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Carbon ERTs #1890

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 55 additions & 29 deletions code/modules/admin/verbs/ert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +25,70 @@


/datum/admins/proc/equipAntagOnDummy(mob/living/carbon/human/dummy/mannequin, datum/antagonist/antag)
// MONKESTATION EDIT
// Non carbon mobs dont got clothes
if(!istype(mannequin))
return

for(var/I in mannequin.get_equipped_items(TRUE))
qdel(I)
if (ispath(antag, /datum/antagonist/ert))
var/datum/antagonist/ert/ert = antag
mannequin.equipOutfit(initial(ert.outfit), TRUE)

// MONKESTATION EDIT - Allows non-carbons to still get displayed in the preview.
/datum/admins/proc/makeERTPreviewIcon(list/settings)
// Set up the dummy for its photoshoot
var/mob/living/carbon/human/dummy/mannequin = generate_or_wait_for_human_dummy(DUMMY_HUMAN_SLOT_ADMIN)

var/prefs = settings["mainsettings"]
var/datum/ert/template = prefs["template"]["value"]
if (isnull(template))
return null
if (!ispath(template))
template = text2path(prefs["template"]["value"]) // new text2path ... doesn't compile in 511


template = new template
var/datum/antagonist/ert/ert = template.leader_role

equipAntagOnDummy(mannequin, ert)

CHECK_TICK
var/icon/preview_icon = icon('icons/effects/effects.dmi', "nothing")

preview_icon.Scale(48+32, 16+32)
CHECK_TICK
mannequin.setDir(NORTH)
var/icon/stamp = getFlatIcon(mannequin)
CHECK_TICK
preview_icon.Blend(stamp, ICON_OVERLAY, 25, 17)
CHECK_TICK
mannequin.setDir(WEST)
stamp = getFlatIcon(mannequin)
CHECK_TICK
preview_icon.Blend(stamp, ICON_OVERLAY, 1, 9)
CHECK_TICK
mannequin.setDir(SOUTH)
stamp = getFlatIcon(mannequin)
CHECK_TICK
preview_icon.Blend(stamp, ICON_OVERLAY, 49, 1)
CHECK_TICK

if(ispath(template.mobtype, /mob/living/carbon))
// Set up the dummy for its photoshoot
var/mob/living/carbon/mannequin = generate_or_wait_for_human_dummy(DUMMY_HUMAN_SLOT_ADMIN)

equipAntagOnDummy(mannequin, ert)

CHECK_TICK
mannequin.setDir(NORTH)
var/icon/stamp = getFlatIcon(mannequin)
CHECK_TICK
preview_icon.Blend(stamp, ICON_OVERLAY, 25, 17)
CHECK_TICK
mannequin.setDir(WEST)
stamp = getFlatIcon(mannequin)
CHECK_TICK
preview_icon.Blend(stamp, ICON_OVERLAY, 1, 9)
CHECK_TICK
mannequin.setDir(SOUTH)
stamp = getFlatIcon(mannequin)
CHECK_TICK
preview_icon.Blend(stamp, ICON_OVERLAY, 49, 1)
CHECK_TICK

unset_busy_human_dummy(DUMMY_HUMAN_SLOT_ADMIN)
else
var/mob/template_mobtype = template.mobtype
var/mob_icon = template_mobtype::icon
var/mob_icon_state = template_mobtype::icon_state

preview_icon.Blend(icon(mob_icon, mob_icon_state, NORTH), ICON_OVERLAY, 25, 17)
preview_icon.Blend(icon(mob_icon, mob_icon_state, WEST), ICON_OVERLAY, 1, 9)
preview_icon.Blend(icon(mob_icon, mob_icon_state, SOUTH), ICON_OVERLAY, 49, 1)

preview_icon.Scale(preview_icon.Width() * 2, preview_icon.Height() * 2) // Scaling here to prevent blurring in the browser.
CHECK_TICK
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_ADMIN)


return preview_icon

/datum/admins/proc/makeEmergencyresponseteam(datum/ert/ertemplate = null)
Expand Down Expand Up @@ -222,12 +242,18 @@
continue

//Spawn the body
var/mob/living/carbon/human/ert_operative = new ertemplate.mobtype(spawnloc)
chosen_candidate.client.prefs.safe_transfer_prefs_to(ert_operative, is_antag = TRUE)
ert_operative.key = chosen_candidate.key
var/mob/ert_operative = new ertemplate.mobtype(spawnloc)

// MONKESTATION EDIT - Non-Carbon compatibility.
if(iscarbon(ert_operative))
var/mob/living/carbon/ert_operative_carbon = ert_operative
chosen_candidate.client.prefs.safe_transfer_prefs_to(ert_operative_carbon, is_antag = TRUE)

if(ertemplate.enforce_human || !(ert_operative.dna.species.changesource_flags & ERT_SPAWN)) // Don't want any exploding plasmemes
ert_operative.set_species(/datum/species/human)
if(ertemplate.enforce_human || !(ert_operative_carbon.dna.species.changesource_flags & ERT_SPAWN)) // Don't want any exploding plasmemes
ert_operative_carbon.set_species(/datum/species/human)

ert_operative.key = chosen_candidate.key
// MONKESTATION EDIT END

//Give antag datum
var/datum/antagonist/ert/ert_antag
Expand Down
10 changes: 10 additions & 0 deletions monkestation/code/datums/ert/moff_inspectors.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/datum/ert/moff_inspectors
mobtype = /mob/living/basic/mothroach
roles = list(/datum/antagonist/ert/moff_inspector)
leader_role = /datum/antagonist/ert/moff_inspector
teamsize = 4
opendoors = FALSE
enforce_human = FALSE
rename_team = "Station Inspectors"
mission = "Central Command has sent you to run a surprise inspection, and ensure the station is up to code."
polldesc = "a team of Mothroach Station Inspectors"
8 changes: 8 additions & 0 deletions monkestation/code/modules/antagonists/ert/moff_inspectors.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

/datum/antagonist/ert/moff_inspector
name = "Station Inspector"
role = "Station Inspector"

/datum/antagonist/ert/moff_inspector/New()
. = ..()
name_source = GLOB.moth_last
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5712,6 +5712,7 @@
#include "monkestation\code\datums\diseases\advance\symptoms\clockwork.dm"
#include "monkestation\code\datums\elements\area_locked.dm"
#include "monkestation\code\datums\elements\uncompressed_storage.dm"
#include "monkestation\code\datums\ert\moff_inspectors.dm"
#include "monkestation\code\datums\keybinding\carbon.dm"
#include "monkestation\code\datums\keybinding\communication.dm"
#include "monkestation\code\datums\keybinding\living.dm"
Expand Down Expand Up @@ -5975,6 +5976,7 @@
#include "monkestation\code\modules\antagonists\contractor\items\modsuit\modsuit.dm"
#include "monkestation\code\modules\antagonists\contractor\items\modsuit\modules.dm"
#include "monkestation\code\modules\antagonists\contractor\items\modsuit\theme.dm"
#include "monkestation\code\modules\antagonists\ert\moff_inspectors.dm"
#include "monkestation\code\modules\antagonists\florida_man\__outfits.dm"
#include "monkestation\code\modules\antagonists\florida_man\_defines.dm"
#include "monkestation\code\modules\antagonists\florida_man\_florida_man.dm"
Expand Down
Loading