mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #6857 from mwerezak/hoverpod
Hoverpod tweaks and mecha/working code cleanup
This commit is contained in:
@@ -438,9 +438,9 @@
|
||||
#include "code\game\mecha\equipment\tools\medical_tools.dm"
|
||||
#include "code\game\mecha\equipment\tools\tools.dm"
|
||||
#include "code\game\mecha\equipment\weapons\weapons.dm"
|
||||
#include "code\game\mecha\hoverpod\hoverpod.dm"
|
||||
#include "code\game\mecha\medical\medical.dm"
|
||||
#include "code\game\mecha\medical\odysseus.dm"
|
||||
#include "code\game\mecha\working\hoverpod.dm"
|
||||
#include "code\game\mecha\working\ripley.dm"
|
||||
#include "code\game\mecha\working\working.dm"
|
||||
#include "code\game\objects\empulse.dm"
|
||||
|
||||
@@ -628,7 +628,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
|
||||
/datum/supply_packs/hoverpod
|
||||
name = "Hoverpod Shipment"
|
||||
contains = list()
|
||||
cost = 75
|
||||
cost = 80
|
||||
containertype = /obj/structure/largecrate/hoverpod
|
||||
containername = "Hoverpod Crate"
|
||||
group = "Operations"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
energy_drain = 10
|
||||
var/dam_force = 20
|
||||
var/obj/mecha/working/ripley/cargo_holder
|
||||
required_type = list(/obj/mecha/working, /obj/mecha/hoverpod) //so that hoverpods are a bit more useful as space transportation
|
||||
required_type = /obj/mecha/working
|
||||
|
||||
attach(obj/mecha/M as obj)
|
||||
..()
|
||||
@@ -70,7 +70,7 @@
|
||||
equip_cooldown = 30
|
||||
energy_drain = 10
|
||||
force = 15
|
||||
required_type = list(/obj/mecha/working, /obj/mecha/combat)
|
||||
required_type = list(/obj/mecha/working/ripley, /obj/mecha/combat)
|
||||
|
||||
action(atom/target)
|
||||
if(!action_checks(target)) return
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
var/fire_sound //Sound played while firing.
|
||||
var/fire_volume = 50 //How loud it is played.
|
||||
var/auto_rearm = 0 //Does the weapon reload itself after each shot?
|
||||
required_type = /obj/mecha/combat
|
||||
required_type = list(/obj/mecha/combat, /obj/mecha/working/hoverpod/combatpod)
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/action_checks(atom/target)
|
||||
if(projectiles <= 0)
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
/obj/mecha/hoverpod
|
||||
desc = "Stubby and round, this space-capable craft is an ancient favorite."
|
||||
name = "Hover Pod"
|
||||
icon_state = "engineering_pod"
|
||||
initial_icon = "engineering_pod"
|
||||
internal_damage_threshold = 80
|
||||
step_in = 4
|
||||
step_energy_drain = 10
|
||||
max_temperature = 20000
|
||||
health = 150
|
||||
infra_luminosity = 6
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/hoverpod
|
||||
var/list/cargo = new
|
||||
var/cargo_capacity = 3
|
||||
max_equip = 2
|
||||
var/datum/effect/effect/system/ion_trail_follow/ion_trail
|
||||
|
||||
/obj/mecha/hoverpod/New()
|
||||
..()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T.z != 2)
|
||||
new /obj/item/mecha_parts/mecha_tracking(src)
|
||||
|
||||
ion_trail = new /datum/effect/effect/system/ion_trail_follow()
|
||||
ion_trail.set_up(src)
|
||||
ion_trail.start()
|
||||
|
||||
/obj/mecha/hoverpod/range_action(atom/target as obj|mob|turf)
|
||||
return
|
||||
|
||||
//No space drifting
|
||||
/obj/mecha/hoverpod/check_for_support()
|
||||
//does the hoverpod have enough charge left to stabilize itself?
|
||||
if (has_charge(step_energy_drain))
|
||||
if (!ion_trail.on)
|
||||
ion_trail.start()
|
||||
return 1
|
||||
|
||||
ion_trail.stop()
|
||||
return ..()
|
||||
|
||||
//these three procs overriden to play different sounds
|
||||
/obj/mecha/hoverpod/mechturn(direction)
|
||||
dir = direction
|
||||
//playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return 1
|
||||
|
||||
/obj/mecha/hoverpod/mechstep(direction)
|
||||
var/result = step(src,direction)
|
||||
if(result)
|
||||
playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return result
|
||||
|
||||
|
||||
/obj/mecha/hoverpod/mechsteprand()
|
||||
var/result = step_rand(src)
|
||||
if(result)
|
||||
playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return result
|
||||
|
||||
/obj/mecha/hoverpod/Exit(atom/movable/O)
|
||||
if(O in cargo)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/mecha/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/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/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
|
||||
|
||||
/* Commented out the combatpod as they can't reattach their equipment if it ever gets dropped,
|
||||
* and making a special exception for them seems lame.
|
||||
/obj/mecha/hoverpod/combatpod
|
||||
desc = "An ancient, run-down combat spacecraft." // Ideally would have a seperate icon.
|
||||
name = "Combat Hoverpod"
|
||||
health = 200
|
||||
internal_damage_threshold = 35
|
||||
|
||||
/obj/mecha/hoverpod/combatpod/New()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
|
||||
ME.attach(src)
|
||||
*/
|
||||
|
||||
/obj/mecha/hoverpod/shuttlepod
|
||||
desc = "Who knew a tiny ball could fit three people?"
|
||||
|
||||
/obj/mecha/hoverpod/shuttlepod/New()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
|
||||
ME.attach(src)
|
||||
102
code/game/mecha/working/hoverpod.dm
Normal file
102
code/game/mecha/working/hoverpod.dm
Normal file
@@ -0,0 +1,102 @@
|
||||
/obj/mecha/working/hoverpod
|
||||
desc = "Stubby and round, this space-capable craft is an ancient favorite."
|
||||
name = "Hover Pod"
|
||||
icon_state = "engineering_pod"
|
||||
initial_icon = "engineering_pod"
|
||||
internal_damage_threshold = 80
|
||||
step_in = 4
|
||||
step_energy_drain = 15
|
||||
max_temperature = 20000
|
||||
health = 150
|
||||
infra_luminosity = 6
|
||||
wreckage = /obj/effect/decal/mecha_wreckage/hoverpod
|
||||
cargo_capacity = 5
|
||||
max_equip = 3
|
||||
var/datum/effect/effect/system/ion_trail_follow/ion_trail
|
||||
var/stabilization_enabled = 1
|
||||
|
||||
/obj/mecha/working/hoverpod/New()
|
||||
..()
|
||||
ion_trail = new /datum/effect/effect/system/ion_trail_follow()
|
||||
ion_trail.set_up(src)
|
||||
ion_trail.start()
|
||||
|
||||
//Modified phazon code
|
||||
/obj/mecha/working/hoverpod/Topic(href, href_list)
|
||||
..()
|
||||
if (href_list["toggle_stabilization"])
|
||||
stabilization_enabled = !stabilization_enabled
|
||||
send_byjax(src.occupant,"exosuit.browser","stabilization_command","[stabilization_enabled?"Dis":"En"]able thruster stabilization")
|
||||
src.occupant_message("\blue Thruster stabilization [stabilization_enabled? "enabled" : "disabled"].")
|
||||
return
|
||||
|
||||
/obj/mecha/working/hoverpod/get_commands()
|
||||
var/output = {"<div class='wr'>
|
||||
<div class='header'>Special</div>
|
||||
<div class='links'>
|
||||
<a href='?src=\ref[src];toggle_stabilization=1'><span id="stabilization_command">[stabilization_enabled?"Dis":"En"]able thruster stabilization</span></a><br>
|
||||
</div>
|
||||
</div>
|
||||
"}
|
||||
output += ..()
|
||||
return output
|
||||
|
||||
//No space drifting
|
||||
/obj/mecha/working/hoverpod/check_for_support()
|
||||
//does the hoverpod have enough charge left to stabilize itself?
|
||||
if (!has_charge(step_energy_drain))
|
||||
ion_trail.stop()
|
||||
else
|
||||
if (!ion_trail.on)
|
||||
ion_trail.start()
|
||||
if (stabilization_enabled)
|
||||
return 1
|
||||
|
||||
return ..()
|
||||
|
||||
//these three procs overriden to play different sounds
|
||||
/obj/mecha/working/hoverpod/mechturn(direction)
|
||||
dir = direction
|
||||
//playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return 1
|
||||
|
||||
/obj/mecha/working/hoverpod/mechstep(direction)
|
||||
var/result = step(src,direction)
|
||||
if(result)
|
||||
playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return result
|
||||
|
||||
|
||||
/obj/mecha/working/hoverpod/mechsteprand()
|
||||
var/result = step_rand(src)
|
||||
if(result)
|
||||
playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return result
|
||||
|
||||
|
||||
//Hoverpod variants
|
||||
/obj/mecha/working/hoverpod/combatpod
|
||||
desc = "An ancient, run-down combat spacecraft." // Ideally would have a seperate icon.
|
||||
name = "Combat Hoverpod"
|
||||
health = 200
|
||||
internal_damage_threshold = 35
|
||||
cargo_capacity = 2
|
||||
max_equip = 2
|
||||
|
||||
/obj/mecha/working/hoverpod/combatpod/New()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
|
||||
ME.attach(src)
|
||||
|
||||
|
||||
/obj/mecha/working/hoverpod/shuttlepod
|
||||
desc = "Who knew a tiny ball could fit three people?"
|
||||
|
||||
/obj/mecha/working/hoverpod/shuttlepod/New()
|
||||
..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
|
||||
ME.attach(src)
|
||||
@@ -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)
|
||||
/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>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/range_action(atom/target as obj|mob|turf)
|
||||
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>"
|
||||
else
|
||||
output += "None"
|
||||
output += "</div>"
|
||||
return output
|
||||
*/
|
||||
@@ -70,5 +70,11 @@
|
||||
|
||||
/obj/structure/largecrate/hoverpod/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/crowbar))
|
||||
new /obj/mecha/hoverpod(loc)
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME
|
||||
var/obj/mecha/working/hoverpod/H = new (loc)
|
||||
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
|
||||
ME.attach(H)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
|
||||
ME.attach(H)
|
||||
..()
|
||||
Reference in New Issue
Block a user