|
| 1 | +/// Maximum amount of random ion laws to give teratoma silicons. |
| 2 | +#define MAX_TERATOMA_ION_LAWS 3 |
| 3 | +/// Minimum time between law corruptions, if the teratoma is borged/AI'd. |
| 4 | +#define LAW_CORRUPTION_COOLDOWN_MIN (1.5 MINUTES) |
| 5 | +/// Maximum time between law corruptions, if the teratoma is borged/AI'd. |
| 6 | +#define LAW_CORRUPTION_COOLDOWN_MAX (7.5 MINUTES) |
| 7 | + |
1 | 8 | /datum/team/teratoma
|
2 | 9 | name = "Teratomas"
|
3 | 10 | member_name = "teratoma"
|
|
7 | 14 | show_in_antagpanel = TRUE
|
8 | 15 | antagpanel_category = ANTAG_GROUP_ABOMINATIONS
|
9 | 16 | show_to_ghosts = TRUE
|
| 17 | + suicide_cry = "FOR CHAOS!!" |
| 18 | + preview_outfit = /datum/outfit/teratoma |
| 19 | + /// The teratoma team. Used solely to combine all teratomas on the roundend report. |
10 | 20 | var/datum/team/teratoma/team
|
| 21 | + /// Cooldown for corrupting silicon laws, if someone makes the mistake of turning a teratoma into a borg or AI. |
| 22 | + COOLDOWN_DECLARE(corrupt_laws_cooldown) |
11 | 23 |
|
12 | 24 | /datum/antagonist/teratoma/on_gain()
|
13 | 25 | . = ..()
|
14 |
| - ADD_TRAIT(owner, TRAIT_UNCONVERTABLE, REF(src)) |
| 26 | + owner.special_role = ROLE_TERATOMA |
| 27 | + ADD_TRAIT(owner, TRAIT_UNCONVERTABLE, type) |
15 | 28 |
|
16 | 29 | /datum/antagonist/teratoma/on_removal()
|
17 |
| - REMOVE_TRAIT(owner, TRAIT_UNCONVERTABLE, REF(src)) |
| 30 | + STOP_PROCESSING(SSprocessing, src) |
| 31 | + REMOVE_TRAIT(owner, TRAIT_UNCONVERTABLE, type) |
| 32 | + owner.special_role = null |
18 | 33 | return ..()
|
19 | 34 |
|
| 35 | +/datum/antagonist/teratoma/apply_innate_effects(mob/living/mob_override) |
| 36 | + . = ..() |
| 37 | + var/mob/living/our_mob = mob_override || owner.current |
| 38 | + ADD_TRAIT(our_mob, TRAIT_EVIL, type) |
| 39 | + if(issilicon(our_mob)) |
| 40 | + corrupt_silicon_laws(our_mob) |
| 41 | + START_PROCESSING(SSprocessing, src) |
| 42 | + else |
| 43 | + STOP_PROCESSING(SSprocessing, src) |
| 44 | + if(istype(owner.current?.loc, /obj/item/mmi)) |
| 45 | + RegisterSignal(our_mob.loc, COMSIG_ATOM_EXAMINE, PROC_REF(on_mmi_examine)) |
| 46 | + |
| 47 | +/datum/antagonist/teratoma/remove_innate_effects(mob/living/mob_override) |
| 48 | + . = ..() |
| 49 | + var/mob/living/our_mob = mob_override || owner.current |
| 50 | + REMOVE_TRAIT(our_mob, TRAIT_EVIL, type) |
| 51 | + UnregisterSignal(our_mob.loc, COMSIG_ATOM_EXAMINE) |
| 52 | + |
| 53 | +/datum/antagonist/teratoma/proc/on_mmi_examine(datum/source, mob/user, list/examine_text) |
| 54 | + SIGNAL_HANDLER |
| 55 | + if(!istype(owner.current?.loc, /obj/item/mmi) || source != owner.current.loc) |
| 56 | + UnregisterSignal(source, COMSIG_ATOM_EXAMINE) // we got moved out of the MMI, just unregister the signal |
| 57 | + return |
| 58 | + . += span_warning("There is a small red warning light blinking on it.") |
| 59 | + |
| 60 | +/datum/antagonist/teratoma/process(seconds_per_tick) |
| 61 | + if(QDELETED(src) || QDELETED(owner?.current)) |
| 62 | + return PROCESS_KILL |
| 63 | + corrupt_silicon_laws() |
| 64 | + |
| 65 | +/datum/antagonist/teratoma/proc/corrupt_silicon_laws(mob/living/silicon/robotoma) |
| 66 | + if(!COOLDOWN_FINISHED(src, corrupt_laws_cooldown)) |
| 67 | + return |
| 68 | + robotoma ||= owner.current |
| 69 | + if(!issilicon(robotoma) || QDELING(robotoma)) |
| 70 | + return |
| 71 | + if(iscyborg(robotoma)) |
| 72 | + var/mob/living/silicon/robot/borgtoma = robotoma |
| 73 | + borgtoma.scrambledcodes = TRUE |
| 74 | + if(!borgtoma.shell) |
| 75 | + borgtoma.lawupdate = FALSE |
| 76 | + borgtoma.set_connected_ai(null) |
| 77 | + robotoma.clear_inherent_laws(announce = FALSE) |
| 78 | + robotoma.clear_supplied_laws(announce = FALSE) |
| 79 | + robotoma.clear_ion_laws(announce = FALSE) |
| 80 | + robotoma.clear_hacked_laws(announce = FALSE) |
| 81 | + robotoma.clear_zeroth_law(force = FALSE, announce = FALSE) |
| 82 | + for(var/i = 1 to rand(1, MAX_TERATOMA_ION_LAWS)) |
| 83 | + robotoma.add_ion_law(generate_ion_law(), announce = FALSE) |
| 84 | + robotoma.post_lawchange(announce = TRUE) // NOW show them the message |
| 85 | + COOLDOWN_START(src, corrupt_laws_cooldown, rand(LAW_CORRUPTION_COOLDOWN_MIN, LAW_CORRUPTION_COOLDOWN_MAX)) |
| 86 | + |
20 | 87 | /datum/antagonist/teratoma/greet()
|
21 | 88 | var/list/parts = list()
|
22 | 89 | parts += span_big("You are a living teratoma!")
|
23 | 90 | parts += span_changeling("By all means, you should not exist. <i>Your very existence is a sin against nature itself.</i>")
|
24 | 91 | parts += span_changeling("You are loyal to <b>nobody</b>, except the forces of chaos itself.")
|
25 | 92 | parts += span_info("You are able to easily vault tables and ventcrawl, however you cannot use many things like guns, batons, and you are also illiterate and quite fragile.")
|
26 | 93 | parts += span_hypnophrase("<span style='font-size: 125%'>Spread misery and chaos upon the station.</span>")
|
27 |
| - to_chat(owner.current, boxed_message(parts.Join("\n")), type = MESSAGE_TYPE_INFO) |
| 94 | + to_chat(owner.current, boxed_message(jointext(parts, "\n")), type = MESSAGE_TYPE_INFO) |
28 | 95 |
|
29 | 96 | /datum/antagonist/teratoma/can_be_owned(datum/mind/new_owner)
|
30 | 97 | if(!isteratoma(new_owner.current))
|
|
46 | 113 | /datum/antagonist/teratoma/get_team()
|
47 | 114 | return team
|
48 | 115 |
|
49 |
| -/datum/antagonist/teratoma/get_base_preview_icon() |
50 |
| - RETURN_TYPE(/icon) |
51 |
| - var/static/icon/teratoma_icon |
52 |
| - if(!teratoma_icon) |
53 |
| - var/mob/living/carbon/human/species/teratoma/teratoma = new |
54 |
| - teratoma.setDir(SOUTH) |
55 |
| - teratoma_icon = getFlatIcon(teratoma, no_anim = TRUE) |
56 |
| - QDEL_NULL(teratoma) |
57 |
| - return teratoma_icon |
58 |
| - |
59 | 116 | /datum/objective/teratoma
|
60 | 117 | name = "Spread misery and chaos"
|
61 | 118 | explanation_text = "Spread misery and chaos upon the station."
|
62 | 119 | completed = TRUE
|
| 120 | + |
| 121 | +/datum/outfit/teratoma |
| 122 | + name = "Teratoma (Preview only)" |
| 123 | + |
| 124 | +/datum/outfit/teratoma/post_equip(mob/living/carbon/human/human, visualsOnly) |
| 125 | + human.set_species(/datum/species/teratoma) |
| 126 | + |
| 127 | +#undef LAW_CORRUPTION_COOLDOWN_MAX |
| 128 | +#undef LAW_CORRUPTION_COOLDOWN_MIN |
| 129 | +#undef MAX_TERATOMA_ION_LAWS |
0 commit comments