mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Merge pull request #3940 from Anewbe/technomancer_armor
Improves the tesla and shield generator armors
This commit is contained in:
@@ -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 \
|
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 \
|
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."
|
require a very potent supply of an energy of some kind in order to function."
|
||||||
icon_state = "reactiveoff" //wip
|
icon_state = "shield_armor_0"
|
||||||
item_state = "reactiveoff"
|
|
||||||
blood_overlay_type = "armor"
|
blood_overlay_type = "armor"
|
||||||
slowdown = 0
|
slowdown = 0
|
||||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 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/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/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
|
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)
|
var/damage_to_energy_cost = (damage_to_energy_multiplier * damage_blocked)
|
||||||
|
|
||||||
if(!user.technomancer_pay_energy(damage_to_energy_cost))
|
if(!user.technomancer_pay_energy(damage_to_energy_cost))
|
||||||
user << "<span class='danger'>Your shield fades due to lack of energy!</span>"
|
to_chat(user, "<span class='danger'>Your shield fades due to lack of energy!</span>")
|
||||||
active = 0
|
active = 0
|
||||||
update_icon()
|
update_icon()
|
||||||
return 0
|
return 0
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
P.damage = P.damage - damage_blocked
|
P.damage = P.damage - damage_blocked
|
||||||
|
|
||||||
user.visible_message("<span class='danger'>\The [user]'s [src] absorbs [attack_text]!</span>")
|
user.visible_message("<span class='danger'>\The [user]'s [src] absorbs [attack_text]!</span>")
|
||||||
user << "<span class='warning'>Your shield has absorbed most of \the [damage_source].</span>"
|
to_chat(user, "<span class='warning'>Your shield has absorbed most of \the [damage_source].</span>")
|
||||||
|
|
||||||
spark_system.start()
|
spark_system.start()
|
||||||
playsound(user.loc, 'sound/weapons/blade1.ogg', 50, 1)
|
playsound(user.loc, 'sound/weapons/blade1.ogg', 50, 1)
|
||||||
@@ -75,14 +75,17 @@
|
|||||||
|
|
||||||
/obj/item/clothing/suit/armor/shield/attack_self(mob/user)
|
/obj/item/clothing/suit/armor/shield/attack_self(mob/user)
|
||||||
active = !active
|
active = !active
|
||||||
user << "<span class='notice'>You [active ? "" : "de"]active \the [src].</span>"
|
to_chat(user, "<span class='notice'>You [active ? "" : "de"]activate \the [src].</span>")
|
||||||
update_icon()
|
update_icon()
|
||||||
|
user.update_inv_wear_suit()
|
||||||
|
user.update_action_buttons()
|
||||||
|
|
||||||
/obj/item/clothing/suit/armor/shield/update_icon()
|
/obj/item/clothing/suit/armor/shield/update_icon()
|
||||||
|
icon_state = "shield_armor_[active]"
|
||||||
|
item_state = "shield_armor_[active]"
|
||||||
if(active)
|
if(active)
|
||||||
icon_state = "shield_armor"
|
|
||||||
set_light(2, 1, l_color = "#006AFF")
|
set_light(2, 1, l_color = "#006AFF")
|
||||||
else
|
else
|
||||||
icon_state = "shield_armor_off"
|
|
||||||
set_light(0, 0, l_color = "#000000")
|
set_light(0, 0, l_color = "#000000")
|
||||||
|
..()
|
||||||
return
|
return
|
||||||
@@ -10,55 +10,70 @@
|
|||||||
/obj/item/clothing/suit/armor/tesla
|
/obj/item/clothing/suit/armor/tesla
|
||||||
name = "tesla armor"
|
name = "tesla armor"
|
||||||
desc = "This rather dangerous looking armor will hopefully shock your enemies, and not you in the process."
|
desc = "This rather dangerous looking armor will hopefully shock your enemies, and not you in the process."
|
||||||
icon_state = "reactive" //wip
|
icon_state = "tesla_armor_1" //wip
|
||||||
item_state = "reactive"
|
|
||||||
blood_overlay_type = "armor"
|
blood_overlay_type = "armor"
|
||||||
slowdown = 1
|
slowdown = 1
|
||||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
|
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 = 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/ready_icon_state = "tesla_armor_1" //also wip
|
||||||
var/normal_icon_state = "reactiveoff"
|
var/normal_icon_state = "tesla_armor_0"
|
||||||
var/cooldown_to_charge = 15 SECONDS
|
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")
|
/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.
|
//First, some retaliation.
|
||||||
if(istype(damage_source, /obj/item/projectile))
|
if(active)
|
||||||
var/obj/item/projectile/P = damage_source
|
if(istype(damage_source, /obj/item/projectile))
|
||||||
if(P.firer && get_dist(user, P.firer) <= 3)
|
var/obj/item/projectile/P = damage_source
|
||||||
if(ready)
|
if(P.firer && get_dist(user, P.firer) <= 3)
|
||||||
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)
|
if(ready)
|
||||||
shoot_lightning(attacker, 40)
|
shoot_lightning(P.firer, 40)
|
||||||
else
|
else
|
||||||
shoot_lightning(attacker, 15)
|
shoot_lightning(P.firer, 15)
|
||||||
|
|
||||||
//Deal with protecting our wearer now.
|
else
|
||||||
if(ready)
|
if(attacker && attacker != user)
|
||||||
ready = 0
|
if(get_dist(user, attacker) <= 3) //Anyone farther away than three tiles is too far to shoot lightning at.
|
||||||
spawn(cooldown_to_charge)
|
if(ready)
|
||||||
ready = 1
|
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 class='notice'>\The [src] is ready to protect you once more.</span>")
|
||||||
|
visible_message("<span class='danger'>\The [user]'s [src.name] blocks [attack_text]!</span>")
|
||||||
update_icon()
|
update_icon()
|
||||||
user << "<span class='notice'>\The [src] is ready to protect you once more.</span>"
|
return 1
|
||||||
visible_message("<span class='danger'>\The [user]'s [src.name] blocks [attack_text]!</span>")
|
|
||||||
update_icon()
|
|
||||||
return 1
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
/obj/item/clothing/suit/armor/tesla/attack_self(mob/user)
|
||||||
|
active = !active
|
||||||
|
to_chat(user, "<span class='notice'>You [active ? "" : "de"]activate \the [src].</span>")
|
||||||
|
update_icon()
|
||||||
|
user.update_inv_wear_suit()
|
||||||
|
user.update_action_buttons()
|
||||||
|
|
||||||
/obj/item/clothing/suit/armor/tesla/update_icon()
|
/obj/item/clothing/suit/armor/tesla/update_icon()
|
||||||
..()
|
if(active && ready)
|
||||||
if(ready)
|
|
||||||
icon_state = ready_icon_state
|
icon_state = ready_icon_state
|
||||||
|
item_state = ready_icon_state
|
||||||
|
set_light(2, 1, l_color = "#006AFF")
|
||||||
else
|
else
|
||||||
icon_state = normal_icon_state
|
icon_state = normal_icon_state
|
||||||
|
item_state = normal_icon_state
|
||||||
|
set_light(0, 0, l_color = "#000000")
|
||||||
|
|
||||||
if(ishuman(loc))
|
if(ishuman(loc))
|
||||||
var/mob/living/carbon/human/H = loc
|
var/mob/living/carbon/human/H = loc
|
||||||
H.update_inv_wear_suit(0)
|
H.update_inv_wear_suit(0)
|
||||||
|
H.update_action_buttons()
|
||||||
|
..()
|
||||||
|
|
||||||
/obj/item/clothing/suit/armor/tesla/proc/shoot_lightning(var/mob/target, var/power)
|
/obj/item/clothing/suit/armor/tesla/proc/shoot_lightning(var/mob/target, var/power)
|
||||||
var/obj/item/projectile/beam/lightning/lightning = new(src)
|
var/obj/item/projectile/beam/lightning/lightning = new(src)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 459 KiB After Width: | Height: | Size: 463 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB |
Reference in New Issue
Block a user