Adds the vortex feedback inversion arm. (#19821)

* start of mess

* reflect/parries works

* more pog-ress

* temp icons, .33 to 0.4

* more work, sound, rnd, fixes me breaking shields

* removes this since open pr fixes

* better codee

* attack log

* Final changes / sprites by ramon

* fixes issue

* shoot ramon for the white pixel :^)

* But what if it was a purple glass shard

* Fixes the throw parry

* sorry for so many commits, lower callback

* Apply suggestions from code review

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

* Early return, no need to typecast

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2022-12-27 10:45:59 -05:00
committed by GitHub
parent 4cd66496a5
commit f86374a504
13 changed files with 169 additions and 15 deletions
@@ -411,3 +411,127 @@
contents = newlist(/obj/item/mop/advanced)
action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/janitor.dmi')
action_icon_state = list(/datum/action/item_action/organ_action/toggle = "advmop")
/obj/item/organ/internal/cyberimp/arm/v1_arm
name = "vortex feedback arm implant"
desc = "An implant, that when deployed surrounds the users arm in armor and circuitry, allowing them to redirect nearby projectiles with feedback from the vortex anomaly core."
origin_tech = "combat=6;magnets=6;biotech=6;engineering=6"
icon = 'icons/obj/items.dmi'
icon_state = "v1_arm"
parent_organ = "l_arm" //Left arm by default
slot = "l_arm_device"
contents = newlist(/obj/item/shield/v1_arm)
action_icon = list(/datum/action/item_action/organ_action/toggle = 'icons/obj/items.dmi')
action_icon_state = list(/datum/action/item_action/organ_action/toggle = "v1_arm")
var/disabled = FALSE
/obj/item/organ/internal/cyberimp/arm/v1_arm/emp_act(severity)
if(emp_proof && !disabled)
return
disabled = TRUE
addtimer(VARSET_CALLBACK(src, disabled, FALSE), 10 SECONDS)
/obj/item/organ/internal/cyberimp/arm/v1_arm/Extend(obj/item/item)
if(disabled)
to_chat(owner, "<span class='warning'>Your arm fails to extend!</span>")
return FALSE
..()
/obj/item/organ/internal/cyberimp/arm/v1_arm/Retract()
if(disabled)
to_chat(owner, "<span class='warning'>Your arm fails to retract!</span>")
return FALSE
..()
/obj/item/shield/v1_arm
name = "vortex feedback arm" //format is they are holding x
desc = "A modification to a users arm, allowing them to use a vortex core energy feedback, to parry, reflect, and even empower projectile attack. Rumors that it runs on the users blood are unconfirmed"
icon_state = "v1_arm"
item_state = "v1_arm"
sprite_sheets_inhand = list("Drask" = 'icons/mob/clothing/species/drask/held.dmi', "Vox" = 'icons/mob/clothing/species/vox/held.dmi')
force = 20 //bonk, not sharp
attack_verb = list("slamed", "punched", "parried", "judged", "styled on", "disrespected", "interupted", "gored")
hitsound = 'sound/effects/bang.ogg'
light_power = 3
light_range = 0
light_color = "#9933ff"
hit_reaction_chance = -1
/// The damage the reflected projectile will be increased by
var/reflect_damage_boost = 10
/// The cap of the reflected damage. Damage will not be increased above 50, however it will not be reduced to 50 either.
var/reflect_damage_cap = 50
var/disabled = FALSE
var/force_when_disabled = 5 //still basically a metal pipe, just hard to move
/obj/item/shield/v1_arm/emp_act(severity)
if(disabled)
return
to_chat(loc, "<span class='warning'>Your arm seises up!</span>")
disabled = TRUE
force = force_when_disabled
addtimer(CALLBACK(src, PROC_REF(reboot)), 10 SECONDS)
/obj/item/shield/v1_arm/proc/reboot()
disabled = FALSE
force = initial(force)
/obj/item/shield/v1_arm/add_parry_component()
AddComponent(/datum/component/parry, _stamina_constant = 2, _stamina_coefficient = 0.35, _parryable_attack_types = ALL_ATTACK_TYPES, _parry_cooldown = (1 / 3) SECONDS, _no_parry_sound = TRUE) // 0.3333 seconds of cooldown for 75% uptime, countered by ions and plasma pistols
/obj/item/shield/v1_arm/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(disabled)
return FALSE
// Hit by a melee weapon or blocked a projectile
. = ..()
if(!.) // they did not block the attack
return
if(. == 1) // a normal block
owner.visible_message("<span class='danger'>[owner] blocks [attack_text] with [src]!</span>")
playsound(src, 'sound/weapons/effects/ric3.ogg', 100, TRUE)
return TRUE
set_light(3)
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, set_light), 0), 0.25 SECONDS)
if(istype(hitby, /obj/item/projectile))
var/obj/item/projectile/P = hitby
if(P.shield_buster || istype(P, /obj/item/projectile/ion)) //EMP's and unpariable attacks, after all.
return FALSE
if(P.reflectability == REFLECTABILITY_NEVER) //only 1 magic spell does this, but hey, needed
owner.visible_message("<span class='danger'>[owner] blocks [attack_text] with [src]!</span>")
playsound(src, 'sound/weapons/effects/ric3.ogg', 100, TRUE)
return TRUE
P.damage = clamp((P.damage + 10), P.damage, reflect_damage_cap)
var/sound = pick('sound/effects/explosion1.ogg', 'sound/effects/explosion2.ogg', 'sound/effects/meteorimpact.ogg')
P.hitsound = sound
P.hitsound_wall = sound
P.add_overlay("parry")
playsound(src, 'sound/weapons/v1_parry.ogg', 100, TRUE)
owner.visible_message("<span class='danger'>[owner] parries [attack_text] with [src]!</span>")
add_attack_logs(P.firer, src, "hit by [P.type] but got parried by [src]")
return -1
owner.visible_message("<span class='danger'>[owner] parries [attack_text] with [src]!</span>")
playsound(src, 'sound/weapons/v1_parry.ogg', 100, TRUE)
if(isitem(hitby)) //Thrown items
var/obj/item/TT = hitby
addtimer(CALLBACK(TT, TYPE_PROC_REF(/atom/movable, throw_at), locateUID(TT.thrownby), 15, 15, owner), 0.1 SECONDS) //yeet that shit right back
return TRUE
melee_attack_chain(owner, hitby)
return TRUE
/obj/item/v1_arm_shell
name = "vortex feedback arm implant frame"
desc = "An implant awaiting installation of a vortex anomaly core"
icon_state = "v1_arm"
/obj/item/v1_arm_shell/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/assembly/signaler/anomaly/vortex))
to_chat(user, "<span class='notice'>You insert [I] into the back of the hand, and the implant begins to boot up.</span>")
new /obj/item/organ/internal/cyberimp/arm/v1_arm(get_turf(src))
qdel(src)
qdel(I)
return ..()