mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Adds a new spellblade enchantment: Temporal. Also adds lightning knockdown back. (#27314)
* cutting edge * remove the message admins lmao * eh name should just be temporal * undef * Apply suggestions from code review Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> * updates description, removes shock change as it happens on live now I guess --------- Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -138,6 +138,10 @@
|
||||
|
||||
#define STATUS_EFFECT_C_FOAMED /datum/status_effect/c_foamed
|
||||
|
||||
#define STATUS_EFFECT_TEMPORAL_SLASH /datum/status_effect/temporal_slash
|
||||
|
||||
#define STATUS_EFFECT_TEMPORAL_SLASH_FINISHER /datum/status_effect/temporal_slash_finisher
|
||||
|
||||
//#define STATUS_EFFECT_NECROPOLIS_CURSE /datum/status_effect/necropolis_curse
|
||||
//#define CURSE_BLINDING 1 //makes the edges of the target's screen obscured
|
||||
//#define CURSE_SPAWNING 2 //spawns creatures that attack the target only
|
||||
|
||||
@@ -1406,3 +1406,64 @@
|
||||
duration = 5 SECONDS
|
||||
alert_type = null
|
||||
status_type = STATUS_EFFECT_REPLACE
|
||||
|
||||
/// This is the threshold where the attack will stun on the last hit. Why? Because it is cool, that's why.
|
||||
#define FINISHER_THRESHOLD 7
|
||||
|
||||
/datum/status_effect/temporal_slash
|
||||
id = "temporal_slash"
|
||||
duration = 3 SECONDS
|
||||
status_type = STATUS_EFFECT_REFRESH
|
||||
alert_type = null
|
||||
/// How many times the user has been cut. Each cut adds a damage value below
|
||||
var/cuts = 1
|
||||
/// How much damage the blade will do each slice
|
||||
var/damage_per_cut = 20
|
||||
|
||||
/datum/status_effect/temporal_slash/on_creation(mob/living/new_owner, cut_damage = 20)
|
||||
. = ..()
|
||||
damage_per_cut = cut_damage
|
||||
|
||||
/datum/status_effect/temporal_slash/refresh()
|
||||
cuts++
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/temporal_slash/on_remove()
|
||||
owner.apply_status_effect(STATUS_EFFECT_TEMPORAL_SLASH_FINISHER, cuts, damage_per_cut) //We apply this to a new status effect, to avoid refreshing while on_remove happens.
|
||||
|
||||
/datum/status_effect/temporal_slash_finisher
|
||||
id = "temporal_slash_finisher"
|
||||
status_type = STATUS_EFFECT_UNIQUE
|
||||
alert_type = null
|
||||
tick_interval = 0.25 SECONDS
|
||||
/// How many times the user has been cut. Each cut adds a damage value below
|
||||
var/cuts = 1
|
||||
/// How much damage the blade will do each slice
|
||||
var/damage_per_cut = 20
|
||||
/// Have we done enough damage to trigger the finisher?
|
||||
var/finishing_cuts = FALSE
|
||||
|
||||
/datum/status_effect/temporal_slash_finisher/on_creation(mob/living/new_owner, final_cuts = 1, cut_damage = 20)
|
||||
. = ..()
|
||||
cuts = final_cuts
|
||||
damage_per_cut = cut_damage
|
||||
if(ismegafauna(owner))
|
||||
damage_per_cut *= 4 //This will deal 40 damage bonus per cut on megafauna as a miner, and 80 as a wizard. To kill a megafauna, you need to hit it 48 times. You don't get the buffs of a crusher though. Also you already killed bubblegum, so, you know.
|
||||
if(cuts >= FINISHER_THRESHOLD)
|
||||
finishing_cuts = TRUE
|
||||
new /obj/effect/temp_visual/temporal_slash(get_turf(owner), owner)
|
||||
|
||||
/datum/status_effect/temporal_slash_finisher/tick()
|
||||
. = ..()
|
||||
owner.visible_message("<span class='danger'>[owner] gets slashed by a cut through spacetime!</span>", "<span class='userdanger'>You get slashed by a cut through spacetime!</span>")
|
||||
playsound(owner, 'sound/weapons/rapierhit.ogg', 50, TRUE)
|
||||
owner.apply_damage(damage_per_cut, BRUTE, pick(BODY_ZONE_CHEST, BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_ARM, BODY_ZONE_R_LEG), 0, TRUE, null, FALSE)
|
||||
cuts--
|
||||
if(cuts <= 0)
|
||||
if(finishing_cuts)
|
||||
owner.Weaken(7 SECONDS)
|
||||
qdel(src)
|
||||
else
|
||||
new /obj/effect/temp_visual/temporal_slash(get_turf(owner), owner)
|
||||
|
||||
#undef FINISHER_THRESHOLD
|
||||
|
||||
@@ -520,7 +520,7 @@
|
||||
|
||||
/datum/spellbook_entry/item/spell_blade
|
||||
name = "Spellblade"
|
||||
desc = "A magical sword that can be enchanted by using it in hand to have a unique on-hit effect. Lighting: arcs electricity between nearby targets, stunning and damaging them. Fire: creates a massive ball of fire on hit, and makes the wielder immune to fire. Bluespace: allows you to strike people from a range, teleporting you to them. Forceshield: on hit, makes you stun immune for 3 seconds and reduces damage by half."
|
||||
desc = "A magical sword that can be enchanted by using it in hand to have a unique on-hit effect. Lighting: arcs electricity between nearby targets, stunning and damaging them. Fire: creates a massive ball of fire on hit, and makes the wielder immune to fire. Bluespace: allows you to strike people from a range, teleporting you to them. Forceshield: on hit, makes you stun immune for 3 seconds and reduces damage by half. Spacetime: will slice faster but weaker and will curse the target, slashing them a few seconds after they have not been swinged at for each hit"
|
||||
item_path = /obj/item/melee/spellblade
|
||||
category = "Weapons and Armors"
|
||||
|
||||
|
||||
@@ -335,11 +335,13 @@
|
||||
var/static/list/options = list("Lightning" = image(icon = 'icons/effects/spellblade.dmi', icon_state = "chain_lightning"),/// todo add icons for these
|
||||
"Fire" = image(icon = 'icons/effects/spellblade.dmi', icon_state = "fire"),
|
||||
"Bluespace" = image(icon = 'icons/effects/spellblade.dmi', icon_state = "blink"),
|
||||
"Forcewall" = image(icon = 'icons/effects/spellblade.dmi', icon_state = "shield"),)
|
||||
"Forcewall" = image(icon = 'icons/effects/spellblade.dmi', icon_state = "shield"),
|
||||
"Temporal Slash" = image(icon = 'icons/effects/spellblade.dmi', icon_state = "spacetime"),)
|
||||
var/static/list/options_to_type = list("Lightning" = /datum/enchantment/lightning,
|
||||
"Fire" = /datum/enchantment/fire,
|
||||
"Bluespace" = /datum/enchantment/bluespace,
|
||||
"Forcewall" = /datum/enchantment/forcewall,)
|
||||
"Forcewall" = /datum/enchantment/forcewall,
|
||||
"Temporal Slash" = /datum/enchantment/time_slash,)
|
||||
|
||||
var/choice = show_radial_menu(user, src, options)
|
||||
if(!choice)
|
||||
@@ -349,6 +351,7 @@
|
||||
/obj/item/melee/spellblade/proc/add_enchantment(new_enchant, mob/living/user, intentional = TRUE)
|
||||
var/datum/enchantment/E = new new_enchant
|
||||
enchant = E
|
||||
E.on_apply_to_blade(src)
|
||||
E.on_gain(src, user)
|
||||
E.power *= power
|
||||
if(intentional)
|
||||
@@ -378,6 +381,8 @@
|
||||
var/cooldown = -1
|
||||
/// If the spellblade has traits, has it applied them?
|
||||
var/applied_traits = FALSE
|
||||
/// A modifier that can be appled to the cooldown after the enchantment has been initialized. Used by the forcewall spellblade
|
||||
var/cooldown_multiplier = 1
|
||||
|
||||
/datum/enchantment/proc/on_hit(mob/living/target, mob/living/user, proximity, obj/item/melee/spellblade/S)
|
||||
if(world.time < cooldown)
|
||||
@@ -388,7 +393,7 @@
|
||||
return FALSE
|
||||
if(!ranged && !proximity)
|
||||
return FALSE
|
||||
cooldown = world.time + initial(cooldown)
|
||||
cooldown = world.time + (initial(cooldown) * cooldown_multiplier)
|
||||
return TRUE
|
||||
|
||||
/datum/enchantment/proc/on_gain(obj/item/melee/spellblade, mob/living/user)
|
||||
@@ -397,9 +402,12 @@
|
||||
/datum/enchantment/proc/toggle_traits(obj/item/I, mob/living/user)
|
||||
return
|
||||
|
||||
/datum/enchantment/proc/on_apply_to_blade(obj/item/melee/spellblade)
|
||||
return
|
||||
|
||||
/datum/enchantment/lightning
|
||||
name = "lightning"
|
||||
desc = "this blade conducts arcane energy to arc between its victims. It also makes the user immune to shocks."
|
||||
desc = "this blade conducts arcane energy to arc between its victims. It also makes the user immune to shocks"
|
||||
// the damage of the first lighting arc.
|
||||
power = 20
|
||||
cooldown = 3 SECONDS
|
||||
@@ -473,6 +481,11 @@
|
||||
name = "forcewall"
|
||||
desc = "this blade will partially shield you against attacks and stuns for a short duration after striking a foe"
|
||||
cooldown = 4 SECONDS
|
||||
// multiplier for how much the cooldown is reduced by. A miner spellblade can only buff every 4 seconds, making it more vunerable, the wizard one is much more consistant.
|
||||
power = 2
|
||||
|
||||
/datum/enchantment/forcewall/on_apply_to_blade(obj/item/melee/spellblade)
|
||||
cooldown_multiplier /= power
|
||||
|
||||
/datum/enchantment/forcewall/on_hit(mob/living/target, mob/living/user, proximity, obj/item/melee/spellblade/S)
|
||||
. = ..()
|
||||
@@ -482,7 +495,7 @@
|
||||
|
||||
/datum/enchantment/bluespace
|
||||
name = "bluespace"
|
||||
desc = "this the fabric of space, transporting its wielder over medium distances to strike foes"
|
||||
desc = "this blade will cut through the fabric of space, transporting its wielder over medium distances to strike foes"
|
||||
cooldown = 2.5 SECONDS
|
||||
ranged = TRUE
|
||||
// the number of deciseconds of stun applied by the teleport strike
|
||||
@@ -511,6 +524,51 @@
|
||||
S.melee_attack_chain(user, target)
|
||||
target.Weaken(power)
|
||||
|
||||
/datum/enchantment/time_slash
|
||||
name = "temporal"
|
||||
desc = "this blade will slice faster but weaker, and will curse the target, slashing them a few seconds after they have not been swinged at for each hit"
|
||||
power = 15 // This should come out to 40 damage per hit. However, delayed.
|
||||
|
||||
/datum/enchantment/time_slash/on_apply_to_blade(obj/item/melee/spellblade)
|
||||
spellblade.force /= 2
|
||||
|
||||
/datum/enchantment/time_slash/on_hit(mob/living/target, mob/living/user, proximity, obj/item/melee/spellblade/S)
|
||||
user.changeNext_move(CLICK_CD_MELEE * 0.5)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
target.apply_status_effect(STATUS_EFFECT_TEMPORAL_SLASH, power)
|
||||
|
||||
/obj/effect/temp_visual/temporal_slash
|
||||
name = "temporal slash"
|
||||
desc = "A cut through spacetime"
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state = "arcane_barrage"
|
||||
layer = FLY_LAYER
|
||||
plane = GRAVITY_PULSE_PLANE
|
||||
appearance_flags = PIXEL_SCALE|LONG_GLIDE
|
||||
duration = 0.5 SECONDS
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT // Let us not have this visual block clicks
|
||||
/// Who we are orbiting
|
||||
var/target
|
||||
/// A funky color matrix to recolor the slash to
|
||||
var/list/funky_color_matrix = list(0.4,0,0,0, 0,1.1,0,0, 0,0,1.65,0, -0.3,0.15,0,1, 0,0,0,0)
|
||||
|
||||
/obj/effect/temp_visual/temporal_slash/Initialize(mapload, new_target)
|
||||
. = ..()
|
||||
target = new_target
|
||||
INVOKE_ASYNC(src, TYPE_PROC_REF(/atom/movable, orbit), target, 0, FALSE, 0, 0, FALSE, TRUE)
|
||||
var/matrix/M = matrix()
|
||||
M.Scale(1, 2)
|
||||
M.Turn(rand(0, 360))
|
||||
transform = M
|
||||
addtimer(CALLBACK(src, PROC_REF(animate_slash)), 0.25 SECONDS)
|
||||
|
||||
/obj/effect/temp_visual/temporal_slash/proc/animate_slash()
|
||||
plane = -1
|
||||
color = funky_color_matrix
|
||||
animate(src, alpha = 0, time = duration, easing = EASE_OUT)
|
||||
|
||||
/obj/item/melee/spellblade/random
|
||||
power = 0.5
|
||||
|
||||
@@ -519,6 +577,7 @@
|
||||
var/list/options = list(/datum/enchantment/lightning,
|
||||
/datum/enchantment/fire,
|
||||
/datum/enchantment/forcewall,
|
||||
/datum/enchantment/bluespace,)
|
||||
/datum/enchantment/bluespace,
|
||||
/datum/enchantment/time_slash,)
|
||||
var/datum/enchantment/E = pick(options)
|
||||
add_enchantment(E, intentional = FALSE)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user