mech counterplay ahoy

This commit is contained in:
Sishen
2019-06-30 13:19:17 -04:00
parent e6578fddad
commit b263c37a70
8 changed files with 35 additions and 19 deletions

View File

@@ -76,6 +76,9 @@
return 0
if(energy_drain && !chassis.has_charge(energy_drain))
return 0
if(chassis.equipment_disabled)
to_chat(chassis.occupant, "<span=warn>Error -- Equipment control unit is unresponsive.</span>")
return 0
return 1
/obj/item/mecha_parts/mecha_equipment/proc/action(atom/target)

View File

@@ -42,6 +42,7 @@
var/last_message = 0
var/add_req_access = 1
var/maint_access = 0
var/equipment_disabled = 0 //disabled due to EMP
var/dna_lock //dna-locking the mech
var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
var/datum/effect_system/spark_spread/spark_system = new
@@ -143,7 +144,6 @@
diag_hud_set_mechhealth()
diag_hud_set_mechcell()
diag_hud_set_mechstat()
diag_hud_set_mechtracking()
/obj/mecha/get_cell()
return cell
@@ -205,6 +205,15 @@
GLOB.mechas_list -= src //global mech list
return ..()
/obj/mecha/proc/restore_equipment()
equipment_disabled = 0
if(istype(src, /obj/mecha/combat))
mouse_pointer = 'icons/mecha/mecha_mouse.dmi'
if(occupant)
SEND_SOUND(occupant, sound('sound/items/timer.ogg', volume=50))
to_chat(occupant, "<span=notice>Equipment control unit has been rebooted successfuly.</span>")
occupant.update_mouse_pointer()
/obj/mecha/CheckParts(list/parts_list)
..()
cell = locate(/obj/item/stock_parts/cell) in contents
@@ -394,8 +403,6 @@
diag_hud_set_mechhealth()
diag_hud_set_mechcell()
diag_hud_set_mechstat()
diag_hud_set_mechtracking()
/obj/mecha/proc/drop_item()//Derpfix, but may be useful in future for engineering exosuits.
return

View File

@@ -11,8 +11,8 @@
var/obj/mecha/M = new result(drop_location())
QDEL_NULL(M.cell)
var/atom/parent_atom = parent
M.CheckParts(parent_atom.contents)
var/obj/item/mecha_parts/chassis/parent_chassis = parent
M.CheckParts(parent_chassis.contents)
SSblackbox.record_feedback("tally", "mechas_created", 1, M.name)
QDEL_NULL(parent)

View File

@@ -22,7 +22,7 @@
if(answer)
dat += {"<hr>[answer]<br/>
<a href='?src=[REF(src)];send_message=[REF(TR)]'>Send message</a><br/>
<a href='?src=[REF(src)];get_log=[REF(TR)]'>Show exosuit log</a> | <a style='color: #f00;' href='?src=[REF(src)];shock=[REF(TR)]'>(EMP pulse)</a><br>"}
[TR.recharging?"Recharging EMP Pulse...<br>":"<a style='color: #f00;' href='?src=[REF(src)];shock=[REF(TR)]'>(EMP Pulse)</a><br>"]"}
if(screen==1)
dat += "<h3>Log contents</h3>"
@@ -65,6 +65,7 @@
icon_state = "motion2"
w_class = WEIGHT_CLASS_SMALL
var/ai_beacon = FALSE //If this beacon allows for AI control. Exists to avoid using istype() on checking.
var/recharging = 0
/obj/item/mecha_parts/mecha_tracking/proc/get_mecha_info()
if(!in_mecha())
@@ -102,10 +103,16 @@
return 0
/obj/item/mecha_parts/mecha_tracking/proc/shock()
if(recharging)
return
var/obj/mecha/M = in_mecha()
if(M)
M.emp_act(EMP_LIGHT)
qdel(src)
M.emp_act(EMP_HEAVY)
addtimer(CALLBACK(src, /obj/item/mecha_parts/mecha_tracking/proc/recharge), 5 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
recharging = 1
/obj/item/mecha_parts/mecha_tracking/proc/recharge()
recharging = 0
/obj/item/mecha_parts/mecha_tracking/proc/get_mecha_log()
if(!ismecha(loc))

View File

@@ -149,7 +149,14 @@
use_power((cell.charge/3)/(severity*2))
take_damage(30 / severity, BURN, "energy", 1)
log_message("EMP detected", color="red")
check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1)
if(istype(src, /obj/mecha/combat))
mouse_pointer = 'icons/mecha/mecha_mouse-disable.dmi'
occupant?.update_mouse_pointer()
if(!equipment_disabled && occupant) //prevent spamming this message with back-to-back EMPs
to_chat(occupant, "<span=danger>Error -- Connection to equipment control unit has been lost.</span>")
addtimer(CALLBACK(src, /obj/mecha/proc/restore_equipment), 3 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
equipment_disabled = 1
/obj/mecha/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature>max_temperature)

View File

@@ -1,8 +1,3 @@
/obj/mecha/medical/Initialize()
. = ..()
trackers += new /obj/item/mecha_parts/mecha_tracking(src)
/obj/mecha/medical/mechturn(direction)
setDir(direction)
playsound(src,'sound/mecha/mechmove01.ogg',40,1)

View File

@@ -1,6 +1,3 @@
/obj/mecha/working
internal_damage_threshold = 60
/obj/mecha/working/Initialize()
. = ..()
trackers += new /obj/item/mecha_parts/mecha_tracking(src)

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B