|
|
|
@@ -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
|