mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-29 16:19:36 +01:00
Factors out common mecha/working procs
Refactors a bunch of identical hoverpod and ripley procs and moves them into mecha/working
This commit is contained in:
@@ -10,8 +10,7 @@
|
||||
health = 150
|
||||
infra_luminosity = 6
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/hoverpod
|
||||
var/list/cargo = new
|
||||
var/cargo_capacity = 5
|
||||
cargo_capacity = 5
|
||||
max_equip = 3
|
||||
var/datum/effect/effect/system/ion_trail_follow/ion_trail
|
||||
|
||||
@@ -51,52 +50,6 @@
|
||||
playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return result
|
||||
|
||||
/obj/mecha/working/hoverpod/Exit(atom/movable/O)
|
||||
if(O in cargo)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/mecha/working/hoverpod/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["drop_from_cargo"])
|
||||
var/obj/O = locate(href_list["drop_from_cargo"])
|
||||
if(O && O in src.cargo)
|
||||
src.occupant_message("\blue You unload [O].")
|
||||
O.loc = get_turf(src)
|
||||
src.cargo -= O
|
||||
var/turf/T = get_turf(O)
|
||||
if(T)
|
||||
T.Entered(O)
|
||||
src.log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/working/hoverpod/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>Cargo Compartment Contents:</b><div style=\"margin-left: 15px;\">"
|
||||
if(src.cargo.len)
|
||||
for(var/obj/O in src.cargo)
|
||||
output += "<a href='?src=\ref[src];drop_from_cargo=\ref[O]'>Unload</a> : [O]<br>"
|
||||
else
|
||||
output += "Nothing"
|
||||
output += "</div>"
|
||||
return output
|
||||
|
||||
/obj/mecha/working/hoverpod/Del()
|
||||
for(var/mob/M in src)
|
||||
if(M==src.occupant)
|
||||
continue
|
||||
M.loc = get_turf(src)
|
||||
M.loc.Entered(M)
|
||||
step_rand(M)
|
||||
for(var/atom/movable/A in src.cargo)
|
||||
A.loc = get_turf(src)
|
||||
var/turf/T = get_turf(A)
|
||||
if(T)
|
||||
T.Entered(A)
|
||||
step_rand(A)
|
||||
..()
|
||||
return
|
||||
|
||||
//Hoverpod variants
|
||||
/obj/mecha/working/hoverpod/combatpod
|
||||
|
||||
@@ -7,14 +7,7 @@
|
||||
max_temperature = 20000
|
||||
health = 200
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/ripley
|
||||
var/list/cargo = new
|
||||
var/cargo_capacity = 10
|
||||
|
||||
/*
|
||||
/obj/mecha/working/ripley/New()
|
||||
..()
|
||||
return
|
||||
*/
|
||||
cargo_capacity = 10
|
||||
|
||||
/obj/mecha/working/ripley/firefighter
|
||||
desc = "Standart APLU chassis was refitted with additional thermal protection and cistern."
|
||||
@@ -63,50 +56,4 @@
|
||||
for(var/obj/item/mecha_parts/mecha_tracking/B in src.contents)//Deletes the beacon so it can't be found easily
|
||||
del (B)
|
||||
|
||||
/obj/mecha/working/ripley/Exit(atom/movable/O)
|
||||
if(O in cargo)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/mecha/working/ripley/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["drop_from_cargo"])
|
||||
var/obj/O = locate(href_list["drop_from_cargo"])
|
||||
if(O && O in src.cargo)
|
||||
src.occupant_message("\blue You unload [O].")
|
||||
O.loc = get_turf(src)
|
||||
src.cargo -= O
|
||||
var/turf/T = get_turf(O)
|
||||
if(T)
|
||||
T.Entered(O)
|
||||
src.log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/mecha/working/ripley/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>Cargo Compartment Contents:</b><div style=\"margin-left: 15px;\">"
|
||||
if(src.cargo.len)
|
||||
for(var/obj/O in src.cargo)
|
||||
output += "<a href='?src=\ref[src];drop_from_cargo=\ref[O]'>Unload</a> : [O]<br>"
|
||||
else
|
||||
output += "Nothing"
|
||||
output += "</div>"
|
||||
return output
|
||||
|
||||
/obj/mecha/working/ripley/Del()
|
||||
for(var/mob/M in src)
|
||||
if(M==src.occupant)
|
||||
continue
|
||||
M.loc = get_turf(src)
|
||||
M.loc.Entered(M)
|
||||
step_rand(M)
|
||||
for(var/atom/movable/A in src.cargo)
|
||||
A.loc = get_turf(src)
|
||||
var/turf/T = get_turf(A)
|
||||
if(T)
|
||||
T.Entered(A)
|
||||
step_rand(A)
|
||||
..()
|
||||
return
|
||||
@@ -1,5 +1,7 @@
|
||||
/obj/mecha/working
|
||||
internal_damage_threshold = 60
|
||||
var/list/cargo = new
|
||||
var/cargo_capacity = 5
|
||||
|
||||
/obj/mecha/working/New()
|
||||
..()
|
||||
@@ -8,27 +10,51 @@
|
||||
new /obj/item/mecha_parts/mecha_tracking(src)
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/mecha/working/melee_action(atom/target as obj|mob|turf)
|
||||
if(internal_damage&MECHA_INT_CONTROL_LOST)
|
||||
target = pick(oview(1,src))
|
||||
if(selected_tool)
|
||||
selected_tool.action(target)
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/mecha/working/range_action(atom/target as obj|mob|turf)
|
||||
/obj/mecha/working/Del()
|
||||
for(var/mob/M in src)
|
||||
if(M==src.occupant)
|
||||
continue
|
||||
M.loc = get_turf(src)
|
||||
M.loc.Entered(M)
|
||||
step_rand(M)
|
||||
for(var/atom/movable/A in src.cargo)
|
||||
A.loc = get_turf(src)
|
||||
var/turf/T = get_turf(A)
|
||||
if(T)
|
||||
T.Entered(A)
|
||||
step_rand(A)
|
||||
..()
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/mecha/working/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["drop_from_cargo"])
|
||||
var/obj/O = locate(href_list["drop_from_cargo"])
|
||||
if(O && O in src.cargo)
|
||||
src.occupant_message("\blue You unload [O].")
|
||||
O.loc = get_turf(src)
|
||||
src.cargo -= O
|
||||
var/turf/T = get_turf(O)
|
||||
if(T)
|
||||
T.Entered(O)
|
||||
src.log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
|
||||
return
|
||||
|
||||
/obj/mecha/working/Exit(atom/movable/O)
|
||||
if(O in cargo)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/mecha/working/get_stats_part()
|
||||
var/output = ..()
|
||||
output += "<b>[src.name] Tools:</b><div style=\"margin-left: 15px;\">"
|
||||
if(equipment.len)
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/MT in equipment)
|
||||
output += "[selected==MT?"<b>":"<a href='?src=\ref[src];select_equip=\ref[MT]'>"][MT.get_equip_info()][selected==MT?"</b>":"</a>"]<br>"
|
||||
output += "<b>Cargo Compartment Contents:</b><div style=\"margin-left: 15px;\">"
|
||||
if(src.cargo.len)
|
||||
for(var/obj/O in src.cargo)
|
||||
output += "<a href='?src=\ref[src];drop_from_cargo=\ref[O]'>Unload</a> : [O]<br>"
|
||||
else
|
||||
output += "None"
|
||||
output += "Nothing"
|
||||
output += "</div>"
|
||||
return output
|
||||
*/
|
||||
|
||||
/obj/mecha/working/range_action(atom/target as obj|mob|turf)
|
||||
return
|
||||
Reference in New Issue
Block a user