Skip to content

Commit

Permalink
balance: Clockwork Cult Balance Update (ss220-space#4024)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeebBeebBoob authored and SuhEugene committed Dec 22, 2023
1 parent 89dd6cf commit ff41069
Show file tree
Hide file tree
Showing 15 changed files with 283 additions and 118 deletions.
26 changes: 15 additions & 11 deletions code/__DEFINES/clockwork.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
#define FASTSWORD_SPELL 2
// Buckler
#define PUSHOFF_SPELL 1
#define FLASH_SPELL 2
// Clockwork robe
#define INVIS_SPELL 1
#define SPEED_SPELL 2
// armour
#define REFLECT_SPELL 1
#define FLASH_SPELL 2
#define ABSORB_SPELL 3
#define ARMOR_SPELL 4
#define ABSORB_SPELL 2
#define ARMOR_SPELL 3
// Clockwork gloves
#define FASTPUNCH_SPELL 1
#define STUNHAND_SPELL 2
Expand All @@ -47,7 +47,7 @@ GLOBAL_LIST_INIT(clockslab_spells, list(
new /datum/spell_enchant("Force Passage", KNOCK_SPELL, 100),
new /datum/spell_enchant("Terraform", REFORM_SPELL, 40),
new /datum/spell_enchant("Teleportation", TELEPORT_SPELL, 25, 5), // has do_after 1.5 seconds
new /datum/spell_enchant("Seal Wounds", HEAL_SPELL, 100, 5),
new /datum/spell_enchant("Seal Wounds", HEAL_SPELL, 100, 7),
new /datum/spell_enchant("Hidings Clock", HIDE_SPELL, 100)
))
GLOBAL_LIST_INIT(spear_spells, list(
Expand All @@ -63,6 +63,7 @@ GLOBAL_LIST_INIT(sword_spells, list(
new /datum/spell_enchant("Swordsman", FASTSWORD_SPELL, 100, 6, spell_action = TRUE)
))
GLOBAL_LIST_INIT(shield_spells, list(
new /datum/spell_enchant("Flash", FLASH_SPELL, 25, spell_action = TRUE),
new /datum/spell_enchant("Push off", PUSHOFF_SPELL, 100)
))
GLOBAL_LIST_INIT(robe_spells, list(
Expand All @@ -71,8 +72,7 @@ GLOBAL_LIST_INIT(robe_spells, list(
))
GLOBAL_LIST_INIT(armour_spells, list(
new /datum/spell_enchant("Reflection", REFLECT_SPELL, 100, 8),
new /datum/spell_enchant("Flash", FLASH_SPELL, 25, spell_action = TRUE),
new /datum/spell_enchant("Absorb", ABSORB_SPELL, 100, 8),
new /datum/spell_enchant("Absorb", ABSORB_SPELL, 100, 4),
new /datum/spell_enchant("Harden plates", ARMOR_SPELL, 100, 10, spell_action = TRUE)
))
GLOBAL_LIST_INIT(gloves_spell, list(
Expand All @@ -88,22 +88,26 @@ GLOBAL_LIST_INIT(shard_spells, list(

/// Power gains permanent
#define CLOCK_POWER_CONVERT 200
#define CLOCK_POWER_SACRIFICE 500
#define CLOCK_POWER_SACRIFICE 600
/// Power gains as time progresses. Goes in process() so it makes x power per second.
#define CLOCK_POWER_BEACON 2
#define CLOCK_POWER_BEACON 5
#define CLOCK_POWER_GENERATOR 10
#define CLOCK_POWER_COG 1
#define COG_MAX_SIPHON_THRESHOLD 0.25 //The cog will not siphon power if the APC's cell is at this % of power
// amount of metal per brass
#define CLOCK_METAL_TO_BRASS 10
#define CLOCK_METAL_TO_BRASS 5
//Cogscarab: a wind up timer of how long can droney live without beacon
#define CLOCK_MAX_WIND_UP_TIMER 150
#define CLOCK_MAX_WIND_UP_TIMER 200
//Cogscarab: Maximum amount of cogscarab on one fabricator.
#define MAX_COGSCRAB_PER_FABRICATOR 2
//Cogscarab: Amount of time to wait until a new cogscrab is ready.
#define TIME_NEW_COGSCRAB 120

// Clockwork Status
/// At what population does it switch to highpop values
#define CLOCK_POPULATION_THRESHOLD 70
/// Power per crew demand. (Lowpop)
#define CLOCK_POWER_PER_CREW_LOW 320
#define CLOCK_POWER_PER_CREW_LOW 260
/// Percent for power to reveal (Lowpop)
#define CLOCK_POWER_REVEAL_LOW 0.7
/// Percent clockers to reveal (Lowpop)
Expand Down
147 changes: 80 additions & 67 deletions code/game/gamemodes/clockwork/clockwork_items.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// A Clockwork slab. Ratvar's tool to cast most of essential spells.
/obj/item/clockwork/clockslab
name = "Clockwork slab"
name = "clockwork slab"
desc = "A strange metal tablet. A clock in the center turns around and around."
icon = 'icons/obj/clockwork.dmi'
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
Expand Down Expand Up @@ -40,7 +40,7 @@
return
if(alert(user, "Do you want to reveal clockwork slab?","Revealing!","Yes","No") != "Yes")
return
name = "Clockwork slab"
name = "clockwork slab"
desc = "A strange metal tablet. A clock in the center turns around and around."
icon = 'icons/obj/clockwork.dmi'
icon_state = "clock_slab"
Expand Down Expand Up @@ -199,7 +199,7 @@
deplete_spell()

/obj/item/clockwork
name = "Clockwork item name"
name = "clockwork item name"
icon = 'icons/obj/clockwork.dmi'
resistance_flags = FIRE_PROOF | ACID_PROOF

Expand All @@ -210,13 +210,13 @@
icon = 'icons/obj/clockwork.dmi'
icon_state = "ratvarian_spear0"
slot_flags = SLOT_BACK
force = 12
force_unwielded = 12
force = 10
force_unwielded = 10
force_wielded = 20
throwforce = 50
throwforce = 35
armour_penetration = 40
sharp = TRUE
embed_chance = 85
embed_chance = 70
embedded_ignore_throwspeed_threshold = TRUE
attack_verb = list("stabbed", "poked", "slashed")
hitsound = 'sound/weapons/bladeslice.ogg'
Expand Down Expand Up @@ -597,6 +597,24 @@
if(enchant_type)
overlays += "brass_buckler_overlay_[enchant_type]"

/obj/item/shield/clock_buckler/attack_self(mob/user)
. = ..()
if(enchant_type == FLASH_SPELL)
if(!user.is_in_hands(src))
to_chat(user, "<span class='notice'>You should wear [src]!</span>")
return
playsound(loc, 'sound/effects/phasein.ogg', 100, 1)
set_light(2, 1, COLOR_WHITE)
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, set_light), 0), 0.2 SECONDS)
user.visible_message("<span class='disarm'>[user]'s [src.name] emits a blinding light!</span>", "<span class='danger'>Your [src.name] emits a blinding light!</span>")
for(var/mob/living/carbon/M in oviewers(3, user))
if(isclocker(M))
return
if(M.flash_eyes(2, 1))
M.AdjustConfused(10 SECONDS)
add_attack_logs(user, M, "Flashed with [src]")
deplete_spell()

/obj/item/shield/clock_buckler/afterattack(atom/target, mob/user, proximity, params)
. = ..()
if(!proximity || !isliving(target))
Expand Down Expand Up @@ -775,7 +793,7 @@
item_state = "clockwork_cuirass"
w_class = WEIGHT_CLASS_BULKY
resistance_flags = FIRE_PROOF | ACID_PROOF
armor = list("melee" = 40, "bullet" = 30, "laser" = 30, "energy" = 30, "bomb" = 60, "bio" = 30, "rad" = 30, "fire" = 100, "acid" = 100)
armor = list("melee" = 50, "bullet" = 40, "laser" = 50, "energy" = 30, "bomb" = 50, "bio" = 30, "rad" = 30, "fire" = 100, "acid" = 100)
flags_inv = HIDEJUMPSUIT
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
allowed = list(/obj/item/clockwork, /obj/item/twohanded/ratvarian_spear, /obj/item/twohanded/clock_hammer, /obj/item/melee/clock_sword)
Expand All @@ -787,10 +805,9 @@
"Ash Walker Shaman" = 'icons/mob/clothing/species/unathi/suit.dmi',
"Draconid" = 'icons/mob/clothing/species/unathi/suit.dmi'
)
var/absorb_uses = 2
var/reflect_uses = 3
var/reflect_uses = 4
var/normal_armor
var/harden_armor = list("melee" = 80, "bullet" = 60, "laser" = 50, "energy" = 50, "bomb" = 100, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
var/harden_armor = list("melee" = 80, "bullet" = 70, "laser" = 80, "energy" = 60, "bomb" = 100, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)

/obj/item/clothing/suit/armor/clockwork_fake
name = "clockwork cuirass"
Expand Down Expand Up @@ -822,11 +839,7 @@
owner.visible_message("<span class='danger'>[attack_text] is absorbed by [src] sparks!</span>")
playsound(loc, "sparks", 100, TRUE)
new /obj/effect/temp_visual/ratvar/sparks(get_turf(owner))
if(absorb_uses <= 0)
absorb_uses = initial(absorb_uses)
deplete_spell()
else
absorb_uses--
deplete_spell()
return TRUE
return FALSE

Expand Down Expand Up @@ -857,35 +870,19 @@
if(!iscarbon(user))
return
var/mob/living/carbon/carbon = user
switch(enchant_type)
if(ARMOR_SPELL)
if(carbon.wear_suit != src)
to_chat(carbon, "<span class='notice'>You should wear [src]!</span>")
return
carbon.visible_message("<span class='danger'>[carbon] concentrates as [carbon.p_their()] curiass shifts his plates!</span>",
"<span class='notice'>The [src.name] becomes more hardened as the plates becomes to shift for any attack!</span>")
//armor = list("melee" = 80, "bullet" = 60, "laser" = 50, "energy" = 50, "bomb" = 100, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
armor = harden_armor
flags |= NODROP
enchant_type = CASTING_SPELL
add_attack_logs(carbon, carbon, "Hardened [src]", ATKLOG_ALL)
set_light(1.5, 0.8, COLOR_RED)
addtimer(CALLBACK(src, PROC_REF(reset_armor), carbon), 12 SECONDS)
if(FLASH_SPELL)
if(carbon.wear_suit != src)
to_chat(carbon, "<span class='notice'>You should wear [src]!</span>")
return
playsound(loc, 'sound/effects/phasein.ogg', 100, 1)
set_light(2, 1, COLOR_WHITE)
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, set_light), 0), 0.2 SECONDS)
carbon.visible_message("<span class='disarm'>[carbon]'s [src.name] emits a blinding light!</span>", "<span class='danger'>Your [src.name] emits a blinding light!</span>")
for(var/mob/living/carbon/M in oviewers(3, carbon))
if(isclocker(M))
return
if(M.flash_eyes(2, 1))
M.AdjustConfused(10 SECONDS)
add_attack_logs(carbon, M, "Flashed with [src]")
deplete_spell()
if(enchant_type == ARMOR_SPELL)
if(carbon.wear_suit != src)
to_chat(carbon, "<span class='notice'>You should wear [src]!</span>")
return
carbon.visible_message("<span class='danger'>[carbon] concentrates as [carbon.p_their()] curiass shifts his plates!</span>",
"<span class='notice'>The [src.name] becomes more hardened as the plates becomes to shift for any attack!</span>")
//armor = list("melee" = 80, "bullet" = 60, "laser" = 50, "energy" = 50, "bomb" = 100, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)
armor = harden_armor
flags |= NODROP
enchant_type = CASTING_SPELL
add_attack_logs(carbon, carbon, "Hardened [src]", ATKLOG_ALL)
set_light(1.5, 0.8, COLOR_RED)
addtimer(CALLBACK(src, PROC_REF(reset_armor), carbon), 12 SECONDS)

/obj/item/clothing/suit/armor/clockwork/proc/reset_armor(mob/user)
to_chat(user, "<span class='notice'>The [src] stops shifting...</span>")
Expand Down Expand Up @@ -1177,33 +1174,51 @@
desc = "A small cogwheel that fits in the palm of your hand."
icon_state = "gear"
w_class = WEIGHT_CLASS_TINY
var/obj/machinery/power/apc/apc

/obj/item/clockwork/integration_cog/Initialize()
. = ..()
transform *= 0.5 //little cog!
START_PROCESSING(SSobj, src)

/obj/item/clockwork/integration_cog/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/machinery/integration_cog
name = "integration cog"
desc = "You shouldn't see that! Call dev on that!"
icon = null
anchored = 1
active_power_usage = 100 // In summary it costs 500 power. Most areas costs around 800, with top being medbay at around 8000. Fair number.
var/obj/machinery/power/apc/apc
var/next_whoosh = 120

/obj/item/clockwork/integration_cog/process()
if(!apc)
if(istype(loc, /obj/machinery/power/apc))
apc = loc
else
STOP_PROCESSING(SSobj, src)
/obj/machinery/integration_cog/Initialize(mapload)
. = ..()
if(istype(loc, /obj/machinery/power/apc))
apc = loc
else
var/obj/item/stock_parts/cell/cell = apc.get_cell()
if(!cell)
return
if(cell.charge / cell.maxcharge > COG_MAX_SIPHON_THRESHOLD)
cell.use(round(0.001*cell.maxcharge,1))
adjust_clockwork_power(CLOCK_POWER_COG) //Power is shared, so only do it once; this runs very quickly so it's about CLOCK_POWER_COG(1)/second
if(prob(1))
playsound(apc, 'sound/machines/clockcult/steam_whoosh.ogg', 5, TRUE, SILENCED_SOUND_EXTRARANGE)
new/obj/effect/temp_visual/small_smoke(get_turf(apc))
log_runtime(EXCEPTION("Invalid location for Integration cog"))

/obj/machinery/integration_cog/emp_act(severity)
return

/obj/machinery/integration_cog/process(seconds_per_tick)
if(apc.cell?.charge > 0 && apc.operating)
adjust_clockwork_power(CLOCK_POWER_COG * seconds_per_tick)
if(next_whoosh <= 0)
playsound(apc, 'sound/machines/clockcult/steam_whoosh.ogg', 5, TRUE, SILENCED_SOUND_EXTRARANGE)
new/obj/effect/temp_visual/small_smoke(get_turf(apc))
next_whoosh = 60 + rand(60) // 1-2 minutes
next_whoosh -= seconds_per_tick
return TRUE
return FALSE

/obj/machinery/integration_cog/auto_use_power()
if(powered(EQUIP))
use_power(active_power_usage, EQUIP)
if(powered(LIGHT))
use_power(active_power_usage, LIGHT)
if(powered(ENVIRON))
use_power(active_power_usage, ENVIRON)
use_power(200)
adjust_clockwork_power(CLOCK_POWER_COG)
return 1

//Clockwork module
/obj/item/borg/upgrade/clockwork
Expand All @@ -1215,8 +1230,6 @@
/obj/item/borg/upgrade/clockwork/action(mob/living/silicon/robot/R)
if(..())
if(R.module?.type == /obj/item/robot_module/clockwork)
R.emp_protection = TRUE
R.speed = -0.5
R.pdahide = TRUE
else
R.ratvar_act()
Expand Down
Loading

0 comments on commit ff41069

Please sign in to comment.