Merge pull request #4383 from IK3I/Pod-Refactor

[Ready for Review] Pod refactor and fixes
This commit is contained in:
TheDZD
2016-05-31 20:48:05 -04:00
17 changed files with 522 additions and 373 deletions
@@ -17,17 +17,20 @@
var/data[0]
var/list/pods[0]
for(var/obj/item/device/spacepod_equipment/misc/tracker/TR in world)
var/obj/spacepod/myPod = TR.my_atom
var/obj/spacepod/my_pod = TR.my_atom
var/enabled = TR.enabled
if(myPod && enabled)
var/podname = capitalize(sanitize(myPod.name))
var/occupant = "None"
var/occupant2 = "None"
if(myPod.occupant)
occupant = myPod.occupant.name
if(myPod.occupant2)
occupant2 = myPod.occupant2.name
pods.Add(list(list("pod" = "\ref[myPod]", "name" = podname, "occupant" = occupant, "occupant2" = occupant2, "x" = myPod.x, "y" = myPod.y, "z" = myPod.z)))
if(my_pod && enabled)
var/podname = capitalize(sanitize(my_pod.name))
var/list/chairs = list()
if(my_pod.pilot || my_pod.passengers)
if(my_pod.pilot)
chairs += list("pilot" = my_pod.pilot.name)
var/i = 1
for(var/mob/M in my_pod.passengers)
chairs += list("passenger [i]" = M.name)
i++
pods.Add(list(list("pod" = "\ref[my_pod]", "name" = podname) + chairs + list("x" = my_pod.x, "y" = my_pod.y, "z" = my_pod.z)))
data["pods"] = pods
+1 -1
View File
@@ -519,7 +519,7 @@ var/list/turret_icons
assess_and_assign(ME.occupant, targets, secondarytargets)
for(var/obj/spacepod/SP in view(7,src))
assess_and_assign(SP.occupant, targets, secondarytargets)
assess_and_assign(SP.pilot, targets, secondarytargets)
for(var/obj/vehicle/T in view(7,src))
assess_and_assign(T.buckled_mob, targets, secondarytargets)
+10 -12
View File
@@ -21,7 +21,7 @@
turretTargets |= Mech
else if( istype(O, /obj/spacepod) )
var/obj/spacepod/Pod = O
if( Pod.occupant || Pod.occupant2 )
if( Pod.pilot )
turretTargets |= Pod
else if(istype(O,/mob/living/simple_animal))
turretTargets |= O
@@ -139,7 +139,7 @@
return 1
else if( istype(T, /obj/spacepod) )
var/obj/spacepod/SP = T
if( SP.occupant || SP.occupant2 )
if( SP.pilot )
return 1
else if(istype(T,/mob/living/simple_animal))
var/mob/living/simple_animal/A = T
@@ -159,8 +159,8 @@
if(M.occupant)
new_targets += M
for(var/obj/spacepod/M in protected_area.turretTargets)
if(M.occupant)
new_targets += M
if(M.pilot)
new_targets += M.pilot
for(var/mob/living/simple_animal/M in protected_area.turretTargets)
if(!M.stat)
new_targets += M
@@ -488,7 +488,7 @@
return 1
else if(istype(target, /obj/spacepod))
var/obj/spacepod/S = target
if(S.occupant || S.occupant2)
if(S.pilot)
return 1
return 0
@@ -522,14 +522,12 @@
continue //Don't shoot at empty mechs.
pos_targets += M
for(var/obj/spacepod/M in oview(scan_range, src))
if(M.occupant)
if(faction in M.occupant.faction)
if(M.pilot)
var/mob/P = M.pilot
if(faction in P.faction)
continue
if(M.occupant2)
if(faction in M.occupant2.faction)
continue
if(!M.occupant && !M.occupant2)
continue //Don't shoot at empty mechs.
if(!M.pilot)
continue //Don't shoot at empty pods.
pos_targets += M
if(pos_targets.len)
target = pick(pos_targets)
@@ -118,8 +118,8 @@
return 1
if(istype(the_target, /obj/spacepod))
var/obj/spacepod/S = the_target
if(S.occupant || S.occupant2)//Just so we don't attack empty mechs
if(CanAttack(S.occupant) || CanAttack(S.occupant2))
if(S.pilot) //Just so we don't attack empty pods
if(CanAttack(S.pilot))
return 1
if(isliving(the_target))
var/mob/living/L = the_target
@@ -14,7 +14,7 @@
return A
else if(istype(A, /obj/spacepod))
var/obj/spacepod/M = A
if(M.occupant || M.occupant2)
if(M.pilot)
return A
/mob/living/simple_animal/hostile/retaliate/ListTargets()
@@ -47,9 +47,9 @@
enemies |= M.occupant
else if(istype(A, /obj/spacepod))
var/obj/spacepod/M = A
if(M.occupant || M.occupant2)
if(M.pilot)
enemies |= M
enemies |= M.occupant
enemies |= M.pilot
for(var/mob/living/simple_animal/hostile/retaliate/H in around)
var/retaliate_faction_check = 0
@@ -536,7 +536,7 @@
return 0
if (istype(the_target,/obj/spacepod))
var/obj/spacepod/S = the_target
if (S.occupant || S.occupant2)
if (S.pilot)
return 0
return 1
@@ -12,6 +12,7 @@
//////////////////////////////////////////////////
/////////SPACEPOD PARTS///////////////////////////
//////////////////////////////////////////////////
/datum/design/podframe_fp
construction_time = 200
name = "Fore port pod frame"
@@ -89,6 +90,7 @@
//////////////////////////////////////////
//////SPACEPOD GUNS///////////////////////
//////////////////////////////////////////
/datum/design/pod_gun_taser
construction_time = 200
name = "Spacepod Equipment (Taser)"
@@ -157,6 +159,7 @@
materials = list(MAT_METAL = 10000, MAT_GLASS = 5000, MAT_SILVER = 4000, MAT_GOLD = 4000, MAT_DIAMOND = 4000)
build_path = /obj/item/device/spacepod_equipment/weaponry/mining_laser_hyper
category = list("Pod_Weaponry")
//////////////////////////////////////////
//////SPACEPOD MISC. ITEMS////////////////
//////////////////////////////////////////
@@ -172,16 +175,57 @@
build_path = /obj/item/device/spacepod_equipment/misc/tracker
category = list("Pod_Parts")
//////////////////////////////////////////
//////SPACEPOD CARGO ITEMS////////////////
//////////////////////////////////////////
/datum/design/pod_cargo_ore
construction_time = 100
name = "Spacepod Ore Storage Module"
desc = "Allows for the construction of a Space Pod Ore Storage Module."
id = "podcargo_ore"
req_tech = list("materials" = 3)
req_tech = list("materials" = 3, "engineering" = 2)
build_type = PODFAB
materials = list(MAT_METAL=20000, MAT_GLASS=2000)
build_path = /obj/item/device/spacepod_equipment/cargo/ore
category = list("Pod_Parts")
category = list("Pod_Cargo")
/datum/design/pod_cargo_crate
construction_time = 100
name = "Spacepod Crate Storage Module"
desc = "Allows the construction of a Space Pod Crate Storage Module."
id = "podcargo_crate"
req_tech = list("materials" = 4, "engineering" = 2) //hollowing out this much of the pod without compromising structural integrity is hard
build_type = PODFAB
materials = list(MAT_METAL=25000)
build_path = /obj/item/device/spacepod_equipment/cargo/crate
category = list("Pod_Cargo")
//////////////////////////////////////////
//////SPACEPOD SEC CARGO ITEMS////////////
//////////////////////////////////////////
/datum/design/passenger_seat
construction_time = 100
name = "Spacepod Passenger Seat"
desc = "Allows the construction of a Space Pod Passenger Seat Module."
id = "podcargo_sec_seat"
req_tech = list("materials" = 1) // Because rule number one of refactoring
build_type = PODFAB
materials = list(MAT_METAL=7500, MAT_GLASS=2500)
build_path = /obj/item/device/spacepod_equipment/sec_cargo/chair
category = list("Pod_Cargo")
/datum/design/loot_box
construction_time = 100
name = "Spacepod Loot Storage Module"
desc = "Allows the construction of a Space Pod Auxillary Cargo Module."
id = "podcargo_sec_lootbox"
req_tech = list("materials" = 1) //it's just a set of shelves, It's not that hard to make
build_type = PODFAB
materials = list(MAT_METAL=7500, MAT_GLASS=2500)
build_path = /obj/item/device/spacepod_equipment/sec_cargo/loot_box
category = list("Pod_Cargo")
//////////////////////////////////////////
//////SPACEPOD LOCK ITEMS////////////////
@@ -46,12 +46,13 @@
/datum/spacepod/equipment
var/obj/spacepod/my_atom
var/list/obj/item/device/spacepod_equipment/installed_modules // holds an easy to access list of installed modules
var/obj/item/device/spacepod_equipment/weaponry/weapon_system // weapons system
var/obj/item/device/spacepod_equipment/misc/misc_system // misc system
var/obj/item/device/spacepod_equipment/cargo/cargo_system // cargo system
var/obj/item/device/spacepod_equipment/cargo/sec_cargo_system // secondary cargo system
var/obj/item/device/spacepod_equipment/lock/lock_system // lock system
//var/obj/item/device/spacepod_equipment/engine/engine_system // engine system
//var/obj/item/device/spacepod_equipment/shield/shield_system // shielding system
/datum/spacepod/equipment/New(var/obj/spacepod/SP)
..()
@@ -61,11 +62,17 @@
/obj/item/device/spacepod_equipment
name = "equipment"
var/obj/spacepod/my_atom
var/occupant_mod = 0 // so any module can modify occupancy
var/list/storage_mod = list("slots" = 0, "w_class" = 0) // so any module can modify storage slots
/obj/item/device/spacepod_equipment/proc/removed(var/mob/user) // So that you can unload cargo when you remove the module
return
// base item for spacepod weapons
/*
///////////////////////////////////////
/////////Weapon System///////////////////
///////////////////////////////////////
*/
/obj/item/device/spacepod_equipment/weaponry
name = "pod weapon"
@@ -135,7 +142,12 @@
fire_delay = 8
fire_sound = 'sound/weapons/Kenetic_accel.ogg'
//base item for spacepod misc equipment (tracker)
/*
///////////////////////////////////////
/////////Misc. System///////////////////
///////////////////////////////////////
*/
/obj/item/device/spacepod_equipment/misc
name = "pod misc"
desc = "You shouldn't be seeing this"
@@ -160,37 +172,79 @@
else
..()
/*
///////////////////////////////////////
/////////Cargo System//////////////////
///////////////////////////////////////
*/
/obj/item/device/spacepod_equipment/cargo
name = "pod cargo"
desc = "You shouldn't be seeing this"
icon = 'icons/vehicles/spacepod.dmi'
icon_state = "blank"
icon_state = "cargo_blank"
var/obj/storage = null
/obj/item/device/spacepod_equipment/cargo/proc/passover(var/obj/item/I)
return
/obj/item/device/spacepod_equipment/cargo/proc/unload()
return
/obj/item/device/spacepod_equipment/cargo/proc/unload() // called by unload verb
if(storage)
storage.forceMove(get_turf(my_atom))
storage = null
/obj/item/device/spacepod_equipment/cargo/ore
name = "\improper spacepod ore storage system"
desc = "An ore storage system for spacepods. Scoops up any ore you drive over."
icon_state = "cargo_ore"
var/obj/structure/ore_box/box
/obj/item/device/spacepod_equipment/cargo/ore/passover(var/obj/item/I)
if(box && istype(I,/obj/item/weapon/ore))
I.forceMove(box)
/obj/item/device/spacepod_equipment/cargo/ore/unload()
if(box)
box.forceMove(get_turf(my_atom))
box = null
/obj/item/device/spacepod_equipment/cargo/ore/removed(var/mob/user)
/obj/item/device/spacepod_equipment/cargo/removed(var/mob/user) // called when system removed
. = ..()
unload()
// Ore System
/obj/item/device/spacepod_equipment/cargo/ore
name = "spacepod ore storage system"
desc = "An ore storage system for spacepods. Scoops up any ore you drive over."
icon_state = "cargo_ore"
/obj/item/device/spacepod_equipment/cargo/ore/passover(var/obj/item/I)
if(storage && istype(I,/obj/item/weapon/ore))
I.forceMove(storage)
// Crate System
/obj/item/device/spacepod_equipment/cargo/crate
name = "spacepod crate storage system"
desc = "A heavy duty storage system for spacepods. Holds one crate."
icon_state = "cargo_crate"
/*
///////////////////////////////////////
/////////Secondary Cargo System////////
///////////////////////////////////////
*/
/obj/item/device/spacepod_equipment/sec_cargo
name = "secondary cargo"
desc = "you shouldn't be seeing this"
icon = 'icons/vehicles/spacepod.dmi'
icon_state = "blank"
// Passenger Seat
/obj/item/device/spacepod_equipment/sec_cargo/chair
name = "passanger seat"
desc = "A passenger seat for a spacepod"
icon_state = "sec_cargo_chair"
occupant_mod = 1
// Loot Box
/obj/item/device/spacepod_equipment/sec_cargo/loot_box
name = "loot box"
desc = "A small compartment to store valuables"
icon_state = "sec_cargo_loot"
storage_mod = list("slots" = 7, "w_class" = 14)
/*
///////////////////////////////////////
/////////Lock System///////////////////
///////////////////////////////////////
*/
/obj/item/device/spacepod_equipment/lock
name = "pod lock"
desc = "You shouldn't be seeing this"
+13
View File
@@ -0,0 +1,13 @@
/obj/item/device/lock_buster
name = "pod lock buster"
desc = "Destroys a podlock in mere seconds once applied. Waranty void if used."
icon_state = "lock_buster_off"
var/on = 0
/obj/item/device/lock_buster/attack_self(mob/user as mob)
on = !on
if(on)
icon_state = "lock_buster_on"
else
icon_state = "lock_buster_off"
to_chat(usr, "<span class='notice'>You turn the [src] [on ? "on" : "off"].</span>")
@@ -35,6 +35,7 @@
var/list/part_sets = list(
"Pod_Weaponry",
"Pod_Armor",
"Pod_Cargo",
"Pod_Parts",
"Pod_Frame",
"Misc",
@@ -14,8 +14,10 @@
layer = 3.9
infra_luminosity = 15
var/mob/living/carbon/occupant
var/mob/living/carbon/occupant2 //two seaters
var/list/mob/pilot //There is only ever one pilot and he gets all the privledge
var/list/mob/passengers = list() //passengers can't do anything and are variable in number
var/max_passengers = 0
var/obj/item/weapon/storage/internal/cargo_hold
var/datum/spacepod/equipment/equipment_system
@@ -47,7 +49,7 @@
"pod_black" = "#3B8FE5", \
"pod_industrial" = "#CCCC00")
var/allow2enter = 1
var/unlocked = 1
var/move_delay = 2
var/next_move = 0
@@ -72,12 +74,19 @@
pr_give_air = new /datum/global_iterator/pod_tank_give_air(list(src))
equipment_system = new(src)
spacepods_list += src
cargo_hold = new/obj/item/weapon/storage/internal(src)
cargo_hold.w_class = 5 //so you can put bags in
cargo_hold.storage_slots = 0 //You need to install cargo modules to use it.
cargo_hold.max_w_class = 5 //fit almost anything
cargo_hold.max_combined_w_class = 0 //you can optimize your stash with larger items
/obj/spacepod/Destroy()
if (equipment_system.cargo_system)
equipment_system.cargo_system.removed(null)
qdel(equipment_system)
equipment_system = null
qdel(cargo_hold)
cargo_hold = null
qdel(battery)
battery = null
qdel(cabin_air)
@@ -91,12 +100,10 @@
qdel(ion_trail)
ion_trail = null
occupant_sanity_check()
if(occupant)
occupant.forceMove(get_turf(src))
occupant = null
if(occupant2)
occupant2.forceMove(get_turf(src))
occupant2 = null
if(passengers)
for(var/mob/M in passengers)
M.forceMove(get_turf(src))
passengers -= M
spacepods_list -= src
return ..()
@@ -106,7 +113,6 @@
else
processing_objects.Remove(src)
/obj/spacepod/proc/update_icons()
if(!pod_overlays)
pod_overlays = new/list(2)
@@ -155,34 +161,29 @@
health = max(0, health - damage)
var/percentage = (health / initial(health)) * 100
occupant_sanity_check()
if(occupant && oldhealth > health && percentage <= 25 && percentage > 0)
if(passengers && oldhealth > health && percentage <= 25 && percentage > 0)
var/sound/S = sound('sound/effects/engine_alert2.ogg')
S.wait = 0 //No queue
S.channel = 0 //Any channel
S.volume = 50
to_chat(occupant, S)
if(occupant2)
to_chat(occupant2, S)
if(occupant && oldhealth > health && !health)
for(var/mob/M in passengers)
to_chat(M, S)
if(passengers && oldhealth > health && !health)
var/sound/S = sound('sound/effects/engine_alert1.ogg')
S.wait = 0
S.channel = 0
S.volume = 50
to_chat(occupant, S)
if(occupant2)
to_chat(occupant2, S)
for(var/mob/M in passengers)
to_chat(M, S)
if(!health)
spawn(0)
if(occupant)
to_chat(occupant, "<span class='userdanger'>Critical damage to the vessel detected, core explosion imminent!</span>")
if(occupant2)
to_chat(occupant2, "<span class='userdanger'>Critical damage to the vessel detected, core explosion imminent!</span>")
if(passengers)
for(var/mob/M in passengers)
to_chat(M, "<span class='userdanger'>Critical damage to the vessel detected, core explosion imminent!</span>")
for(var/i = 10, i >= 0; --i)
if(occupant)
to_chat(occupant, "<span class='warning'>[i]</span>")
if(occupant2)
to_chat(occupant2, "<span class='warning'>[i]</span>")
if(passengers)
for(var/mob/M in passengers)
to_chat(M, "<span class='warning'>[i]</span>")
if(i == 0)
explosion(loc, 2, 4, 8)
qdel(src)
@@ -200,16 +201,12 @@
occupant_sanity_check()
switch(severity)
if(1)
var/mob/living/carbon/human/H = occupant
var/mob/living/carbon/human/H2 = occupant2
if(H)
H.forceMove(get_turf(src))
H.ex_act(severity + 1)
to_chat(H, "<span class='warning'>You are forcefully thrown from \the [src]!</span>")
if(H2)
H2.forceMove(get_turf(src))
H2.ex_act(severity + 1)
to_chat(H2, "<span class='warning'>You are forcefully thrown from \the [src]!</span>")
for(var/mob/M in passengers)
var/mob/living/carbon/human/H = M
if(H)
H.forceMove(get_turf(src))
H.ex_act(severity + 1)
to_chat(H, "<span class='warning'>You are forcefully thrown from \the [src]!</span>")
qdel(ion_trail)
qdel(src)
if(2)
@@ -220,12 +217,14 @@
/obj/spacepod/emp_act(severity)
occupant_sanity_check()
cargo_hold.emp_act(severity)
switch(severity)
if(1)
if(occupant)
to_chat(occupant, "<span class='warning'>The pod console flashes 'Heavy EMP WAVE DETECTED'.</span>")//warn the occupants
if(occupant2)
to_chat(occupant2, "<span class='warning'>The pod console flashes 'Heavy EMP WAVE DETECTED'.</span>")//warn the occupants
if(pilot)
to_chat(pilot, "<span class='warning'>The pod console flashes 'Heavy EMP WAVE DETECTED'.</span>")
if(passengers)
for(var/mob/M in passengers)
to_chat(M, "<span class='warning'>The pod console flashes 'Heavy EMP WAVE DETECTED'.</span>")//warn the passengers
if(battery)
@@ -236,10 +235,11 @@
processing_objects.Add(src)
if(2)
if(occupant)
to_chat(occupant, "<span class='warning'>The pod console flashes 'EMP WAVE DETECTED'.</span>")//warn the occupants
if(occupant2)
to_chat(occupant2, "<span class='warning'>The pod console flashes 'EMP WAVE DETECTED'.</span>")//warn the occupants
if(pilot)
to_chat(pilot, "<span class='warning'>The pod console flashes 'EMP WAVE DETECTED'.</span>")
if(passengers)
for(var/mob/M in passengers)
to_chat(M, "<span class='warning'>The pod console flashes 'EMP WAVE DETECTED'.</span>")//warn the passengers
deal_damage(40)
if(battery)
@@ -250,12 +250,13 @@
/obj/spacepod/attackby(obj/item/W as obj, mob/user as mob, params)
if(iscrowbar(W))
if(!equipment_system.lock_system || allow2enter || hatch_open)
if(!equipment_system.lock_system || unlocked || hatch_open)
hatch_open = !hatch_open
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
to_chat(user, "<span class='notice'>You [hatch_open ? "open" : "close"] the maintenance hatch.</span>")
else
to_chat(user, "<span class='warning'>The hatch is locked shut!</span>")
return
if(istype(W, /obj/item/weapon/stock_parts/cell))
if(!hatch_open)
to_chat(user, "\red The maintenance hatch is closed!")
@@ -272,61 +273,32 @@
to_chat(user, "\red The maintenance hatch is closed!")
return
if(!equipment_system)
to_chat(user, "<span class='warning'>The pod has no equipment datum, yell at pomf</span>")
to_chat(user, "<span class='warning'>The pod has no equipment datum, yell at the coders</span>")
return
if(istype(W, /obj/item/device/spacepod_equipment/weaponry))
if(equipment_system.weapon_system)
to_chat(user, "<span class='notice'>The pod already has a weapon system, remove it first.</span>")
return
else
to_chat(user, "<span class='notice'>You insert \the [W] into the equipment system.</span>")
user.drop_item(W)
W.forceMove(src)
equipment_system.weapon_system = W
equipment_system.weapon_system.my_atom = src
return
add_equipment(user, W, "weapon_system")
return
if(istype(W, /obj/item/device/spacepod_equipment/misc))
if(equipment_system.misc_system)
to_chat(user, "<span class='notice'>The pod already has a miscellaneous system, remove it first.</span>")
return
else
to_chat(user, "<span class='notice'>You insert \the [W] into the equipment system.</span>")
user.drop_item(W)
W.forceMove(src)
equipment_system.misc_system = W
equipment_system.misc_system.my_atom = src
return
add_equipment(user, W, "misc_system")
return
if(istype(W, /obj/item/device/spacepod_equipment/cargo))
if(equipment_system.cargo_system)
to_chat(user, "<span class='notice'>The pod already has a cargo system, remove it first.</span>")
return
else
to_chat(user, "<span class='notice'>You insert \the [W] into the cargo system.</span>")
user.drop_item(W)
W.forceMove(src)
equipment_system.cargo_system = W
equipment_system.cargo_system.my_atom = src
return
add_equipment(user, W, "cargo_system")
return
if(istype(W, /obj/item/device/spacepod_equipment/sec_cargo))
add_equipment(user, W, "sec_cargo_system")
return
if(istype(W, /obj/item/device/spacepod_equipment/lock))
if(equipment_system.lock_system)
to_chat(user, "<span class='notice'>The pod already has a lock system, remove it first.</span>")
return
else
to_chat(user, "<span class='notice'>You insert \the [W] into the lock system.</span>")
user.drop_item(W)
W.forceMove(src)
equipment_system.lock_system = W
equipment_system.lock_system.my_atom = src
return
add_equipment(user, W, "lock_system")
return
if(istype(W, /obj/item/device/spacepod_key) && istype(equipment_system.lock_system, /obj/item/device/spacepod_equipment/lock/keyed))
var/obj/item/device/spacepod_key/key = W
if (key.id == equipment_system.lock_system.id)
locksecondseat()
lock_pod()
return
else
to_chat(user, "<span class='warning'>This is the wrong key!</span>")
return
return
if(istype(W, /obj/item/weapon/weldingtool))
if(!hatch_open)
@@ -343,15 +315,76 @@
if(!src || !WT.remove_fuel(3, user)) return
repair_damage(10)
to_chat(user, "\blue You mend some [pick("dents","bumps","damage")] with \the [WT]")
else
to_chat(user, "\blue <b>\The [src] is fully repaired!</b>")
return
to_chat(user, "\blue <b>\The [src] is fully repaired!</b>")
return
if(istype(W, /obj/item/device/lock_buster))
var/obj/item/device/lock_buster/L = W
if(L.on & equipment_system.lock_system)
user.visible_message(user, "<span class='warning'>[user] is drilling through the [src]'s lock!</span>",
"<span class='notice'>You start drilling through the [src]'s lock!</span>")
if(do_after(user, 100, target = src))
qdel(equipment_system.lock_system)
equipment_system.lock_system = null
user.visible_message(user, "<span class='warning'>[user] has destroyed the [src]'s lock!</span>",
"<span class='notice'>You destroy the [src]'s lock!</span>")
else
user.visible_message(user, "<span class='warning'>[user] fails to break through the [src]'s lock!</span>",
"<span class='notice'>You were unable to break through the [src]'s lock!</span>")
return
to_chat(user, "<span class='notice'>Turn the [L] on first.</span>")
return
if(cargo_hold.storage_slots > 0 && !hatch_open && unlocked) // must be the last option as all items not listed prior will be stored
cargo_hold.attackby(W, user, params)
obj/spacepod/proc/add_equipment(mob/user, var/obj/item/device/spacepod_equipment/SPE, var/slot)
if(equipment_system.vars[slot])
to_chat(user, "<span class='notice'>The pod already has a [slot], remove it first.</span>")
return
else
to_chat(user, "<span class='notice'>You insert \the [SPE] into the pod.</span>")
user.drop_item(SPE)
SPE.forceMove(src)
equipment_system.vars[slot] = SPE
var/obj/item/device/spacepod_equipment/system = equipment_system.vars[slot]
system.my_atom = src
equipment_system.installed_modules += SPE
max_passengers += SPE.occupant_mod
cargo_hold.storage_slots += SPE.storage_mod["slots"]
cargo_hold.max_combined_w_class += SPE.storage_mod["w_class"]
/obj/spacepod/attack_hand(mob/user as mob)
if(user.a_intent == I_GRAB && unlocked)
var/mob/target
if(pilot)
target = pilot
else if(passengers.len > 0)
target = passengers[1]
if(target && istype(target))
src.visible_message("<span class='warning'>[user] is trying to rip the door open and pull [target] out of the [src]!</span>",
"<span class='warning'>You see [user] outside the door trying to rip it open!</span>")
if(do_after(user, 50, target = src))
target.forceMove(get_turf(src))
target.Stun(1)
passengers -= target
target.visible_message("<span class='warning'>[user] flings the door open and tears [target] out of the [src]</span>",
"<span class='warning'>The door flies open and you are thrown out of the [src] and to the ground!</span>")
return
target.visible_message("<span class='warning'>[user] was unable to get the door open!</span>",
"<span class='warning'>You manage to keep [user] out of the [src]!</span>")
if(!hatch_open)
if(cargo_hold.storage_slots > 0)
if(unlocked)
cargo_hold.open(user)
else
to_chat(user, "<span class='notice'>The storage compartment is locked</span>")
return ..()
if(!equipment_system || !istype(equipment_system))
to_chat(user, "<span class='warning'>The pod has no equpment datum, or is the wrong type, yell at pomf.</span>")
to_chat(user, "<span class='warning'>The pod has no equpment datum, or is the wrong type, yell at IK3I.</span>")
return
var/list/possible = list()
if(battery)
@@ -362,74 +395,81 @@
possible.Add("Misc. System")
if(equipment_system.cargo_system)
possible.Add("Cargo System")
if(equipment_system.sec_cargo_system)
possible.Add("Secondary Cargo System")
if(equipment_system.lock_system)
possible.Add("Lock System")
/* Not yet implemented
if(equipment_system.engine_system)
possible.Add("Engine System")
if(equipment_system.shield_system)
possible.Add("Shield System")
*/
var/obj/item/device/spacepod_equipment/SPE
switch(input(user, "Remove which equipment?", null, null) as null|anything in possible)
if("Energy Cell")
if(user.put_in_any_hand_if_possible(battery))
to_chat(user, "<span class='notice'>You remove \the [battery] from the space pod</span>")
battery = null
else
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
return
if("Weapon System")
SPE = equipment_system.weapon_system
if(user.put_in_any_hand_if_possible(SPE))
to_chat(user, "<span class='notice'>You remove \the [SPE] from the equipment system.</span>")
SPE.removed(user)
SPE.my_atom = null
equipment_system.weapon_system = null
else
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
remove_equipment(user, equipment_system.weapon_system, "weapon_system")
return
if("Misc. System")
SPE = equipment_system.misc_system
if(user.put_in_any_hand_if_possible(SPE))
to_chat(user, "<span class='notice'>You remove \the [SPE] from the equipment system.</span>")
SPE.removed(user)
SPE.my_atom = null
equipment_system.misc_system = null
else
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
remove_equipment(user, equipment_system.misc_system, "misc_system")
return
if("Cargo System")
SPE = equipment_system.cargo_system
if(user.put_in_any_hand_if_possible(SPE))
to_chat(user, "<span class='notice'>You remove \the [SPE] from the equipment system.</span>")
SPE.removed(user)
SPE.my_atom = null
equipment_system.cargo_system = null
else
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
remove_equipment(user, equipment_system.cargo_system, "cargo_system")
return
if("Secondary Cargo System")
remove_equipment(user, equipment_system.sec_cargo_system, "sec_cargo_system")
return
if("Lock System")
SPE = equipment_system.lock_system
if(user.put_in_any_hand_if_possible(SPE))
to_chat(user, "<span class='notice'>You remove \the [SPE] from the equipment system.</span>")
SPE.removed(user)
SPE.my_atom = null
equipment_system.lock_system = null
else
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
/*
if("engine system")
SPE = equipment_system.engine_system
if(user.put_in_any_hand_if_possible(SPE))
to_chat(user, "<span class='notice'>You remove \the [SPE] from the equipment system.</span>")
equipment_system.engine_system = null
else
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
if("shield system")
SPE = equipment_system.shield_system
if(user.put_in_any_hand_if_possible(SPE))
to_chat(user, "<span class='notice'>You remove \the [SPE] from the equipment system.</span>")
equipment_system.shield_system = null
else
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
*/
remove_equipment(user, equipment_system.lock_system, "lock_system")
return
/obj/spacepod/proc/remove_equipment(mob/user, var/obj/item/device/spacepod_equipment/SPE, var/slot)
if(passengers.len > max_passengers - SPE.occupant_mod)
to_chat(user, "<span class='warning'>Someone is sitting in \the [SPE]!</span>")
return
var/sum_w_class = 0
for(var/obj/item/I in cargo_hold.contents)
sum_w_class += I.w_class
if(cargo_hold.contents.len > cargo_hold.storage_slots - SPE.storage_mod["slots"] || sum_w_class > cargo_hold.max_combined_w_class - SPE.storage_mod["w_class"])
to_chat(user, "<span class='warning'>Empty \the [SPE] first!</span>")
return
if(user.put_in_any_hand_if_possible(SPE))
to_chat(user, "<span class='notice'>You remove \the [SPE] from the equipment system.</span>")
equipment_system.installed_modules -= SPE
max_passengers -= SPE.occupant_mod
cargo_hold.storage_slots -= SPE.storage_mod["slots"]
cargo_hold.max_combined_w_class -= SPE.storage_mod["w_class"]
SPE.removed(user)
SPE.my_atom = null
equipment_system.vars[slot] = null
return
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
/obj/spacepod/hear_talk/hear_talk(mob/M, var/msg)
cargo_hold.hear_talk(M, msg)
..()
/obj/spacepod/hear_message(mob/M, var/msg)
cargo_hold.hear_message(M, msg)
..()
/obj/spacepod/proc/return_inv()
var/list/L = list( )
L += src.contents
for(var/obj/item/weapon/storage/S in src)
L += S.return_inv()
for(var/obj/item/weapon/gift/G in src)
L += G.gift
if (istype(G.gift, /obj/item/weapon/storage))
var/obj/item/weapon/storage/inv = G.gift
L += inv.return_inv()
return L
/obj/spacepod/civilian
icon_state = "pod_civ"
@@ -456,12 +496,16 @@
equipment_system.misc_system = L
equipment_system.misc_system.my_atom = src
equipment_system.misc_system.enabled = 1
var/obj/item/device/spacepod_equipment/sec_cargo/chair/C = new /obj/item/device/spacepod_equipment/sec_cargo/chair
C.loc = equipment_system
equipment_system.sec_cargo_system = C
equipment_system.sec_cargo_system.my_atom = src
max_passengers = 1
var/obj/item/device/spacepod_equipment/lock/keyed/K = new /obj/item/device/spacepod_equipment/lock/keyed
K.loc = equipment_system
equipment_system.lock_system = K
equipment_system.lock_system.my_atom = src
equipment_system.lock_system.id = 100000
return
/obj/spacepod/random/New()
..()
@@ -486,11 +530,11 @@
set category = "Spacepod"
set src = usr.loc
set popup_menu = 0
if(usr!=src.occupant)
if(usr != src.pilot)
to_chat(usr, "<span class='notice'>You can't reach the controls from your chair")
return
use_internal_tank = !use_internal_tank
to_chat(occupant, "<span class='notice'>Now taking air from [use_internal_tank?"internal airtank":"environment"].</span>")
return
to_chat(usr, "<span class='notice'>Now taking air from [use_internal_tank?"internal airtank":"environment"].</span>")
/obj/spacepod/proc/add_cabin()
cabin_air = new
@@ -508,7 +552,6 @@
var/turf/T = get_turf(src)
if(T)
. = T.return_air()
return
/obj/spacepod/remove_air(amount)
if(use_internal_tank)
@@ -517,7 +560,6 @@
var/turf/T = get_turf(src)
if(T)
return T.remove_air(amount)
return
/obj/spacepod/return_air()
if(use_internal_tank)
@@ -532,7 +574,6 @@
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
. = t_air.return_pressure()
return
/obj/spacepod/proc/return_temperature()
. = 0
@@ -542,19 +583,21 @@
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
. = t_air.return_temperature()
return
/obj/spacepod/proc/moved_other_inside(var/mob/living/carbon/human/H as mob)
occupant_sanity_check()
if(!occupant2)
if(passengers.len < max_passengers)
H.stop_pulling()
H.forceMove(src)
occupant2 = H
passengers += H
H.forceMove(src)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
return 1
/obj/spacepod/MouseDrop_T(atom/A, mob/user)
if(user == pilot || user in passengers)
return
if(istype(A,/mob))
var/mob/M = A
if(!isliving(M))
@@ -562,48 +605,51 @@
occupant_sanity_check()
if(M != user && M.stat == DEAD && allow2enter)
if(occupant2 && !occupant)
to_chat(usr, "<span class='danger'><b>You can't put a corpse into the driver's seat!</b></span>")
if(M != user && unlocked && (M.stat == DEAD || M.incapacitated()))
if(passengers.len >= max_passengers && !pilot)
to_chat(usr, "<span class='danger'><b>That person can't fly the pod!</b></span>")
return 0
if(!occupant2)
if(passengers.len < max_passengers)
visible_message("<span class='danger'>[user.name] starts loading [M.name] into the pod!</span>")
sleep(10)
moved_other_inside(M)
if(do_after(user, 50, target = M))
moved_other_inside(M)
return
if(M == user)
if(!equipment_system.lock_system || allow2enter)
enter_pod(user)
else
to_chat(user, "<span class='warning'>\The [src]'s doors are locked!</span>")
enter_pod(user)
return
if(istype(A, /obj/structure/ore_box)) // For loading ore boxes
var/obj/structure/ore_box/O = A
if(equipment_system.cargo_system && istype(equipment_system.cargo_system,/obj/item/device/spacepod_equipment/cargo/ore))
var/obj/item/device/spacepod_equipment/cargo/ore/C = equipment_system.cargo_system
if(!C.box)
to_chat(user, "<span class='notice'>You begin loading \the [O] into \the [src]'s [equipment_system.cargo_system]</span>")
if(do_after(user, 40, target = src))
C.box = O
O.forceMove(C)
to_chat(user, "<span class='notice'>You load \the [O] into \the [src]'s [equipment_system.cargo_system]!</span>")
else
to_chat(user, "<span class='warning'>You fail to load \the [O] into \the [src]'s [equipment_system.cargo_system]</span>")
else
to_chat(user, "<span class='warning'>\The [src] already has \an [C.box]</span>")
/obj/spacepod/verb/enter_pod(mob/user = usr)
set category = "Object"
set name = "Enter Pod"
set src in oview(1)
if (usr.stat != CONSCIOUS)
if(istype(A, /obj/structure/ore_box) && equipment_system.cargo_system && istype(equipment_system.cargo_system,/obj/item/device/spacepod_equipment/cargo/ore)) // For loading ore boxes
load_cargo(user, A)
return
if(istype(A, /obj/structure/closet/crate) && equipment_system.cargo_system && istype(equipment_system.cargo_system, /obj/item/device/spacepod_equipment/cargo/crate)) // For loading crates
load_cargo(user, A)
/obj/spacepod/proc/load_cargo(mob/user, var/obj/O)
var/obj/item/device/spacepod_equipment/cargo/ore/C = equipment_system.cargo_system
if(!C.storage)
to_chat(user, "<span class='notice'>You begin loading \the [O] into \the [src]'s [equipment_system.cargo_system]</span>")
if(do_after(user, 40, target = src))
C.storage = O
O.forceMove(C)
to_chat(user, "<span class='notice'>You load \the [O] into \the [src]'s [equipment_system.cargo_system]!</span>")
else
to_chat(user, "<span class='warning'>You fail to load \the [O] into \the [src]'s [equipment_system.cargo_system]</span>")
else
to_chat(user, "<span class='warning'>\The [src] already has \an [C.storage]</span>")
/obj/spacepod/proc/enter_pod(mob/user)
if (usr.stat != CONSCIOUS)
return 0
if(equipment_system.lock_system && !unlocked)
to_chat(user, "<span class='warning'>\The [src]'s doors are locked!</span>")
return 0
if(get_dist(src, user) > 2 || get_dist(usr, user) > 1)
to_chat(usr, "They are too far away to put inside")
return
return 0
if(!istype(user))
return 0
@@ -632,53 +678,45 @@
occupant_sanity_check()
if(!occupant)
if(passengers.len <= max_passengers)
visible_message("<span class='notice'>[user] starts to climb into \the [src].</span>")
if(do_after(user, 40, target = src))
if(!occupant)
if(!pilot || pilot == null)
user.stop_pulling()
occupant = user
pilot = user
user.forceMove(src)
add_fingerprint(user)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
return
if(passengers.len < max_passengers)
user.stop_pulling()
passengers += user
user.forceMove(src)
add_fingerprint(user)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
else
to_chat(user, "<span class='notice'>[occupant] was faster. Try better next time, loser.</span>")
else
to_chat(user, "<span class='notice'>You stop entering \the [src].</span>")
else if(!occupant2)
visible_message("<span class='notice'>[user] starts to climb into \the [src].</span>")
if(do_after(user, 40, target = src))
if(!occupant2)
user.stop_pulling()
occupant2 = user
user.forceMove(src)
add_fingerprint(user)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
else
to_chat(user, "<span class='notice'>[occupant] was faster. Try better next time, loser.</span>")
to_chat(user, "<span class='notice'>You were too slow. Try better next time, loser.</span>")
else
to_chat(user, "<span class='notice'>You stop entering \the [src].</span>")
else
to_chat(user, "<span class='danger'>You can't fit in \the [src], it's full!</span>")
/obj/spacepod/proc/occupant_sanity_check()
if(occupant)
if(!ismob(occupant))
occupant.forceMove(get_turf(src))
log_debug("##SPACEPOD WARNING: NON-MOB OCCUPANT [occupant], TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
occupant = null
else if(occupant.loc != src)
log_debug("##SPACEPOD WARNING: OCCUPANT [occupant] ESCAPED, TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
occupant = null
if(occupant2)
if(!ismob(occupant2))
occupant2.forceMove(get_turf(src))
log_debug("##SPACEPOD WARNING: NON-MOB OCCUPANT [occupant2], TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
occupant2 = null
else if(occupant2.loc != src)
log_debug("##SPACEPOD WARNING: OCCUPANT [occupant2] ESCAPED, TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
occupant2 = null
/obj/spacepod/proc/occupant_sanity_check() // going to have to adjust this later for cargo refactor
if(passengers)
if(passengers.len > max_passengers)
for(var/i = passengers.len; i <= max_passengers; i--)
var/mob/occupant = passengers[i - 1]
occupant.forceMove(get_turf(src))
log_debug("##SPACEPOD WARNING: passengers EXCEED CAP: MAX passengers [max_passengers], passengers [english_list(passengers)], TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
passengers[i - 1] = null
for(var/mob/M in passengers)
if(!ismob(M))
M.forceMove(get_turf(src))
log_debug("##SPACEPOD WARNING: NON-MOB OCCUPANT [M], TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
passengers -= M
else if(M.loc != src)
log_debug("##SPACEPOD WARNING: OCCUPANT [M] ESCAPED, TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
passengers -= M
/obj/spacepod/verb/exit_pod()
set name = "Exit pod"
@@ -686,64 +724,34 @@
set src = usr.loc
var/mob/user = usr
var/spos = 0
if(!istype(user))
return
occupant_sanity_check()
if(occupant == user) spos = 1
if(occupant2 == user) spos = 2
switch(spos)
if(0) return
if(1)
if(occupant2)
to_chat(occupant2, "<span class='notice'>[occupant.name] climbs out of the pod!</span>")
occupant.forceMove(src.loc)
occupant = null
to_chat(user, "<span class='notice'>You climb out of \the [src].</span>")
if(2)
if(occupant)
to_chat(occupant, "<span class='notice'>[occupant2.name] climbs out of the pod!</span>")
occupant2.forceMove(src.loc)
occupant2 = null
to_chat(user, "<span class='notice'>You climb out of \the [src].</span>")
/obj/spacepod/verb/exit_pod2()
set name = "Eject Secondary Seat"
set category = "Spacepod"
set src = usr.loc
if (user.stat != CONSCIOUS || user.incapacitated()) // unconscious and restrained people can't let themselves out
return
occupant_sanity_check()
if(!occupant2)
to_chat(usr, "<span class='notice'>There is no one in the second seat.</span>")
return
if(user == pilot)
user.forceMove(get_turf(src))
pilot = null
to_chat(user, "<span class='notice'>You climb out of \the [src].</span>")
if(user in passengers)
user.forceMove(get_turf(src))
passengers -= user
to_chat(user, "<span class='notice'>You climb out of \the [src].</span>")
if(usr == occupant2)
to_chat(usr, "<span class='notice'>How do you plan to do that? The eject button is out of reach.</span>")
return
if(usr == occupant)
to_chat(usr, "<span class='notice'>You eject [occupant2.name].</span>")
to_chat(occupant2, "<span class='danger'>\The [src] ejects you forcefully!</span>")
inertia_dir = 0
occupant2.forceMove(src.loc)
occupant2 = null
/obj/spacepod/verb/locksecondseat()
/obj/spacepod/verb/lock_pod()
set name = "Lock Doors"
set category = "Spacepod"
set src = usr.loc
if(CheckIfOccupant2(usr))
if(!allow2enter)
to_chat(usr, "<span class='notice'>You can't [allow2enter ? "lock" : "unlock"] the doors from your seat.</span>")
return
if(usr in passengers && usr != src.pilot)
to_chat(usr, "<span class='notice'>You can't reach the controls from your chair")
return
allow2enter = !allow2enter
to_chat(usr, "<span class='warning'>You [allow2enter ? "unlock" : "lock"] the doors.</span>")
unlocked = !unlocked
to_chat(usr, "<span class='warning'>You [unlocked ? "unlock" : "lock"] the doors.</span>")
/obj/spacepod/verb/toggleDoors()
@@ -751,7 +759,10 @@
set category = "Spacepod"
set src = usr.loc
if(CheckIfOccupant2(usr)) return
if(usr != src.pilot)
to_chat(usr, "<span class='notice'>You can't reach the controls from your chair")
return
for(var/obj/machinery/door/poddoor/multi_tile/P in orange(3,src))
var/mob/living/carbon/human/L = usr
if(P.check_access(L.get_active_hand()) || P.check_access(L.wear_id))
@@ -761,41 +772,53 @@
else
P.close()
return 1
for(var/mob/living/carbon/human/O in passengers)
if(P.check_access(O.get_active_hand()) || P.check_access(O.wear_id))
if(P.density)
P.open()
return 1
else
P.close()
return 1
to_chat(usr, "<span class='warning'>Access denied.</span>")
return
to_chat(usr, "<span class='warning'>You are not close to any pod doors.</span>")
return
/obj/spacepod/verb/fireWeapon()
if(!CheckIfOccupant2(usr))
set name = "Fire Pod Weapons"
set desc = "Fire the weapons."
set category = "Spacepod"
set src = usr.loc
if(!equipment_system.weapon_system)
to_chat(usr, "<span class='warning'>\The [src] has no weapons!</span>")
return
equipment_system.weapon_system.fire_weapons()
set name = "Fire Pod Weapons"
set desc = "Fire the weapons."
set category = "Spacepod"
set src = usr.loc
if(usr != src.pilot)
to_chat(usr, "<span class='notice'>You can't reach the controls from your chair")
return
if(!equipment_system.weapon_system)
to_chat(usr, "<span class='warning'>\The [src] has no weapons!</span>")
return
equipment_system.weapon_system.fire_weapons()
/obj/spacepod/verb/unload()
if(!CheckIfOccupant2(usr))
set name = "Unload Cargo"
set desc = "Unloads the cargo"
set category = "Spacepod"
set src = usr.loc
if(!equipment_system.cargo_system)
to_chat(usr, "<span class='warning'>\The [src] has no cargo system!</span>")
return
equipment_system.cargo_system.unload()
set name = "Unload Cargo"
set desc = "Unloads the cargo"
set category = "Spacepod"
set src = usr.loc
if(usr != src.pilot)
to_chat(usr, "<span class='notice'>You can't reach the controls from your chair")
return
if(!equipment_system.cargo_system)
to_chat(usr, "<span class='warning'>\The [src] has no cargo system!</span>")
return
equipment_system.cargo_system.unload()
/obj/spacepod/verb/toggleLights()
set name = "Toggle Lights"
set category = "Spacepod"
set src = usr.loc
if(!CheckIfOccupant2(usr))
lightsToggle()
if(usr != src.pilot)
to_chat(usr, "<span class='notice'>You can't reach the controls from your chair")
return
lightsToggle()
/obj/spacepod/proc/lightsToggle()
lights = !lights
@@ -803,8 +826,30 @@
set_light(lights_power)
else
set_light(0)
to_chat(occupant, "Toggled lights [lights ? "on" : "off"].")
return
to_chat(usr, "Lights toggled [lights ? "on" : "off"].")
for(var/mob/M in passengers)
to_chat(M, "Lights toggled [lights ? "on" : "off"].")
/obj/spacepod/verb/checkSeat()
set name = "Check under Seat"
set category = "Spacepod"
set src = usr.loc
var/mob/user = usr
to_chat(user, "<span class='notice'>You start rooting around under the seat for lost items</span>")
if(do_after(user, 40, target = src))
var/obj/badlist = list(internal_tank, cargo_hold, pilot, battery) + passengers + equipment_system.installed_modules
var/list/true_contents = contents - badlist
if(true_contents.len > 0)
var/obj/I = pick(true_contents)
if(user.put_in_any_hand_if_possible(I))
src.contents -= I
to_chat(user, "<span class='notice'>You find a [I] [pick("under the seat", "under the console", "in the mainenance access")]!</span>")
else
to_chat(user, "<span class='notice'>You think you saw something shiny, but you can't reach it!</span>")
else
to_chat(user, "<span class='notice'>You fail to find anything of value.</span>")
else
to_chat(user, "<span class='notice'>You decide against searching the [src]</span>")
/obj/spacepod/proc/enter_after(delay as num, var/mob/user as mob, var/numticks = 5)
var/delayfraction = delay/numticks
@@ -825,7 +870,6 @@
if(spacepod.cabin_air && spacepod.cabin_air.return_volume() > 0)
var/delta = spacepod.cabin_air.temperature - T20C
spacepod.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1)))
return
/datum/global_iterator/pod_tank_give_air
delay = 15
@@ -858,11 +902,11 @@
qdel(removed)
else
return stop()
return
/obj/spacepod/relaymove(mob/user, direction)
if(!CheckIfOccupant2(user))
handlerelaymove(user, direction)
if(usr != src.pilot)
return
handlerelaymove(user, direction)
/obj/spacepod/proc/handlerelaymove(mob/user, direction)
if(world.time < next_move)
@@ -909,15 +953,6 @@
battery.charge = max(0, battery.charge - 1)
next_move = world.time + move_delay
/obj/spacepod/proc/CheckIfOccupant2(mob/user)
if(!src.occupant2)
return 0
if(src.occupant2)
if(user == src.occupant2)
return 1
else
return 0
/obj/effect/landmark/spacepod/random
name = "spacepod spawner"
invisibility = 101
@@ -929,4 +964,4 @@
..()
#undef DAMAGE
#undef FIRE
#undef FIRE