mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 06:27:26 +01:00
Adds EPS-99 Pulse Shield Generator for mechs (#30043)
* EPS-99 Pulse Shield Generator * Increased drain * Increased energy drain more * Uses the cool AT shield. Thanks colossus. And lints * Fixes and oversight coverage * Messages when shield is disabled. * Fixes + shield alpha * Shield sprites
This commit is contained in:
@@ -73,6 +73,13 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/action(atom/target)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/on_unequip()
|
||||
chassis.selected = null
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/on_equip(atom/target)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/proc/start_cooldown()
|
||||
set_ready_state(0)
|
||||
chassis.use_power(energy_drain)
|
||||
|
||||
@@ -138,6 +138,26 @@
|
||||
start_cooldown()
|
||||
return TRUE
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/pulse_shield
|
||||
name = "EPS-99 pulse shield generator"
|
||||
desc = "A shield module that covers the exosuit in an energy barrier that absorbs damage. Requires energy to operate."
|
||||
icon_state = "mecha_pulse_shield"
|
||||
origin_tech = "materials=4;combat=4"
|
||||
equip_cooldown = 10
|
||||
energy_drain = 50
|
||||
range = 0
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/pulse_shield/on_equip()
|
||||
chassis.update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/pulse_shield/on_unequip()
|
||||
. = ..()
|
||||
chassis.update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/pulse_shield/proc/attack_react(mob/user as mob)
|
||||
if(action_checks(user))
|
||||
start_cooldown()
|
||||
return TRUE
|
||||
|
||||
////////////////////////////////// REPAIR DROID //////////////////////////////////////////////////
|
||||
|
||||
@@ -286,6 +306,9 @@
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
set_ready_state(1)
|
||||
return
|
||||
if(istype(chassis.selected, /obj/item/mecha_parts/mecha_equipment/pulse_shield))
|
||||
chassis.selected.on_unequip() // No shields while recharging
|
||||
occupant_message("Shields disabled.")
|
||||
var/cur_charge = chassis.get_charge()
|
||||
if(isnull(cur_charge) || !chassis.cell)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
@@ -166,6 +166,9 @@
|
||||
. = ..()
|
||||
underlays.Cut()
|
||||
underlays += emissive_appearance(emissive_appearance_icon, "[icon_state]_lightmask")
|
||||
overlays.Cut()
|
||||
if(istype(selected, /obj/item/mecha_parts/mecha_equipment/pulse_shield) && !leg_overload_mode && !istype(cell, /obj/item/stock_parts/cell/infinite) && occupant)
|
||||
overlays += mutable_appearance('icons/effects/effects.dmi', "at_shield2", MOB_LAYER + 0.01, alpha = 120)
|
||||
|
||||
////////////////////////
|
||||
////// Helpers /////////
|
||||
@@ -527,6 +530,16 @@
|
||||
return facing_modifiers[MECHA_SIDE_ARMOUR] //always return non-0
|
||||
|
||||
/obj/mecha/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/pulse_shield/shield in equipment)
|
||||
if(selected == shield && !leg_overload_mode && !istype(cell, /obj/item/stock_parts/cell/infinite) && occupant)
|
||||
var/required_power = shield.energy_drain * damage_amount
|
||||
if(cell && cell.use(required_power))
|
||||
log_message("Took [damage_amount] points of damage. Damage absorbed by [shield].")
|
||||
damage_amount = 0
|
||||
spark_system.start()
|
||||
else
|
||||
occupant_message("<span class='userdanger'>Shield breached!</span>")
|
||||
shield.on_unequip()
|
||||
. = ..()
|
||||
if(. && obj_integrity > 0)
|
||||
spark_system.start()
|
||||
@@ -630,6 +643,9 @@
|
||||
/obj/mecha/bullet_act(obj/item/projectile/Proj) //wrapper
|
||||
log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).")
|
||||
add_attack_logs(Proj.firer, OCCUPANT_LOGGING, "shot [Proj.name]([Proj.flag]) at mech [src]")
|
||||
if(Proj.shield_buster && istype(selected, /obj/item/mecha_parts/mecha_equipment/pulse_shield))
|
||||
occupant_message("<span class='userdanger'>Shield breached!</span>")
|
||||
selected.on_unequip()
|
||||
..()
|
||||
|
||||
/obj/mecha/ex_act(severity, target)
|
||||
@@ -695,6 +711,9 @@
|
||||
/obj/mecha/emp_act(severity)
|
||||
if(emp_proof)
|
||||
return
|
||||
if(istype(selected, /obj/item/mecha_parts/mecha_equipment/pulse_shield))
|
||||
occupant_message("<span class='userdanger'>Shield breached!</span>")
|
||||
selected.on_unequip()
|
||||
if(get_charge())
|
||||
use_power((cell.charge/3)/(severity*2))
|
||||
take_damage(30 / severity, BURN, ENERGY, 1)
|
||||
@@ -768,6 +787,9 @@
|
||||
W.forceMove(src)
|
||||
cell = W
|
||||
log_message("Powercell installed")
|
||||
if(istype(selected, /obj/item/mecha_parts/mecha_equipment/pulse_shield) && istype(cell, /obj/item/stock_parts/cell/infinite))
|
||||
occupant_message("<span class='danger'>The immense power of the cell overloads the shields.</span>")
|
||||
selected.on_unequip()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There's already a powercell installed.</span>")
|
||||
return
|
||||
|
||||
@@ -127,6 +127,8 @@
|
||||
chassis.step_in = min(1, round(chassis.step_in / 2))
|
||||
chassis.step_energy_drain = max(chassis.overload_step_energy_drain_min, chassis.step_energy_drain * chassis.leg_overload_coeff)
|
||||
chassis.occupant_message("<span class='danger'>You enable leg actuators overload.</span>")
|
||||
if(istype(chassis.selected, /obj/item/mecha_parts/mecha_equipment/pulse_shield))
|
||||
chassis.occupant_message("<span class='danger'>Your shields turn off as your actuators overload.</span>")
|
||||
else
|
||||
chassis.leg_overload_mode = 0
|
||||
// chassis.bumpsmash = 0
|
||||
@@ -134,6 +136,7 @@
|
||||
chassis.step_energy_drain = chassis.normal_step_energy_drain
|
||||
chassis.occupant_message("<span class='notice'>You disable leg actuators overload.</span>")
|
||||
build_all_button_icons()
|
||||
chassis.update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_thrusters
|
||||
name = "Toggle Thrusters"
|
||||
@@ -253,7 +256,10 @@
|
||||
/datum/action/innate/mecha/select_module/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
if(chassis.selected)
|
||||
chassis.selected.on_unequip()
|
||||
chassis.selected = equipment
|
||||
chassis.selected.on_equip()
|
||||
chassis.occupant_message("<span class='notice'>You switch to [equipment.name].</span>")
|
||||
chassis.visible_message("[chassis] raises [equipment.name]")
|
||||
send_byjax(chassis.occupant, "exosuit.browser", "eq_list", chassis.get_equipment_list())
|
||||
|
||||
@@ -257,7 +257,10 @@
|
||||
if(usr != occupant) return
|
||||
var/obj/item/mecha_parts/mecha_equipment/equip = afilter.getObj("select_equip")
|
||||
if(equip && (equip in equipment))
|
||||
if(selected)
|
||||
selected.on_unequip()
|
||||
selected = equip
|
||||
selected.on_equip()
|
||||
occupant_message("You switch to [equip]")
|
||||
visible_message("[src] raises [equip]")
|
||||
send_byjax(occupant, "exosuit.browser", "eq_list", get_equipment_list())
|
||||
|
||||
@@ -947,6 +947,17 @@
|
||||
construction_time = 10 SECONDS
|
||||
category = list("Exosuit Equipment")
|
||||
|
||||
/datum/design/mech_pulse_shield
|
||||
name = "Exosuit Module (EPS-99 Pulse Shield Generator)"
|
||||
desc = "Exosuit-mounted shield generator."
|
||||
id = "mech_shield_gen"
|
||||
build_type = MECHFAB
|
||||
req_tech = list("bluespace" = 7, "combat" = 7, "engineering"=7)
|
||||
build_path = /obj/item/mecha_parts/mecha_equipment/pulse_shield
|
||||
materials = list(MAT_METAL = 20000, MAT_GOLD = 5000, MAT_BLUESPACE = 5000)
|
||||
construction_time = 10 SECONDS
|
||||
category = list("Exosuit Equipment")
|
||||
|
||||
/datum/design/mech_armor_plate
|
||||
name = "Exosuit Mining Armor Plate"
|
||||
desc = "This piece of metal can be attached to the mech itself, enhancing its protective characteristics. Unfortunately, only working class exosuits have notches for such armor."
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 35 KiB |
Reference in New Issue
Block a user