Clockies now can summon shields to bash nonbelievers into orbit. (#12252)

* Shield time

Adds a shield for clockies which empowers bashes via the damage it blocks. Might or might not compile yet. Icons going to be added in the next commit because I'd rather not have to revert all instead of just the icons if I do a fucky

* Icon time

Adds the icons for the clockie shield. Just the implementation + icons as of now, no way to get it. Might still not compile 😳

* Compilation issue resolution

Now it compiles. So it works. Maybe.

* Little change

Only harm-intent bashes amplify the bash / use energy.

* Fixes up shield.dms repeair proc and moves the brass shield repair there

Oh cool time to throw in a fix aswell, neat!

* Some tweaks

Buffs the shields armor and integrity since it was VERY easy to break with energy before, now its medium against those and very strong against ballistics. also a bit easier to accumulate charge because its ''only'' 50% block

* Some more stuff for the shield

Adds a spell to summon the shield (20dc time, 600kw cost, tier-two spell)
aswell as adding some ''fun'' for non-clockie users of the shield.

* typo man bad

* more spellchecking

* even more little tweaks

* clarification on a comment

* sound tweak

only plays a special sound if its an empowered bash

* final tweakies before PR

* Abuse safeguard

Yeeah might be best to not allow clockies to bash eachother for infinite charge.

* another typo fix

I really shouldn't have been coding stuff for this at 5 am...

* Safeguards for a VERY specific edge case

Would have caused some weird behavious for edge cases if not resetting the values, so I'm doing it to be sure.

* 5am code bad

same thing like the previous commit but not unreachable because of return statements.

* Applying requested changes / suggestions proposed by Ghommie

Early return statement done by the harmful / servant check, other returns / simillar done via . = ..()

* Formatting
This commit is contained in:
DeltaFire15
2020-05-18 14:47:44 +02:00
committed by GitHub
parent f624ce5fd4
commit 30f296b2c7
7 changed files with 106 additions and 5 deletions
+3 -3
View File
@@ -197,10 +197,10 @@
if(obj_integrity >= max_integrity)
to_chat(user, "<span class='warning'>[src] is already in perfect condition.</span>")
else
var/obj/item/stack/sheet/mineral/titanium/T = W
T.use(1)
var/obj/item/stack/S = W
S.use(1)
obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair [src] with [T].</span>")
to_chat(user, "<span class='notice'>You repair [src] with [S].</span>")
else
return ..()
@@ -0,0 +1,82 @@
//Subtype of (riot) shield because of already implemented shieldbash stuff aswell as integrity and simillar things
//ratvarian shield: A shield that absorbs energy from attacks and uses it to empower its bashes with remendous force. It is also quite resistant to damage, though less so against lasers and energy weaponry.
/obj/item/shield/riot/ratvarian
name = "ratvarian shield"
icon_state = "ratvarian_shield" //Its icons are in the same place the normal shields are in
item_state = "ratvarian_shield"
desc = "A resilient shield made out of brass.. It feels warm to the touch."
var/clockwork_desc = "A powerful shield of ratvarian making. It absorbs blocked attacks to charge devastating bashes."
armor = list("melee" = 80, "bullet" = 70, "laser" = -10, "energy" = -20, "bomb" = 60, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100)
shield_flags = SHIELD_FLAGS_DEFAULT
max_integrity = 300 //High integrity, extremely strong against melee / bullets, but still quite easy to destroy with lasers and energy
repair_material = /obj/item/stack/tile/brass
var/dam_absorbed = 0
var/bash_mult_steps = 30
var/max_bash_mult = 4
/obj/item/shield/riot/ratvarian/examine(mob/user)
if((is_servant_of_ratvar(user) || isobserver(user)))
desc = clockwork_desc
desc +="\n <span class='inathneq_small'>The shield has absorbed [dam_absorbed] damage, multiplying the effectiveness of its bashes by [calc_bash_mult()]</span>"
. = ..()
desc = initial(desc)
obj/item/shield/riot/ratvarian/proc/calc_bash_mult()
var/bash_mult = 0
if(!dam_absorbed)
return 1
else
bash_mult += round(clamp(1 + (dam_absorbed / bash_mult_steps), 1, max_bash_mult), 0.1) //Multiplies the effect of bashes by up to [max_bash_mult], though never less than one
return bash_mult
/obj/item/shield/riot/ratvarian/proc/calc_bash_absorb_use()
var/absorb_use = 0
absorb_use = max(0, round(dam_absorbed * (calc_bash_mult() / round(1 + (dam_absorbed / bash_mult_steps), 0.1)), 1)) //Calculates how much of the absorbed damage the bash would actually use, so its not wasted
return absorb_use
/obj/item/shield/riot/ratvarian/on_shield_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
if(!damage)
return ..()
if(!is_servant_of_ratvar(owner))
owner.visible_message("<span class='warning'>As [owner] blocks the attack with [src], [owner.p_they()] suddenly drops it, whincing in pain! </span>", "<span class='warning'>As you block the attack with [src], it heats up tremendously, forcing you to drop it from the pain alone! </span>")
owner.emote("scream")
playsound(src, 'sound/machines/fryer/deep_fryer_emerge.ogg', 50)
if(iscarbon(owner)) //Type safety for if a drone somehow got a shield (ratvar protect us)
var/mob/living/carbon/C = owner
var/obj/item/bodypart/part = C.get_holding_bodypart_of_item(src)
C.apply_damage((iscultist(C) ? damage * 2 : damage), BURN, (istype(part, /obj/item/bodypart/l_arm) ? BODY_ZONE_L_ARM : BODY_ZONE_R_ARM)) //Deals the damage to the holder instead of absorbing it instead + forcedrops. Doubled if a cultist of Nar'Sie.
else
owner.adjustFireLoss(iscultist(owner) ? damage * 2 : damage)
addtimer(CALLBACK(owner, /mob/living.proc/dropItemToGround, src, TRUE), 1)
else if(!is_servant_of_ratvar(attacker)) //No exploiting my snowflake mechanics
dam_absorbed += damage
playsound(owner, 'sound/machines/clockcult/steam_whoosh.ogg', 30)
if(damage <= 10) //The shield itself is hard to break, this DOES NOT modify the actual blocking-mechanic
damage = 0
else
damage -= 5
return ..()
/obj/item/shield/riot/ratvarian/shatter(mob/living/carbon/human/owner)
playsound(owner, 'sound/magic/clockwork/anima_fragment_death.ogg', 50)
new /obj/item/clockwork/alloy_shards/large(get_turf(src))
/obj/item/shield/riot/ratvarian/user_shieldbash(mob/living/user, atom/target, harmful)
if(!harmful || !is_servant_of_ratvar(user)) // No fun for non-clockies, but you can keep the normal bashes. Until you try to block with it.
shieldbash_knockback = initial(shieldbash_knockback)
shieldbash_brutedamage = initial(shieldbash_brutedamage) //Prevention for funky stuff that might happen otherwise
shieldbash_stamdmg = initial(shieldbash_stamdmg)
return ..()
var/actual_bash_mult = calc_bash_mult()
shieldbash_knockback = round(initial(shieldbash_knockback) * actual_bash_mult, 1) //Modifying the strength of the bash, done with initial() to prevent magic-number issues if the original shieldbash values are changed
shieldbash_brutedamage = round(initial(shieldbash_brutedamage) * actual_bash_mult, 1) //Where I think of it, better round this stuff because we don't need even more things that deal like 3.25 damage
shieldbash_stamdmg = round(initial(shieldbash_stamdmg) * actual_bash_mult, 1) //Like 20 brute and 60 stam + a fuckton of knockback at the moment (at maximum charge), seems mostly fine? I think?
. = ..()
if(.) //If this bash actually hit someone
if(actual_bash_mult > 1)
playsound(user, 'sound/magic/fireball.ogg', 50, TRUE, frequency = 1.25)
dam_absorbed -= calc_bash_absorb_use()
return
@@ -100,6 +100,24 @@
quickbind = TRUE
quickbind_desc = "Creates a Judicial Visor, which can smite an area, applying Belligerent and briefly stunning."
//Nezbere's shield: Creates a ratvarian shield which absorbs attacks, see ratvarian_shield.dm for details.
/datum/clockwork_scripture/create_object/nezberes_shield
descname = "Shield with empowerable bashes"
name = "Nezbere's shield"
desc = "Creates a shield which generates charge from blocking damage, using it to empower its bashes tremendously. It is repaired with brass, and while very durable, extremely weak to lasers and, even more so, to energy weaponry."
invocations = list("Shield me...", "... from the coming dark!")
channel_time = 20
power_cost = 600 //Shouldn't be too spammable but not too hard to get either
whispered = TRUE
creator_message = "You form a ratvarian shield, which is capable of absorbing blocked attacks to empower its bashes."
object_path = /obj/item/shield/riot/ratvarian
usage_tip = "Bashes will only use charge when performed with intent to harm."
tier = SCRIPTURE_SCRIPT
space_allowed = TRUE
primary_component = VANGUARD_COGWHEEL
sort_priority = 5
quickbind = TRUE
quickbind_desc = "Creates a Ratvarian shield, which can absorb energy from attacks for use in powerful bashes."
//Clockwork Armaments: Grants the invoker the ability to call forth a Ratvarian spear and clockwork armor.
/datum/clockwork_scripture/clockwork_armaments
@@ -113,7 +131,7 @@
usage_tip = "Throwing the spear at a mob will do massive damage and knock them down, but break the spear. You will need to wait for 30 seconds before resummoning it."
tier = SCRIPTURE_SCRIPT
primary_component = VANGUARD_COGWHEEL
sort_priority = 5
sort_priority = 6
important = TRUE
quickbind = TRUE
quickbind_desc = "Permanently binds clockwork armor and a Ratvarian spear to you."
@@ -213,7 +231,7 @@
usage_tip = "This gateway is strictly one-way and will only allow things through the invoker's portal."
tier = SCRIPTURE_SCRIPT
primary_component = GEIS_CAPACITOR
sort_priority = 6
sort_priority = 7
quickbind = TRUE
quickbind_desc = "Allows you to create a one-way Spatial Gateway to a living Servant or Clockwork Obelisk."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

+1
View File
@@ -1468,6 +1468,7 @@
#include "code\modules\antagonists\clockcult\clock_items\soul_vessel.dm"
#include "code\modules\antagonists\clockcult\clock_items\wraith_spectacles.dm"
#include "code\modules\antagonists\clockcult\clock_items\clock_weapons\_call_weapon.dm"
#include "code\modules\antagonists\clockcult\clock_items\clock_weapons\ratvarian_shield.dm"
#include "code\modules\antagonists\clockcult\clock_items\clock_weapons\ratvarian_spear.dm"
#include "code\modules\antagonists\clockcult\clock_mobs\_eminence.dm"
#include "code\modules\antagonists\clockcult\clock_mobs\clockwork_marauder.dm"