diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm index d42cd4c9059c..1549afd6c5c8 100644 --- a/code/__DEFINES/lighting.dm +++ b/code/__DEFINES/lighting.dm @@ -66,6 +66,7 @@ #define LIGHT_COLOR_HOLY_MAGIC "#FFF743" /// deep crimson #define LIGHT_COLOR_BLOOD_MAGIC "#D00000" +#define LIGHT_COLOR_CLOCKWORK "#BE8700" //These ones aren't a direct colour like the ones above, because nothing would fit /// Warm orange color, leaning strongly towards yellow. rgb(250, 160, 25) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index b1b820eaf30e..1d3d553c276a 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -264,6 +264,7 @@ #define TRAIT_SHIFTY_EYES "shifty_eyes" #define TRAIT_ANXIOUS "anxious" #define TRAIT_SEE_REAGENTS "see_reagents" +#define TRAIT_STARGAZED "stargazed" // common trait sources #define TRAIT_GENERIC "generic" @@ -328,6 +329,7 @@ #define HIVEMIND_ONE_MIND_TRAIT "one_mind" #define VR_ZONE_TRAIT "vr_zone_trait" #define GUARDIAN_TRAIT "guardian_trait" +#define STARGAZER_TRAIT "stargazer" #define RANDOM_BLACKOUTS "random_blackouts" #define MADE_UNCLONEABLE "made-uncloneable" #define BLOODSUCKER_TRAIT "bloodsucker_trait" diff --git a/code/modules/antagonists/clockcult/clock_structures/stargazer.dm b/code/modules/antagonists/clockcult/clock_structures/stargazer.dm new file mode 100644 index 000000000000..9b0d92a8fec5 --- /dev/null +++ b/code/modules/antagonists/clockcult/clock_structures/stargazer.dm @@ -0,0 +1,190 @@ +//==================================// +// ! Stargazer ! // +//==================================// +/datum/clockwork_scripture/create_object/construct/stargazer + descname = "Structure, Stargazer" + name = "Stargazer" + desc = "Allows you to enchant your weapons and armor, however enchanting can have risky side effects." + usage_tip = "Make your gear more powerful by enchanting them with stargazers." + power_cost = 600 + channel_time = 8 SECONDS + invocations = list("A light of Engine shall empower my armaments!") + object_path = /obj/structure/destructible/clockwork/stargazer + one_per_tile = TRUE + primary_component = HIEROPHANT_ANSIBLE + tier = SCRIPTURE_SCRIPT + +//Stargazer light + +/obj/effect/stargazer_light + icon = 'icons/obj/clockwork_objects.dmi' + icon_state = "stargazer_closed" + pixel_y = 10 + layer = FLY_LAYER + mouse_opacity = MOUSE_OPACITY_TRANSPARENT + alpha = 160 + var/active_timer + +/obj/effect/stargazer_light/ex_act() + return + +/obj/effect/stargazer_light/Destroy(force) + cancel_timer() + . = ..() + +/obj/effect/stargazer_light/proc/finish_opening() + icon_state = "stargazer_light" + active_timer = null + +/obj/effect/stargazer_light/proc/finish_closing() + icon_state = "stargazer_closed" + active_timer = null + +/obj/effect/stargazer_light/proc/open() + icon_state = "stargazer_opening" + cancel_timer() + active_timer = addtimer(CALLBACK(src, .proc/finish_opening), 2, TIMER_STOPPABLE | TIMER_UNIQUE) + +/obj/effect/stargazer_light/proc/close() + icon_state = "stargazer_closing" + cancel_timer() + active_timer = addtimer(CALLBACK(src, .proc/finish_closing), 2, TIMER_STOPPABLE | TIMER_UNIQUE) + +/obj/effect/stargazer_light/proc/cancel_timer() + if(active_timer) + deltimer(active_timer) + +#define STARGAZER_COOLDOWN 1800 + +//Stargazer structure +/obj/structure/destructible/clockwork/stargazer + name = "stargazer" + desc = "A small pedestal, glowing with a divine energy." + clockwork_desc = "A small pedestal, glowing with a divine energy. Used to provide special powers and abilities to items." + icon_state = "stargazer" + anchored = TRUE + break_message = "The stargazer collapses." + var/cooldowntime = 0 + var/mobs_in_range = FALSE + var/fading = FALSE + var/obj/effect/stargazer_light/sg_light + +/obj/structure/destructible/clockwork/stargazer/Initialize() + . = ..() + sg_light = new(get_turf(src)) + START_PROCESSING(SSobj, src) + +/obj/structure/destructible/clockwork/stargazer/Destroy() + STOP_PROCESSING(SSobj, src) + if(!QDELETED(sg_light)) + qdel(sg_light) + . = ..() + +/obj/structure/destructible/clockwork/stargazer/process() + if(QDELETED(sg_light)) + return + var/mob_nearby = FALSE + for(var/mob/living/M in view(2, get_turf(src))) + if(is_servant_of_ratvar(M)) + mob_nearby = TRUE + break + if(mob_nearby && !mobs_in_range) + sg_light.open() + mobs_in_range = TRUE + else if(!mob_nearby && mobs_in_range) + mobs_in_range = FALSE + sg_light.close() + +/obj/structure/destructible/clockwork/stargazer/attackby(obj/item/I, mob/living/user, params) + if(user.a_intent != INTENT_HELP) + return ..() + if(!anchored) + to_chat(user, "You need to anchor [src] to the floor first.") + return + if(cooldowntime > world.time) + to_chat(user, "[src] is still warming up, it will be ready in [DisplayTimeText(cooldowntime - world.time)].") + return + if(HAS_TRAIT(I, TRAIT_STARGAZED)) + to_chat(user, "[I] has already been enhanced!") + return + to_chat(user, "You begin placing [I] onto [src].") + if(do_after(user, 60, target=I)) + if(cooldowntime > world.time) + to_chat(user, "[src] is still warming up, it will be ready in [DisplayTimeText(cooldowntime - world.time)].") + return + if(HAS_TRAIT(I, TRAIT_STARGAZED)) + to_chat(user, "[I] has already been enhanced!") + return + if(istype(I, /obj/item)) + upgrade_weapon(I, user) + cooldowntime = world.time + STARGAZER_COOLDOWN + return + to_chat(user, "You cannot upgrade [I].") + +/obj/structure/destructible/clockwork/stargazer/proc/upgrade_weapon(obj/item/I, mob/living/user) + ADD_TRAIT(I, TRAIT_STARGAZED, STARGAZER_TRAIT) + switch(rand(1, 10)) + if(1) + to_chat(user, "You feel [I] tighten to your hand.") + ADD_TRAIT(I, TRAIT_NODROP, STARGAZER_TRAIT) + return + if(2) + to_chat(user, "[I] looks as if it could cut through anything.") + I.force += 6 + return + if(3) + I.w_class = WEIGHT_CLASS_TINY + to_chat(user, "[I] suddenly shrinks!") + return + if(4) + I.light_power = 3 + I.light_range = 2 + I.light_color = LIGHT_COLOR_CLOCKWORK + to_chat(user, "[I] shines with a brilliant light!") + return + if(5) + I.damtype = BURN + I.force += 2 + I.light_power = 1.5 + I.light_range = 2 + I.light_color = LIGHT_COLOR_FIRE + to_chat(user, "[I] emits off an intense heat!") + return + if(6) + I.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF + to_chat(user, "[I] becomes unbreakable!") + return + if(7) + to_chat(user, "You feel [I] attempting to communicate with you.") + var/list/mob/dead/observer/candidates = pollGhostCandidates("Do you want to play as the spirit of [user.real_name]'s [I]?", ROLE_PAI, null, FALSE, 100, POLL_IGNORE_POSSESSED_BLADE) + if(LAZYLEN(candidates)) + var/mob/dead/observer/C = pick(candidates) + var/mob/living/simple_animal/shade/S = new(src) + S.ckey = C.ckey + S.fully_replace_character_name(null, "The spirit of [name]") + S.status_flags |= GODMODE + S.copy_languages(user, LANGUAGE_MASTER) //Make sure the sword can understand and communicate with the user. + S.update_atom_languages() + S.grant_all_languages(FALSE, FALSE, TRUE) //Grants omnitongue + var/input = sanitize_name(stripped_input(S,"What are you named?", ,"", MAX_NAME_LEN)) + + if(src && input) + name = input + S.fully_replace_character_name(null, "The spirit of [input]") + else + to_chat(user, "The [I] stops talking to you...") + REMOVE_TRAIT(I, TRAIT_STARGAZED, STARGAZER_TRAIT) + return + if(8) + to_chat(user, "[I] goes blunt.") + I.force = max(I.force - 4, 0) + return + if(9) + to_chat(user, "You feel bloodlust starting to emanate from [I]!") + I.AddComponent(/datum/component/lifesteal, 4) + return + if(10) + to_chat(user, "[I] suddenly transforms, gaining the magical properties of shungite, it will protect your from EMPs!") + I.AddComponent(/datum/component/empprotection) + I.color = COLOR_ALMOST_BLACK + return diff --git a/icons/obj/clockwork_objects.dmi b/icons/obj/clockwork_objects.dmi index 69d496b9388d..e109c2e9566a 100644 Binary files a/icons/obj/clockwork_objects.dmi and b/icons/obj/clockwork_objects.dmi differ diff --git a/yogstation.dme b/yogstation.dme index 099447857462..5518a3d7d52a 100644 --- a/yogstation.dme +++ b/yogstation.dme @@ -1528,6 +1528,7 @@ #include "code\modules\antagonists\clockcult\clock_structures\mania_motor.dm" #include "code\modules\antagonists\clockcult\clock_structures\ocular_warden.dm" #include "code\modules\antagonists\clockcult\clock_structures\ratvar_the_clockwork_justicar.dm" +#include "code\modules\antagonists\clockcult\clock_structures\stargazer.dm" #include "code\modules\antagonists\clockcult\clock_structures\taunting_trail.dm" #include "code\modules\antagonists\clockcult\clock_structures\wall_gear.dm" #include "code\modules\antagonists\clockcult\clock_structures\trap_triggers\lever.dm"