Files
VOREStation/code/game/gamemodes/technomancer/devices/tesla_armor.dm
T
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

88 lines
3.3 KiB
Plaintext

/datum/technomancer/equipment/tesla_armor
name = "Tesla Armor"
desc = "This piece of armor offers a retaliation-based defense. When the armor is 'ready', it will completely protect you from \
the next attack you suffer, and strike the attacker with a strong bolt of lightning, provided they are close enough. This effect requires \
fifteen seconds to recharge. If you are attacked while this is recharging, a weaker lightning bolt is sent out, however you won't be protected from \
the person beating you."
cost = 150
obj_path = /obj/item/clothing/suit/armor/tesla
/obj/item/clothing/suit/armor/tesla
name = "tesla armor"
desc = "This rather dangerous looking armor will hopefully shock your enemies, and not you in the process."
icon_state = "tesla_armor_1" //wip
blood_overlay_type = "armor"
slowdown = 0.5
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
actions_types = list(/datum/action/item_action/toggle_tesla_armor)
var/active = 1 //Determines if the armor will zap or block
var/ready = 1 //Determines if the next attack will be blocked, as well if a strong lightning bolt is sent out at the attacker.
var/ready_icon_state = "tesla_armor_1" //also wip
var/normal_icon_state = "tesla_armor_0"
var/cooldown_to_charge = 15 SECONDS
/obj/item/clothing/suit/armor/tesla/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
//First, some retaliation.
if(active)
if(istype(damage_source, /obj/item/projectile))
var/obj/item/projectile/P = damage_source
if(P.firer && get_dist(user, P.firer) <= 3)
if(ready)
shoot_lightning(P.firer, 40)
else
shoot_lightning(P.firer, 15)
else
if(attacker && attacker != user)
if(get_dist(user, attacker) <= 3) //Anyone farther away than three tiles is too far to shoot lightning at.
if(ready)
shoot_lightning(attacker, 40)
else
shoot_lightning(attacker, 15)
//Deal with protecting our wearer now.
if(ready)
ready = 0
spawn(cooldown_to_charge)
ready = 1
update_icon()
to_chat(user, span_notice("\The [src] is ready to protect you once more."))
visible_message(span_danger("\The [user]'s [src.name] blocks [attack_text]!"))
update_icon()
return 1
return 0
/obj/item/clothing/suit/armor/tesla/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
active = !active
to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src]."))
update_icon()
user.update_inv_wear_suit()
user.update_mob_action_buttons()
/obj/item/clothing/suit/armor/tesla/update_icon()
if(active && ready)
icon_state = ready_icon_state
item_state = ready_icon_state
set_light(2, 1, l_color = "#006AFF")
else
icon_state = normal_icon_state
item_state = normal_icon_state
set_light(0, 0, l_color = "#000000")
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_wear_suit(0)
H.update_mob_action_buttons()
..()
/obj/item/clothing/suit/armor/tesla/proc/shoot_lightning(mob/target, power)
var/obj/item/projectile/beam/lightning/lightning = new(get_turf(src))
lightning.power = power
lightning.old_style_target(target)
lightning.fire()
visible_message(span_danger("\The [src] strikes \the [target] with lightning!"))
playsound(src, 'sound/weapons/gauss_shoot.ogg', 75, 1)