diff --git a/code/game/gamemodes/technomancer/devices/shield_armor.dm b/code/game/gamemodes/technomancer/devices/shield_armor.dm index e36ce7bd3a..c8e8130adc 100644 --- a/code/game/gamemodes/technomancer/devices/shield_armor.dm +++ b/code/game/gamemodes/technomancer/devices/shield_armor.dm @@ -14,11 +14,11 @@ desc = "This armor has no inherent ability to absorb shock, as normal armor usually does. Instead, this emits a strong field \ around the wearer, designed to protect from most forms of harm, from lasers to bullets to close quarters combat. It appears to \ require a very potent supply of an energy of some kind in order to function." - icon_state = "reactiveoff" //wip - item_state = "reactiveoff" + icon_state = "shield_armor_0" blood_overlay_type = "armor" slowdown = 0 armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) + action_button_name = "Toggle Shield Projector" var/active = 0 var/damage_to_energy_multiplier = 50.0 //Determines how much energy to charge for blocking, e.g. 20 damage attack = 750 energy cost var/datum/effect/effect/system/spark_spread/spark_system = null @@ -49,7 +49,7 @@ var/damage_to_energy_cost = (damage_to_energy_multiplier * damage_blocked) if(!user.technomancer_pay_energy(damage_to_energy_cost)) - user << "Your shield fades due to lack of energy!" + to_chat(user, "Your shield fades due to lack of energy!") active = 0 update_icon() return 0 @@ -67,7 +67,7 @@ P.damage = P.damage - damage_blocked user.visible_message("\The [user]'s [src] absorbs [attack_text]!") - user << "Your shield has absorbed most of \the [damage_source]." + to_chat(user, "Your shield has absorbed most of \the [damage_source].") spark_system.start() playsound(user.loc, 'sound/weapons/blade1.ogg', 50, 1) @@ -75,14 +75,17 @@ /obj/item/clothing/suit/armor/shield/attack_self(mob/user) active = !active - user << "You [active ? "" : "de"]active \the [src]." + to_chat(user, "You [active ? "" : "de"]activate \the [src].") update_icon() + user.update_inv_wear_suit() + user.update_action_buttons() /obj/item/clothing/suit/armor/shield/update_icon() + icon_state = "shield_armor_[active]" + item_state = "shield_armor_[active]" if(active) - icon_state = "shield_armor" set_light(2, 1, l_color = "#006AFF") else - icon_state = "shield_armor_off" set_light(0, 0, l_color = "#000000") + ..() return \ No newline at end of file diff --git a/code/game/gamemodes/technomancer/devices/tesla_armor.dm b/code/game/gamemodes/technomancer/devices/tesla_armor.dm index 2e9a60a8e6..56f2085850 100644 --- a/code/game/gamemodes/technomancer/devices/tesla_armor.dm +++ b/code/game/gamemodes/technomancer/devices/tesla_armor.dm @@ -10,55 +10,70 @@ /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 = "reactive" //wip - item_state = "reactive" + icon_state = "tesla_armor_1" //wip blood_overlay_type = "armor" slowdown = 1 armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0) + action_button_name = "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 = "reactive" //also wip - var/normal_icon_state = "reactiveoff" + 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(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(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(attacker, 40) + shoot_lightning(P.firer, 40) else - shoot_lightning(attacker, 15) + shoot_lightning(P.firer, 15) - //Deal with protecting our wearer now. - if(ready) - ready = 0 - spawn(cooldown_to_charge) - ready = 1 + 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, "\The [src] is ready to protect you once more.") + visible_message("\The [user]'s [src.name] blocks [attack_text]!") update_icon() - user << "\The [src] is ready to protect you once more." - visible_message("\The [user]'s [src.name] blocks [attack_text]!") - update_icon() - return 1 + return 1 return 0 +/obj/item/clothing/suit/armor/tesla/attack_self(mob/user) + active = !active + to_chat(user, "You [active ? "" : "de"]activate \the [src].") + update_icon() + user.update_inv_wear_suit() + user.update_action_buttons() + /obj/item/clothing/suit/armor/tesla/update_icon() - ..() - if(ready) + 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_action_buttons() + ..() /obj/item/clothing/suit/armor/tesla/proc/shoot_lightning(var/mob/target, var/power) var/obj/item/projectile/beam/lightning/lightning = new(src) diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi index 7249f9b218..a0e5df9f9d 100644 Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ diff --git a/icons/obj/clothing/suits.dmi b/icons/obj/clothing/suits.dmi index 2925d066c2..e795486d59 100644 Binary files a/icons/obj/clothing/suits.dmi and b/icons/obj/clothing/suits.dmi differ