From c46cd7835b7992a598ba8b6c890bc262cdc8d0ea Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Sun, 20 May 2018 15:48:29 -0400 Subject: [PATCH] Datumizes Wishgranter --- code/__DEFINES/machines.dm | 5 ++ code/datums/mind.dm | 16 ++-- code/game/machinery/wishgranter.dm | 72 ++++++----------- .../antagonists/_common}/antag_datum.dm | 0 .../antagonists/_common}/antag_helpers.dm | 0 .../antagonists/_common}/antag_hud.dm | 0 .../antagonists/_common}/antag_spawner.dm | 0 .../antagonists/_common}/antag_team.dm | 0 .../antagonists/wishgranter/wishgranter.dm | 81 +++++++++++++++++++ paradise.dme | 11 +-- 10 files changed, 128 insertions(+), 57 deletions(-) rename code/{datums/antagonists => modules/antagonists/_common}/antag_datum.dm (100%) rename code/{datums/antagonists => modules/antagonists/_common}/antag_helpers.dm (100%) rename code/{datums/antagonists => modules/antagonists/_common}/antag_hud.dm (100%) rename code/{datums/antagonists => modules/antagonists/_common}/antag_spawner.dm (100%) rename code/{datums/antagonists => modules/antagonists/_common}/antag_team.dm (100%) create mode 100644 code/modules/antagonists/wishgranter/wishgranter.dm diff --git a/code/__DEFINES/machines.dm b/code/__DEFINES/machines.dm index 160fa30a5c6..5b38b592ac6 100644 --- a/code/__DEFINES/machines.dm +++ b/code/__DEFINES/machines.dm @@ -7,6 +7,11 @@ #define STATIC_LIGHT 6 #define STATIC_ENVIRON 7 +//Power use +#define NO_POWER_USE 0 +#define IDLE_POWER_USE 1 +#define ACTIVE_POWER_USE 2 + //computer3 error codes, move lower in the file when it passes dev -Sayu #define PROG_CRASH 1 // Generic crash #define MISSING_PERIPHERAL 2 // Missing hardware diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 08bd6252d99..e9663f8d9c0 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1217,12 +1217,8 @@ message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] an uplink") else if(href_list["obj_announce"]) - var/obj_count = 1 - to_chat(current, "
Your current objectives:") - for(var/datum/objective/objective in objectives) - to_chat(current, "Objective #[obj_count]: [objective.explanation_text]") - obj_count++ - current << 'sound/ambience/alarm4.ogg' + announce_objectives() + SEND_SOUND(current, sound('sound/ambience/alarm4.ogg')) log_admin("[key_name(usr)] has announced [key_name(current)]'s objectives") message_admins("[key_name_admin(usr)] has announced [key_name_admin(current)]'s objectives") @@ -1282,6 +1278,14 @@ else if(A.type == datum_type) return A +/datum/mind/proc/announce_objectives() + var/obj_count = 1 + to_chat(current, "Your current objectives:") + for(var/objective in objectives) + var/datum/objective/O = objective + to_chat(current, "Objective #[obj_count]: [O.explanation_text]") + obj_count++ + /datum/mind/proc/find_syndicate_uplink() var/list/L = current.get_contents() for(var/obj/item/I in L) diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm index 217b1e70165..248514179af 100644 --- a/code/game/machinery/wishgranter.dm +++ b/code/game/machinery/wishgranter.dm @@ -1,62 +1,42 @@ /obj/machinery/wish_granter - name = "Wish Granter" + name = "wish granter" desc = "You're not so sure about this, anymore..." icon = 'icons/obj/device.dmi' icon_state = "syndbeacon" - use_power = 0 - anchored = 1 - density = 1 - var/datum/mind/target - var/list/types = list() - var/inuse = 0 + use_power = NO_POWER_USE + anchored = TRUE + density = TRUE -/obj/machinery/wish_granter/New() - for(var/supname in all_superheroes) - types |= supname - ..() + var/charges = 1 + var/insisting = FALSE -/obj/machinery/wish_granter/attack_hand(var/mob/user as mob) - usr.set_machine(src) +/obj/machinery/wish_granter/attack_hand(mob/living/carbon/user) + . = ..() + if(.) + return + if(charges <= 0) + to_chat(user, "The Wish Granter lies silent.") + return - if(!istype(user, /mob/living/carbon/human)) + else if(!ishuman(user)) to_chat(user, "You feel a dark stirring inside of the Wish Granter, something you want nothing of. Your instincts are better than any man's.") return - if(is_special_character(user)) + else if(is_special_character(user)) to_chat(user, "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away.") - return - if(inuse) - to_chat(user, "Someone is already communing with the Wish Granter.") - return + else if(!insisting) + to_chat(user, "Your first touch makes the Wish Granter stir, listening to you. Are you really sure you want to do this?") + insisting = TRUE - to_chat(user, "The power of the Wish Granter have turned you into the superhero the station deserves. You are a masked vigilante, and answer to no man. Will you use your newfound strength to protect the innocent, or will you hunt the guilty?") - - inuse = 1 - var/wish - if(types.len == 1) - wish = pick(types) else - wish = input("You want to become...","Wish") as null|anything in types - if(!wish) - inuse=0 - return - types -= wish - var/mob/living/carbon/human/M = user - var/datum/superheroes/S = all_superheroes[wish] - if(S) - S.create(M) - inuse=0 + to_chat(user, "You speak. [pick("I want the station to disappear", "Humanity is corrupt, mankind must be destroyed", "I want to be rich", "I want to rule the world", "I want immortality.")]. The Wish Granter answers.") + to_chat(user, "Your head pounds for a moment, before your vision clears. You are the avatar of the Wish Granter, and your power is LIMITLESS! And it's all yours. You need to make sure no one can take it from you. No one can know, first.") - //Remove the wishgranter or teleport it randomly on the station - if(!types.len) - to_chat(user, "The wishgranter slowly fades into mist...") - qdel(src) - return - else - var/impact_area = findEventArea() - var/turf/T = pick(get_area_turfs(impact_area)) - if(T) - src.loc = T - return \ No newline at end of file + charges-- + insisting = FALSE + + user.mind.add_antag_datum(/datum/antagonist/wishgranter) + + to_chat(user, "You have a very bad feeling about this.") \ No newline at end of file diff --git a/code/datums/antagonists/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm similarity index 100% rename from code/datums/antagonists/antag_datum.dm rename to code/modules/antagonists/_common/antag_datum.dm diff --git a/code/datums/antagonists/antag_helpers.dm b/code/modules/antagonists/_common/antag_helpers.dm similarity index 100% rename from code/datums/antagonists/antag_helpers.dm rename to code/modules/antagonists/_common/antag_helpers.dm diff --git a/code/datums/antagonists/antag_hud.dm b/code/modules/antagonists/_common/antag_hud.dm similarity index 100% rename from code/datums/antagonists/antag_hud.dm rename to code/modules/antagonists/_common/antag_hud.dm diff --git a/code/datums/antagonists/antag_spawner.dm b/code/modules/antagonists/_common/antag_spawner.dm similarity index 100% rename from code/datums/antagonists/antag_spawner.dm rename to code/modules/antagonists/_common/antag_spawner.dm diff --git a/code/datums/antagonists/antag_team.dm b/code/modules/antagonists/_common/antag_team.dm similarity index 100% rename from code/datums/antagonists/antag_team.dm rename to code/modules/antagonists/_common/antag_team.dm diff --git a/code/modules/antagonists/wishgranter/wishgranter.dm b/code/modules/antagonists/wishgranter/wishgranter.dm new file mode 100644 index 00000000000..54d12867ac1 --- /dev/null +++ b/code/modules/antagonists/wishgranter/wishgranter.dm @@ -0,0 +1,81 @@ +/datum/antagonist/wishgranter + name = "Wishgranter Avatar" + +/datum/antagonist/wishgranter/proc/forge_objectives() + var/datum/objective/hijack/hijack = new + hijack.owner = owner + objectives += hijack + owner.objectives |= objectives + +/datum/antagonist/wishgranter/on_gain() + owner.special_role = "Avatar of the Wish Granter" + forge_objectives() + . = ..() + give_powers() + +/datum/antagonist/wishgranter/greet() + to_chat(owner.current, "Your inhibitions are swept away, the bonds of loyalty broken, you are free to murder as you please!") + owner.announce_objectives() + +/datum/antagonist/wishgranter/proc/give_powers() + var/mob/living/carbon/human/H = owner.current + if(!istype(H)) + return + H.ignore_gene_stability = TRUE + H.dna.SetSEState(HULKBLOCK, TRUE) + genemutcheck(H, HULKBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(XRAYBLOCK, TRUE) + genemutcheck(H, XRAYBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(FIREBLOCK, TRUE) + genemutcheck(H, FIREBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(COLDBLOCK, TRUE) + genemutcheck(H, COLDBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(TELEBLOCK, TRUE) + genemutcheck(H, TELEBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(INCREASERUNBLOCK, TRUE) + genemutcheck(H, INCREASERUNBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(BREATHLESSBLOCK, TRUE) + genemutcheck(H, BREATHLESSBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(REGENERATEBLOCK, TRUE) + genemutcheck(H, REGENERATEBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(SHOCKIMMUNITYBLOCK, TRUE) + genemutcheck(H, SHOCKIMMUNITYBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(SMALLSIZEBLOCK, TRUE) + genemutcheck(H, SMALLSIZEBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(SOBERBLOCK, TRUE) + genemutcheck(H, SOBERBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(PSYRESISTBLOCK, TRUE) + genemutcheck(H, PSYRESISTBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(SHADOWBLOCK, TRUE) + genemutcheck(H, SHADOWBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(CRYOBLOCK, TRUE) + genemutcheck(H, CRYOBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(EATBLOCK, TRUE) + genemutcheck(H, EATBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(JUMPBLOCK, TRUE) + genemutcheck(H, JUMPBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(SUPERFARTBLOCK, TRUE) + genemutcheck(H, SUPERFARTBLOCK, null, MUTCHK_FORCED) + + H.dna.SetSEState(IMMOLATEBLOCK, TRUE) + genemutcheck(H, IMMOLATEBLOCK, null, MUTCHK_FORCED) + + H.mutations.Add(LASER) + H.update_mutations() + H.update_body() \ No newline at end of file diff --git a/paradise.dme b/paradise.dme index 6cf47e457f5..69bf343bca3 100644 --- a/paradise.dme +++ b/paradise.dme @@ -239,11 +239,6 @@ #include "code\datums\uplink_item.dm" #include "code\datums\vision_override.dm" #include "code\datums\vr.dm" -#include "code\datums\antagonists\antag_datum.dm" -#include "code\datums\antagonists\antag_helpers.dm" -#include "code\datums\antagonists\antag_hud.dm" -#include "code\datums\antagonists\antag_spawner.dm" -#include "code\datums\antagonists\antag_team.dm" #include "code\datums\cache\air_alarm.dm" #include "code\datums\cache\apc.dm" #include "code\datums\cache\cache.dm" @@ -1135,6 +1130,12 @@ #include "code\modules\alarm\fire_alarm.dm" #include "code\modules\alarm\motion_alarm.dm" #include "code\modules\alarm\power_alarm.dm" +#include "code\modules\antagonists\_common\antag_datum.dm" +#include "code\modules\antagonists\_common\antag_helpers.dm" +#include "code\modules\antagonists\_common\antag_hud.dm" +#include "code\modules\antagonists\_common\antag_spawner.dm" +#include "code\modules\antagonists\_common\antag_team.dm" +#include "code\modules\antagonists\wishgranter\wishgranter.dm" #include "code\modules\arcade\arcade_base.dm" #include "code\modules\arcade\arcade_prize.dm" #include "code\modules\arcade\claw_game.dm"