From 2e6f515e164d7026b67723b7b1a9ecdddf44d8b8 Mon Sep 17 00:00:00 2001
From: PowerfulBacon <26465327+PowerfulBacon@users.noreply.github.com>
Date: Mon, 5 Jul 2021 20:38:14 +0100
Subject: [PATCH] Clockwork fixes, gamemode map load refactor, eminence
refactoring
---
.../lavaland_surface_dead_ratvar.dmm | 4 +
beestation.dme | 1 +
code/controllers/subsystem/ticker.dm | 33 +++-
code/game/gamemodes/clock_cult/clockcult.dm | 13 +-
.../dynamic/dynamic_rulesets_roundstart.dm | 9 +-
code/game/gamemodes/game_mode.dm | 2 +
code/game/machinery/buttons.dm | 6 +
code/game/machinery/firealarm.dm | 8 +-
code/game/machinery/flasher.dm | 7 +
code/game/machinery/lightswitch.dm | 6 +
code/game/objects/items/pneumaticCannon.dm | 4 +
.../clock_cult/clockwork_outfits.dm | 12 ++
.../antagonists/clock_cult/clockwork_turfs.dm | 8 +-
.../clock_cult/helpers/reebe_loader.dm | 3 +
.../clock_cult/items/clockwork_weapon.dm | 81 ++++++++++
.../clock_cult/items/integration_cog.dm | 3 +
.../antagonists/clock_cult/mobs/eminence.dm | 152 +++++++++++++-----
.../clock_cult/structure/clockwork_camera.dm | 3 +-
code/modules/mapping/map_template.dm | 4 +-
.../mob/living/silicon/robot/robot_modules.dm | 12 ++
code/modules/power/apc.dm | 6 +-
config/Sage/game_options.txt | 4 +-
config/game_options.txt | 7 +
23 files changed, 309 insertions(+), 79 deletions(-)
create mode 100644 code/modules/antagonists/clock_cult/helpers/reebe_loader.dm
diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_dead_ratvar.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_dead_ratvar.dmm
index ab4ff804205..7984f716a8f 100644
--- a/_maps/RandomRuins/LavaRuins/lavaland_surface_dead_ratvar.dmm
+++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_dead_ratvar.dmm
@@ -123,7 +123,11 @@
},
/area/lavaland/surface/outdoors/unexplored)
"B" = (
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/brass_spear,
+=======
+/obj/item/clockwork/weapon/brass_spear,
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
/turf/open/floor/clockwork{
initial_gas_mix = "LAVALAND_ATMOS"
},
diff --git a/beestation.dme b/beestation.dme
index 46a935d389a..d9d520e5d8b 100644
--- a/beestation.dme
+++ b/beestation.dme
@@ -1431,6 +1431,7 @@
#include "code\modules\antagonists\clock_cult\helpers\battle_of_the_gods.dm"
#include "code\modules\antagonists\clock_cult\helpers\clockcult_ending.dm"
#include "code\modules\antagonists\clock_cult\helpers\clockwork_conversion_tracker.dm"
+#include "code\modules\antagonists\clock_cult\helpers\reebe_loader.dm"
#include "code\modules\antagonists\clock_cult\helpers\servant_warp.dm"
#include "code\modules\antagonists\clock_cult\items\brass_clothing.dm"
#include "code\modules\antagonists\clock_cult\items\clock_components.dm"
diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm
index 4cabd93b611..2659ef1de6f 100755
--- a/code/controllers/subsystem/ticker.dm
+++ b/code/controllers/subsystem/ticker.dm
@@ -27,6 +27,8 @@ SUBSYSTEM_DEF(ticker)
var/admin_delay_notice = "" //a message to display to anyone who tries to restart the world after a delay
var/ready_for_reboot = FALSE //all roundend preparation done with, all that's left is reboot
+ var/gamemode_setup_completed = FALSE
+
var/triai = 0 //Global holder for Triumvirate
var/tipped = 0 //Did we broadcast the tip of the day yet?
var/selected_tip // What will be the tip of the day?
@@ -45,6 +47,8 @@ SUBSYSTEM_DEF(ticker)
var/maprotatechecked = 0
+ var/list/datum/game_mode/runnable_modes //list of runnable gamemodes
+
var/news_report
var/late_join_disabled
@@ -187,6 +191,14 @@ SUBSYSTEM_DEF(ticker)
send_tip_of_the_round()
tipped = TRUE
+ if(timeLeft <= 300 && !gamemode_setup_completed)
+ //Setup failed
+ if(!pre_setup())
+ timeLeft = null
+ start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10)
+ else
+ gamemode_setup_completed = TRUE
+
if(timeLeft <= 0)
current_state = GAME_STATE_SETTING_UP
Master.SetRunLevel(RUNLEVEL_SETUP)
@@ -194,6 +206,13 @@ SUBSYSTEM_DEF(ticker)
fire()
if(GAME_STATE_SETTING_UP)
+ if(!gamemode_setup_completed)
+ if(!pre_setup())
+ //setup failed
+ current_state = GAME_STATE_STARTUP
+ start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10)
+ timeLeft = null
+ Master.SetRunLevel(RUNLEVEL_LOBBY)
if(!setup())
//setup failed
current_state = GAME_STATE_STARTUP
@@ -213,12 +232,8 @@ SUBSYSTEM_DEF(ticker)
declare_completion(force_ending)
Master.SetRunLevel(RUNLEVEL_POSTGAME)
-
-/datum/controller/subsystem/ticker/proc/setup()
- message_admins("Setting up game.")
- var/init_start = world.timeofday
- //Create and announce mode
- var/list/datum/game_mode/runnable_modes
+//Select gamemode and load any maps associated with it
+/datum/controller/subsystem/ticker/proc/pre_setup()
if(GLOB.master_mode == "random" || GLOB.master_mode == "secret")
runnable_modes = config.get_runnable_modes()
@@ -248,6 +263,12 @@ SUBSYSTEM_DEF(ticker)
SSjob.ResetOccupations()
return 0
+ return mode.setup_maps()
+
+/datum/controller/subsystem/ticker/proc/setup()
+ message_admins("Setting up game.")
+ var/init_start = world.timeofday
+
CHECK_TICK
//Configure mode and assign player to special mode stuff
var/can_continue = 0
diff --git a/code/game/gamemodes/clock_cult/clockcult.dm b/code/game/gamemodes/clock_cult/clockcult.dm
index 89168a3ac62..1714e279fe7 100644
--- a/code/game/gamemodes/clock_cult/clockcult.dm
+++ b/code/game/gamemodes/clock_cult/clockcult.dm
@@ -47,16 +47,11 @@ GLOBAL_VAR(clockcult_eminence)
var/datum/team/clock_cult/main_cult
+/datum/game_mode/clockcult/setup_maps()
+ LoadReebe()
+ return TRUE
+
/datum/game_mode/clockcult/pre_setup()
- //Load Reebe
- var/list/errorList = list()
- var/list/reebe = SSmapping.LoadGroup(errorList, "Reebe", "map_files/generic", "CityOfCogs.dmm", default_traits=ZTRAITS_REEBE, silent=TRUE)
- if(errorList.len)
- message_admins("Reebe failed to load")
- log_game("Reebe failed to load")
- return FALSE
- for(var/datum/map_template/map in reebe)
- map.initTemplateBounds()
//Generate cultists
for(var/i in 1 to clock_cultists)
if(!antag_candidates.len)
diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm
index 72a17558028..5c40f2f31b8 100644
--- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm
+++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm
@@ -651,14 +651,7 @@
/datum/dynamic_ruleset/roundstart/clockcult/pre_execute()
//Load Reebe
- var/list/errorList = list()
- var/list/reebe = SSmapping.LoadGroup(errorList, "Reebe", "map_files/generic", "CityOfCogs.dmm", default_traits=ZTRAITS_REEBE, silent=TRUE)
- if(errorList.len)
- message_admins("Reebe failed to load")
- log_game("Reebe failed to load")
- return FALSE
- for(var/datum/map_template/map in reebe)
- map.initTemplateBounds()
+ LoadReebe()
//Make cultists
var/starter_servants = 4
var/number_players = mode.roundstart_pop_ready
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index a2e8bacb0ca..e9a4985afd0 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -83,6 +83,8 @@
message_admins("DEBUG: GAME STARTING WITHOUT PLAYER NUMBER CHECKS, THIS WILL PROBABLY BREAK SHIT.")
return TRUE
+/datum/game_mode/proc/setup_maps()
+ return 1
///Attempts to select players for special roles the mode might have.
/datum/game_mode/proc/pre_setup()
diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm
index 4e915d46e0c..8d21575381a 100644
--- a/code/game/machinery/buttons.dm
+++ b/code/game/machinery/buttons.dm
@@ -111,6 +111,12 @@
playsound(src, "sparks", 100, 1)
obj_flags |= EMAGGED
+/obj/machinery/button/eminence_act(mob/living/simple_animal/eminence/eminence)
+ . = ..()
+ to_chat(usr, "You begin manipulating [src]!")
+ if(do_after(eminence, 20, target=get_turf(eminence)))
+ attack_hand(eminence)
+
/obj/machinery/button/attack_ai(mob/user)
if(!panel_open)
return attack_hand(user)
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index fb40aa742da..4aaff5f5827 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -119,6 +119,12 @@
"You emag [src], disabling its thermal sensors.")
playsound(src, "sparks", 50, 1)
+/obj/machinery/firealarm/eminence_act(mob/living/simple_animal/eminence/eminence)
+ . = ..()
+ to_chat(usr, "You begin manipulating [src]!")
+ if(do_after(eminence, 20, target=get_turf(eminence)))
+ attack_hand(eminence)
+
/obj/machinery/firealarm/temperature_expose(datum/gas_mixture/air, temperature, volume)
if((temperature > T0C + 200 || temperature < BODYTEMP_COLD_DAMAGE_LIMIT) && (last_alarm+FIREALARM_COOLDOWN < world.time) && !(obj_flags & EMAGGED) && detecting && !stat)
alarm()
@@ -265,7 +271,7 @@
/obj/machinery/firealarm/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if((buildstage == 0) && (the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS))
- return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
+ return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
return FALSE
/obj/machinery/firealarm/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 1ccb08df897..1055751a526 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -87,6 +87,13 @@
if (anchored)
return flash()
+/obj/machinery/flasher/eminence_act(mob/living/simple_animal/eminence/eminence)
+ . = ..()
+ to_chat(usr, "You begin manipulating [src]!")
+ if(do_after(eminence, 20, target=get_turf(eminence)))
+ if(anchored)
+ flash()
+
/obj/machinery/flasher/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 10) //any melee attack below 10 dmg does nothing
return 0
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 47e2ea67ec5..ec4a5a4be14 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -62,3 +62,9 @@
return
if(!(stat & (BROKEN|NOPOWER)))
power_change()
+
+/obj/machinery/light_switch/eminence_act(mob/living/simple_animal/eminence/eminence)
+ . = ..()
+ to_chat(usr, "You begin manipulating [src]!")
+ if(do_after(eminence, 20, target=get_turf(eminence)))
+ interact(eminence)
diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm
index 5f069cc5e10..8b73ba2fcfa 100644
--- a/code/game/objects/items/pneumaticCannon.dm
+++ b/code/game/objects/items/pneumaticCannon.dm
@@ -315,7 +315,11 @@
throw_amount = 1
maxWeightClass = 4 //a single magspear or spear
spin_item = FALSE
+<<<<<<< HEAD
var/static/list/magspear_typecache = typecacheof(list(/obj/item/throwing_star/magspear, /obj/item/twohanded/spear, /obj/item/stack/rods/fifty, /obj/item/stack/rods, /obj/item/stack/rods/twentyfive, /obj/item/stack/rods/ten, /obj/item/katana, /obj/item/katana/cursed, /obj/item/toy/katana, /obj/item/twohanded/spear/explosive, /obj/item/twohanded/clockwork/brass_spear))
+=======
+ var/static/list/magspear_typecache = typecacheof(list(/obj/item/throwing_star/magspear, /obj/item/spear, /obj/item/stack/rods/fifty, /obj/item/stack/rods, /obj/item/stack/rods/twentyfive, /obj/item/stack/rods/ten, /obj/item/katana, /obj/item/katana/cursed, /obj/item/toy/katana, /obj/item/spear/explosive, /obj/item/clockwork/weapon/brass_spear))
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
/obj/item/pneumatic_cannon/speargun/Initialize()
. = ..()
diff --git a/code/modules/antagonists/clock_cult/clockwork_outfits.dm b/code/modules/antagonists/clock_cult/clockwork_outfits.dm
index 4f2ccbd2a51..3bafda01364 100644
--- a/code/modules/antagonists/clock_cult/clockwork_outfits.dm
+++ b/code/modules/antagonists/clock_cult/clockwork_outfits.dm
@@ -20,18 +20,30 @@
name = "Servant of Ratvar - Armaments"
suit = /obj/item/clothing/suit/clockwork
+<<<<<<< HEAD
weapon = /obj/item/twohanded/clockwork/brass_spear
+=======
+ weapon = /obj/item/clockwork/weapon/brass_spear
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
head = /obj/item/clothing/head/helmet/clockcult
shoes = /obj/item/clothing/shoes/clockcult
gloves = /obj/item/clothing/gloves/clockcult
/datum/outfit/clockcult/armaments/hammer
name = "Servant of Ratvar - Armaments (hammer)"
+<<<<<<< HEAD
weapon = /obj/item/twohanded/clockwork/brass_battlehammer
/datum/outfit/clockcult/armaments/sword
name = "Servant of Ratvar - Armaments (sword)"
weapon = /obj/item/twohanded/clockwork/brass_sword
+=======
+ weapon = /obj/item/clockwork/weapon/brass_battlehammer
+
+/datum/outfit/clockcult/armaments/sword
+ name = "Servant of Ratvar - Armaments (sword)"
+ weapon = /obj/item/clockwork/weapon/brass_sword
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
/datum/outfit/clockcult/armaments/bow
name = "Servant of Ratvar - Armaments (sword)"
diff --git a/code/modules/antagonists/clock_cult/clockwork_turfs.dm b/code/modules/antagonists/clock_cult/clockwork_turfs.dm
index ecf5b55f14b..26f2f0e1f4d 100644
--- a/code/modules/antagonists/clock_cult/clockwork_turfs.dm
+++ b/code/modules/antagonists/clock_cult/clockwork_turfs.dm
@@ -243,10 +243,6 @@
planetary_atmos = TRUE
var/list/heal_people
-/turf/open/floor/clockwork/reebe/Initialize()
- . = ..()
- heal_people = list()
-
/turf/open/floor/clockwork/reebe/Destroy()
if(LAZYLEN(heal_people))
STOP_PROCESSING(SSprocessing, src)
@@ -258,12 +254,12 @@
if(istype(M) && is_servant_of_ratvar(M))
if(!LAZYLEN(heal_people))
START_PROCESSING(SSprocessing, src)
- heal_people += M
+ LAZYADD(heal_people, M)
/turf/open/floor/clockwork/reebe/Exited(atom/movable/A, atom/newloc)
. = ..()
if(A in heal_people)
- heal_people -= A
+ LAZYREMOVE(heal_people, A)
if(!LAZYLEN(heal_people))
STOP_PROCESSING(SSprocessing, src)
diff --git a/code/modules/antagonists/clock_cult/helpers/reebe_loader.dm b/code/modules/antagonists/clock_cult/helpers/reebe_loader.dm
new file mode 100644
index 00000000000..4dd54848c0f
--- /dev/null
+++ b/code/modules/antagonists/clock_cult/helpers/reebe_loader.dm
@@ -0,0 +1,3 @@
+/proc/LoadReebe()
+ var/datum/map_template/template = new("_maps/map_files/generic/CityOfCogs.dmm", "Reebe")
+ template.load_new_z(ZTRAITS_REEBE)
diff --git a/code/modules/antagonists/clock_cult/items/clockwork_weapon.dm b/code/modules/antagonists/clock_cult/items/clockwork_weapon.dm
index 3b3c7a7c8a3..fc865451514 100644
--- a/code/modules/antagonists/clock_cult/items/clockwork_weapon.dm
+++ b/code/modules/antagonists/clock_cult/items/clockwork_weapon.dm
@@ -1,4 +1,8 @@
+<<<<<<< HEAD
/obj/item/twohanded/clockwork
+=======
+/obj/item/clockwork/weapon
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
name = "Clockwork Weapon"
desc = "Something"
icon = 'icons/obj/clockwork_objects.dmi'
@@ -23,7 +27,11 @@
var/clockwork_hint = ""
var/obj/effect/proc_holder/spell/targeted/summon_spear/SS
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/pickup(mob/user)
+=======
+/obj/item/clockwork/weapon/pickup(mob/user)
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
. = ..()
user.mind.RemoveSpell(SS)
if(is_servant_of_ratvar(user))
@@ -32,11 +40,16 @@
user.mind.AddSpell(SS)
wield(user)
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/examine(mob/user)
+=======
+/obj/item/clockwork/weapon/examine(mob/user)
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
. = ..()
if(is_servant_of_ratvar(user) && clockwork_hint)
. += clockwork_hint
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/attack(mob/living/target, mob/living/user)
. = ..()
if(!is_reebe(user.z))
@@ -45,6 +58,35 @@
hit_effect(target, user)
/obj/item/twohanded/clockwork/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
+=======
+/obj/item/clockwork/weapon/attack(mob/living/target, mob/living/user)
+ if(!is_reebe(user.z))
+ return ..()
+ //Gain a slight buff when fighting near to the Ark.
+ var/force_buff = 0
+ //Check distance
+ if(GLOB.celestial_gateway)
+ var/turf/gatewayT = get_turf(GLOB.celestial_gateway)
+ var/turf/ourT = get_turf(user)
+ var/distance_from_ark = get_dist(gatewayT, ourT)
+ if(gatewayT.z == ourT.z && distance_from_ark < 15)
+ switch(distance_from_ark)
+ if(0 to 6)
+ force_buff = 8
+ if(6 to 10)
+ force_buff = 5
+ if(10 to 15)
+ force_buff = 3
+ //Magic sound
+ playsound(src, 'sound/effects/clockcult_gateway_disrupted.ogg', 40)
+ force += force_buff
+ . = ..()
+ force -= force_buff
+ if(!QDELETED(target) && target.stat != DEAD && !is_servant_of_ratvar(target) && !target.anti_magic_check(major=FALSE) && ISWIELDED(src))
+ hit_effect(target, user)
+
+/obj/item/clockwork/weapon/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
. = ..()
if(!is_reebe(z))
return
@@ -54,22 +96,36 @@
if(!target.anti_magic_check() && !is_servant_of_ratvar(target))
hit_effect(target, throwingdatum.thrower, TRUE)
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/proc/hit_effect(mob/living/target, mob/living/user, thrown=FALSE)
return
/obj/item/twohanded/clockwork/brass_spear
+=======
+/obj/item/clockwork/weapon/proc/hit_effect(mob/living/target, mob/living/user, thrown=FALSE)
+ return
+
+/obj/item/clockwork/weapon/brass_spear
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
name = "brass spear"
desc = "A razor-sharp spear made of brass. It thrums with barely-contained energy."
+ clockwork_desc = "A razor-sharp spear made of a magnetic brass allow. It accelerates towards targets while on Reebe dealing increased damage."
icon_state = "ratvarian_spear"
embedding = list("embedded_impact_pain_multiplier" = 3)
force_wielded = 24
throwforce = 36
+ force = 25
armour_penetration = 24
clockwork_hint = "Throwing the spear will deal bonus damage while on Reebe."
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/brass_battlehammer
+=======
+/obj/item/clockwork/weapon/brass_battlehammer
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
name = "brass battle-hammer"
desc = "A brass hammer glowing with energy."
+ clockwork_desc = "A brass hammer enfused with an ancient power allowing it to strike foes with incredible force."
icon_state = "ratvarian_hammer"
force_wielded = 25
throwforce = 25
@@ -78,22 +134,43 @@
attack_verb = list("bashed", "smitted", "hammered", "attacked")
clockwork_hint = "Enemies hit by this will be flung back while on Reebe."
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/brass_battlehammer/hit_effect(mob/living/target, mob/living/user, thrown=FALSE)
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
target.throw_at(throw_target, thrown ? 2 : 1, 4)
/obj/item/twohanded/clockwork/brass_sword
+=======
+/obj/item/clockwork/weapon/brass_battlehammer/ComponentInitialize()
+ . = ..()
+ AddComponent(/datum/component/two_handed, force_unwielded=15, force_wielded=28, block_power_wielded=25)
+
+/obj/item/clockwork/weapon/brass_battlehammer/hit_effect(mob/living/target, mob/living/user, thrown=FALSE)
+ var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
+ target.throw_at(throw_target, thrown ? 2 : 1, 4)
+
+/obj/item/clockwork/weapon/brass_sword
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
name = "brass longsword"
desc = "A large sword made of brass."
+ clockwork_desc = "A large sword made of brass. It contains an aurora of energetic power designed to disrupt electronics."
icon_state = "ratvarian_sword"
+<<<<<<< HEAD
force_wielded = 26
+=======
+ force = 26
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
throwforce = 20
armour_penetration = 12
attack_verb = list("attacked", "slashed", "cut", "torn", "gored")
clockwork_hint = "Targets will be struck with a powerful electromagnetic pulse while on Reebe."
var/emp_cooldown = 0
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/brass_sword/hit_effect(mob/living/target, mob/living/user, thrown)
+=======
+/obj/item/clockwork/weapon/brass_sword/hit_effect(mob/living/target, mob/living/user, thrown)
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
if(world.time > emp_cooldown)
target.emp_act(EMP_LIGHT)
emp_cooldown = world.time + 300
@@ -101,7 +178,11 @@
to_chat(user, "You strike [target] with an electromagnetic pulse!")
playsound(user, 'sound/magic/lightningshock.ogg', 40)
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/brass_sword/proc/send_message(mob/living/target)
+=======
+/obj/item/clockwork/weapon/brass_sword/proc/send_message(mob/living/target)
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
to_chat(target, "[src] glows, indicating the next attack will disrupt electronics of the target.")
/obj/item/gun/ballistic/bow/clockwork
diff --git a/code/modules/antagonists/clock_cult/items/integration_cog.dm b/code/modules/antagonists/clock_cult/items/integration_cog.dm
index b7f5ffd99a6..144ec856bf6 100644
--- a/code/modules/antagonists/clock_cult/items/integration_cog.dm
+++ b/code/modules/antagonists/clock_cult/items/integration_cog.dm
@@ -38,3 +38,6 @@
//Update the cog counts
for(var/obj/item/clockwork/clockwork_slab/S in GLOB.clockwork_slabs)
S.update_integration_cogs()
+ if(GLOB.clockcult_eminence)
+ var/mob/living/simple_animal/eminence/eminence = GLOB.clockcult_eminence
+ eminence.cog_change()
diff --git a/code/modules/antagonists/clock_cult/mobs/eminence.dm b/code/modules/antagonists/clock_cult/mobs/eminence.dm
index c0a2d1a6864..b366e142e98 100644
--- a/code/modules/antagonists/clock_cult/mobs/eminence.dm
+++ b/code/modules/antagonists/clock_cult/mobs/eminence.dm
@@ -34,19 +34,35 @@
hud_possible = list(ANTAG_HUD)
hud_type = /datum/hud/revenant
+ var/calculated_cogs = 0
+ var/cogs = 0
+
var/mob/living/selected_mob = null
var/obj/effect/proc_holder/spell/targeted/eminence/reebe/spell_reebe
var/obj/effect/proc_holder/spell/targeted/eminence/station/spell_station
+ var/obj/effect/proc_holder/spell/targeted/eminence/servant_warp/spell_servant_warp
var/obj/effect/proc_holder/spell/targeted/eminence/mass_recall/mass_recall
- var/obj/effect/proc_holder/spell/targeted/eminence/reagent_purge/reagent_purge
var/obj/effect/proc_holder/spell/targeted/eminence/linked_abscond/linked_abscond
+ var/obj/effect/proc_holder/spell/targeted/eminence/trigger_event/trigger_event
/mob/living/simple_animal/eminence/ClickOn(atom/A, params)
. = ..()
if(!.)
A.eminence_act(src)
+/mob/living/simple_animal/eminence/proc/cog_change()
+ //Calculate cogs
+ if(calculated_cogs != GLOB.installed_integration_cogs)
+ var/difference = GLOB.installed_integration_cogs - calculated_cogs
+ calculated_cogs += difference
+ cogs += difference
+ to_chat(src, "You have gained [difference] cogs!")
+
+//Cannot gib the eminence.
+/mob/living/simple_animal/eminence/gib()
+ return
+
/mob/living/simple_animal/eminence/UnarmedAttack(atom/A)
return FALSE
@@ -56,17 +72,22 @@
/mob/living/simple_animal/eminence/Initialize()
. = ..()
GLOB.clockcult_eminence = src
+ //Add spells
spell_reebe = new
AddSpell(spell_reebe)
spell_station = new
AddSpell(spell_station)
+ spell_servant_warp = new
+ AddSpell(spell_servant_warp)
mass_recall = new
AddSpell(mass_recall)
- reagent_purge = new
- AddSpell(reagent_purge)
linked_abscond = new
AddSpell(linked_abscond)
+ trigger_event = new
+ AddSpell(trigger_event)
+ //Wooooo, you are a ghost
AddComponent(/datum/component/tracking_beacon, "ghost", null, null, TRUE, "#9e4d91", TRUE, TRUE)
+ cog_change()
/mob/living/simple_animal/eminence/Destroy()
. = ..()
@@ -103,6 +124,11 @@
/mob/living/simple_animal/eminence/bullet_act(obj/item/projectile/Proj)
return BULLET_ACT_FORCE_PIERCE
+/mob/living/simple_animal/eminence/proc/run_global_event(datum/round_event_control/E)
+ E.preRunEvent()
+ E.runEvent()
+ SSevents.reschedule()
+
//Eminence abilities
/obj/effect/proc_holder/spell/targeted/eminence
@@ -116,6 +142,18 @@
cooldown_min = 0
range = -1
include_user = TRUE
+ var/cog_cost
+
+/obj/effect/proc_holder/spell/targeted/eminence/can_cast(mob/user)
+ . = ..()
+ var/mob/living/simple_animal/eminence/eminence = user
+ if(!istype(eminence))
+ return FALSE
+ if(eminence.cogs < cog_cost)
+ return FALSE
+
+/obj/effect/proc_holder/spell/targeted/eminence/proc/consume_cogs(mob/living/simple_animal/eminence/eminence)
+ eminence.cogs -= cog_cost
//=====Warp to Reebe=====
/obj/effect/proc_holder/spell/targeted/eminence/reebe
@@ -146,10 +184,37 @@
else
to_chat(user, "You're already on the station!")
+//=====Teleport to servant=====
+/obj/effect/proc_holder/spell/targeted/eminence/servant_warp
+ name = "Jump to Servant"
+ desc = "Teleport yourself to a specific servant."
+ action_icon_state = "Spatial Warp"
+
+/obj/effect/proc_holder/spell/targeted/eminence/servant_warp/cast(list/targets, mob/user)
+ //Get a list of all servants
+ var/choice = input(user, "Select servant", "Warp to...", null) in GLOB.all_servants_of_ratvar
+ if(!choice)
+ return
+ for(var/mob/living/L in GLOB.all_servants_of_ratvar)
+ if(L.name == choice)
+ choice = L
+ break
+ if(!isliving(choice))
+ to_chat(user, "You cannot jump to them!")
+ return
+ var/mob/living/M = choice
+ if(!is_servant_of_ratvar(M))
+ to_chat(user, "They are no longer a servant of Rat'var!")
+ return
+ var/turf/T = get_turf(M)
+ user.forceMove(get_turf(T))
+ SEND_SOUND(user, sound('sound/magic/magic_missile.ogg'))
+ flash_color(user, flash_color = "#AF0AAF", flash_time = 25)
+
//=====Mass Recall=====
/obj/effect/proc_holder/spell/targeted/eminence/mass_recall
name = "Initiate Mass Recall"
- desc = "Initiates a mass recall, warping everyone to the Ark."
+ desc = "Initiates a mass recall, warping everyone to the Ark. Can only be used 1 time."
action_icon_state = "Spatial Gateway"
/obj/effect/proc_holder/spell/targeted/eminence/mass_recall/cast(list/targets, mob/living/user)
@@ -159,48 +224,13 @@
C.begin_mass_recall()
user.RemoveSpell(src)
-//=====Purge Reagents=====
-/obj/effect/proc_holder/spell/targeted/eminence/reagent_purge
- name = "Purge Reagents"
- desc = "Purges all the reagents from a selected target. You must select a target by left clicking on them first."
- action_icon_state = "Mending Mantra"
- charge_max = 300
-
-/obj/effect/proc_holder/spell/targeted/eminence/reagent_purge/can_cast(mob/user)
- if(!..())
- return FALSE
- var/mob/living/simple_animal/eminence/E = user
- if(!istype(E))
- return FALSE
- if(E.selected_mob && is_servant_of_ratvar(E.selected_mob))
- return TRUE
- return FALSE
-
-/obj/effect/proc_holder/spell/targeted/eminence/reagent_purge/cast(list/targets, mob/living/user)
- var/mob/living/simple_animal/eminence/E = user
- if(!istype(E))
- revert_cast(user)
- return FALSE
- if(!E.selected_mob || !is_servant_of_ratvar(E.selected_mob))
- E.selected_mob = null
- to_chat(user, "You need to select a valid target by clicking on them.")
- revert_cast(user)
- return FALSE
- var/mob/living/L = E.selected_mob
- if(!istype(L))
- revert_cast(user)
- return FALSE
- L.reagents?.clear_reagents()
- to_chat(user, "You clear the reagents from [L]!")
- to_chat(L, "The Eminence has purified your blood!")
- return TRUE
-
//=====Linked Abscond=====
/obj/effect/proc_holder/spell/targeted/eminence/linked_abscond
name = "Linked Abscond"
- desc = "Warps a target to Reebe if they are still for 7 seconds."
+ desc = "Warps a target to Reebe if they are still for 7 seconds. Costs 1 cog."
action_icon_state = "Linked Abscond"
charge_max = 1800
+ cog_cost = 1
/obj/effect/proc_holder/spell/targeted/eminence/linked_abscond/can_cast(mob/user)
if(!..())
@@ -235,8 +265,48 @@
L.visible_message("[L] phases out of existance!")
var/turf/T = get_turf(pick(GLOB.servant_spawns))
try_warp_servant(L, T, FALSE)
+ consume_cogs(E)
return TRUE
else
to_chat(E, "You fail to recall [L].")
revert_cast(user)
return FALSE
+
+//Trigger event
+/obj/effect/proc_holder/spell/targeted/eminence/trigger_event
+ name = "Manipulate Reality"
+ desc = "Manipulate reality causing global events to occur. Costs 5 cogs"
+ action_icon_state = "Geis"
+ charge_max = 3000
+ cog_cost = 5
+
+/obj/effect/proc_holder/spell/targeted/eminence/trigger_event/cast(list/targets, mob/user)
+ var/picked_event = input(user, "Pick an event to run", "Manipulate Reality", null) in list(
+ "Anomaly",
+ "Brand Intelligence",
+ "Camera Failure",
+ "Communications Blackout",
+ "Disease Outbreak",
+ "Electrical Storm",
+ "False Alarm",
+ "Grid Check",
+ "Mass Hallucination",
+ "Processor Overload",
+ "Radiation Storm"
+ )
+ if(!can_cast(user))
+ return
+ if(!picked_event)
+ revert_cast(user)
+ return
+ if(picked_event == "Anomaly")
+ picked_event = pick("Anomaly: Energetic Flux", "Anomaly: Pyroclastic", "Anomaly: Gravitational", "Anomaly: Bluespace")
+ //Reschedule events
+ //Get the picked event
+ for(var/datum/round_event_control/E in SSevents.control)
+ if(E.name == picked_event)
+ var/mob/living/simple_animal/eminence/eminence = user
+ INVOKE_ASYNC(eminence, /mob/living/simple_animal/eminence.proc/run_global_event, E)
+ consume_cogs(user)
+ return
+ revert_cast(user)
diff --git a/code/modules/antagonists/clock_cult/structure/clockwork_camera.dm b/code/modules/antagonists/clock_cult/structure/clockwork_camera.dm
index 0fb820ddb2a..d92258eaa67 100644
--- a/code/modules/antagonists/clock_cult/structure/clockwork_camera.dm
+++ b/code/modules/antagonists/clock_cult/structure/clockwork_camera.dm
@@ -38,12 +38,13 @@
warping = TRUE
button_icon_state = "warp_cancel"
owner.update_action_buttons_icon()
+ var/mob/previous_mob = owner
if(do_after(M, 50, target=target_loc, extra_checks=CALLBACK(src, .proc/special_check)))
try_warp_servant(M, target_loc, 50, FALSE)
var/obj/machinery/computer/camera_advanced/console = cam.origin
console.remove_eye_control(M)
button_icon_state = "warp_down"
- owner.update_action_buttons_icon()
+ previous_mob.update_action_buttons_icon()
warping = FALSE
/datum/action/innate/clockcult/warp/proc/special_check()
diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm
index e7014a48a9d..973a98c068b 100644
--- a/code/modules/mapping/map_template.dm
+++ b/code/modules/mapping/map_template.dm
@@ -102,11 +102,11 @@
affected_turf.air_update_turf(TRUE)
affected_turf.levelupdate()
-/datum/map_template/proc/load_new_z()
+/datum/map_template/proc/load_new_z(list/level_traits = list(ZTRAIT_AWAY = TRUE))
var/x = round((world.maxx - width)/2)
var/y = round((world.maxy - height)/2)
- var/datum/space_level/level = SSmapping.add_new_zlevel(name, list(ZTRAIT_AWAY = TRUE))
+ var/datum/space_level/level = SSmapping.add_new_zlevel(name, level_traits)
var/datum/parsed_map/parsed = load_map(file(mappath), x, y, level.z_value, no_changeturf=(SSatoms.initialized == INITIALIZATION_INSSATOMS), placeOnTop=should_place_on_top)
var/list/bounds = parsed.bounds
if(!bounds)
diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm
index e2f72ef8b66..ff00cfc2efe 100644
--- a/code/modules/mob/living/silicon/robot/robot_modules.dm
+++ b/code/modules/mob/living/silicon/robot/robot_modules.dm
@@ -284,7 +284,11 @@
/obj/item/clock_module/abstraction_crystal,
/obj/item/clockwork/replica_fabricator,
/obj/item/stack/tile/brass/cyborg,
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/brass_spear)
+=======
+ /obj/item/clockwork/weapon/brass_spear)
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
moduleselect_icon = "standard"
hat_offset = -3
@@ -398,7 +402,11 @@
emag_modules = list(/obj/item/gun/energy/laser/cyborg)
ratvar_modules = list(
/obj/item/clock_module/abscond,
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/brass_spear,
+=======
+ /obj/item/clockwork/weapon/brass_spear,
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
/obj/item/clock_module/ocular_warden,
/obj/item/clock_module/vanguard)
cyborg_base_icon = "sec"
@@ -517,7 +525,11 @@
ratvar_modules = list(
/obj/item/clock_module/abscond,
/obj/item/clock_module/vanguard,
+<<<<<<< HEAD
/obj/item/twohanded/clockwork/brass_battlehammer) //honk
+=======
+ /obj/item/clockwork/weapon/brass_battlehammer) //honk
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
moduleselect_icon = "service"
cyborg_base_icon = "clown"
hat_offset = -2
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 52b7fc49e22..7aaddfed288 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -698,14 +698,14 @@
wires.interact(user)
else
return ..()
-
+
/obj/machinery/power/apc/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if(the_rcd.upgrade & RCD_UPGRADE_SIMPLE_CIRCUITS)
if(!has_electronics)
if(stat & BROKEN)
to_chat(user, "[src]'s frame is too damaged to support a circuit.")
return FALSE
- return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
+ return list("mode" = RCD_UPGRADE_SIMPLE_CIRCUITS, "delay" = 20, "cost" = 1)
else if(!cell)
if(stat & MAINT)
to_chat(user, "There's no connector for a power cell.")
@@ -891,7 +891,7 @@
var/mob/living/silicon/ai/AI = user
if(AI.apc_override == src)
return GLOB.conscious_state
- if(iseminence(user))
+ if(iseminence(user) && integration_cog)
return GLOB.conscious_state
return GLOB.default_state
diff --git a/config/Sage/game_options.txt b/config/Sage/game_options.txt
index 3918f17ea84..fdf4757573d 100644
--- a/config/Sage/game_options.txt
+++ b/config/Sage/game_options.txt
@@ -107,8 +107,8 @@ PROBABILITY REVOLUTION 4
PROBABILITY INCURSION 4
PROBABILITY NUCLEAR 4
PROBABILITY TRAITORBRO 3
+PROBABILITY CLOCKCULT 2
PROBABILITY WIZARD 1
-PROBABILITY CLOCKCULT 1
PROBABILITY MONKEY 0
PROBABILITY GANG 0
PROBABILITY CLOWNOPS 0
@@ -640,4 +640,4 @@ ROUNDSTART_BLUESPACE_MINERS 0
#BSMINER_RESEARCHABLE
## Do we want all the heads to get codes to spare safe, or just one highest in CoC?
-SPARE_ENFORCE_COC
\ No newline at end of file
+SPARE_ENFORCE_COC
diff --git a/config/game_options.txt b/config/game_options.txt
index 2f23c89a849..58f4a3d49e6 100644
--- a/config/game_options.txt
+++ b/config/game_options.txt
@@ -123,8 +123,12 @@ PROBABILITY INTERNAL_AFFAIRS 3
PROBABILITY TRAITORBRO 3
PROBABILITY WIZARD 2
PROBABILITY CLOWNOPS 2
+<<<<<<< HEAD
>>>>>>> d898aa7889 (Attempts to bring Dynamic more up to date (#3797))
PROBABILITY CLOCKCULT 1
+=======
+PROBABILITY CLOCKCULT 2
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))
PROBABILITY MONKEY 0
PROBABILITY GANG 0
PROBABILITY METEOR 0
@@ -659,4 +663,7 @@ BSMINER_RESEARCHABLE
## Do we want all the heads to get codes to spare safe, or just one highest in CoC?
#SPARE_ENFORCE_COC
+<<<<<<< HEAD
>>>>>>> f53db5eb08 (Moves spare to safe located in bridge, acting captain gets codes to it (#3838))
+=======
+>>>>>>> debaaab8bd (Clockwork fixes, gamemode map load refactor, eminence refactoring (#4612))