Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
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
1 change: 1 addition & 0 deletions code/__DEFINES/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
190 changes: 190 additions & 0 deletions code/modules/antagonists/clockcult/clock_structures/stargazer.dm
Original file line number Diff line number Diff line change
@@ -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 = "<span class='warning'>The stargazer collapses.</span>"
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, "<span class='brass'>You need to anchor [src] to the floor first.</span>")
return
if(cooldowntime > world.time)
to_chat(user, "<span class='brass'>[src] is still warming up, it will be ready in [DisplayTimeText(cooldowntime - world.time)].</span>")
return
if(HAS_TRAIT(I, TRAIT_STARGAZED))
to_chat(user, "<span class='brass'>[I] has already been enhanced!</span>")
return
to_chat(user, "<span class='brass'>You begin placing [I] onto [src].</span>")
if(do_after(user, 60, target=I))
if(cooldowntime > world.time)
to_chat(user, "<span class='brass'>[src] is still warming up, it will be ready in [DisplayTimeText(cooldowntime - world.time)].</span>")
return
if(HAS_TRAIT(I, TRAIT_STARGAZED))
to_chat(user, "<span class='brass'>[I] has already been enhanced!</span>")
return
if(istype(I, /obj/item))
upgrade_weapon(I, user)
cooldowntime = world.time + STARGAZER_COOLDOWN
return
to_chat(user, "<span class='brass'>You cannot upgrade [I].</span>")

/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, "<span class='neovgre'>You feel [I] tighten to your hand.</span>")
ADD_TRAIT(I, TRAIT_NODROP, STARGAZER_TRAIT)
return
if(2)
to_chat(user, "<span class='neovgre'>[I] looks as if it could cut through anything.</span>")
I.force += 6
return
if(3)
I.w_class = WEIGHT_CLASS_TINY
to_chat(user, "<span class='neovgre'>[I] suddenly shrinks!</span>")
return
if(4)
I.light_power = 3
I.light_range = 2
I.light_color = LIGHT_COLOR_CLOCKWORK
to_chat(user, "<span class='neovgre'>[I] shines with a brilliant light!</span>")
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, "<span class='neovgre'>[I] emits off an intense heat!</span>")
return
if(6)
I.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
to_chat(user, "<span class='neovgre'>[I] becomes unbreakable!</span>")
return
if(7)
to_chat(user, "<span class='neovgre'>You feel [I] attempting to communicate with you.</span>")
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, "<span class='neovgre'>The [I] stops talking to you...</span>")
REMOVE_TRAIT(I, TRAIT_STARGAZED, STARGAZER_TRAIT)
return
if(8)
to_chat(user, "<span class='neovgre'>[I] goes blunt.</span>")
I.force = max(I.force - 4, 0)
return
if(9)
to_chat(user, "<span class='neovgre'>You feel bloodlust starting to emanate from [I]!</span>")
I.AddComponent(/datum/component/lifesteal, 4)
return
if(10)
to_chat(user, "<span class='neovgre'>[I] suddenly transforms, gaining the magical properties of shungite, it will protect your from EMPs!</span>")
I.AddComponent(/datum/component/empprotection)
I.color = COLOR_ALMOST_BLACK
return
Binary file modified icons/obj/clockwork_objects.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions yogstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down