From e2082e266e0f5781dd1e7bd208e3ec398cb01f28 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Mon, 15 Dec 2014 06:56:06 -0800 Subject: [PATCH 1/3] Major spacepod overhaul. Allow's for two people per spacepod. Makes prisoner transport viable via click-drag and new 'lock secondary door' option. --- code/game/vehicles/spacepods/spacepod.dm | 376 +++++++++++++++++------ 1 file changed, 289 insertions(+), 87 deletions(-) diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm index e41bfee03fd..ddfc38c7eb7 100644 --- a/code/game/vehicles/spacepods/spacepod.dm +++ b/code/game/vehicles/spacepods/spacepod.dm @@ -12,6 +12,7 @@ layer = 3.9 infra_luminosity = 15 var/mob/living/carbon/occupant + var/mob/living/carbon/occupant2 //two seaters var/datum/spacepod/equipment/equipment_system var/obj/item/weapon/cell/high/battery var/datum/gas_mixture/cabin_air @@ -27,6 +28,7 @@ var/health = 100 var/lights = 0 var/lights_power = 6 + var/allow2eject = 1 /obj/spacepod/New() . = ..() @@ -77,12 +79,16 @@ S.channel = 0 //Any channel S.volume = 50 occupant << S + if(occupant2) + occupant2 << S if(occupant && oldhealth > health && !health) var/sound/S = sound('sound/effects/engine_alert1.ogg') S.wait = 0 S.channel = 0 S.volume = 50 occupant << S + if(occupant2) + occupant2 << S if(!health) spawn(0) if(occupant) @@ -90,6 +96,8 @@ for(var/i = 10, i >= 0; --i) if(occupant) occupant << "[i]" + if(occupant2) + occupant2 << "[i]" if(i == 0) explosion(loc, 2, 4, 8) sleep(10) @@ -100,10 +108,15 @@ switch(severity) if(1) var/mob/living/carbon/human/H = occupant + var/mob/living/carbon/human/H2 = occupant2 if(H) H.loc = get_turf(src) H.ex_act(severity + 1) H << "You are forcefully thrown from \the [src]!" + if(H2) + H2.loc = get_turf(src) + H2.ex_act(severity + 1) + H2 << "You are forcefully thrown from \the [src]!" del(ion_trail) del(src) if(2) @@ -298,26 +311,59 @@ /obj/spacepod/proc/moved_inside(var/mob/living/carbon/human/H as mob) if(H && H.client && H in range(1)) - H.reset_view(src) - /* - H.client.perspective = EYE_PERSPECTIVE - H.client.eye = src - */ - H.stop_pulling() - H.forceMove(src) - src.occupant = H - src.add_fingerprint(H) - src.forceMove(src.loc) - //dir = dir_in - playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) - return 1 + if(src.occupant) + H.reset_view(src) + /* + H.client.perspective = EYE_PERSPECTIVE + H.client.eye = src + */ + H.stop_pulling() + H.forceMove(src) + src.occupant2 = H + src.add_fingerprint(H) + src.forceMove(src.loc) + //dir = dir_in + playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) + return 1 + + else + H.reset_view(src) + /* + H.client.perspective = EYE_PERSPECTIVE + H.client.eye = src + */ + H.stop_pulling() + H.forceMove(src) + src.occupant = H + src.add_fingerprint(H) + src.forceMove(src.loc) + //dir = dir_in + playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) + return 1 else return 0 +/obj/spacepod/proc/moved_other_inside(var/mob/living/carbon/human/H as mob) + H.reset_view(src) + H.stop_pulling() + H.forceMove(src) + src.occupant2 = H + src.forceMove(src.loc) + playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) + return 1 + + + /obj/spacepod/MouseDrop_T(mob/M as mob, mob/user as mob) if(M != user) - return - move_inside(M, user) + user << "You start putting [M.name] into the pod's second seat." + if(enter_after(40,usr)) + moved_other_inside(M) + else + usr << "You stop moving [M.name] into the spacepod." + else + move_inside(M, user) + /obj/spacepod/verb/move_inside() set category = "Object" @@ -329,7 +375,13 @@ if (usr.stat || !ishuman(usr)) return if (src.occupant) - usr << "\blue The [src.name] is already occupied!" + usr << "\blue You starts climbing into the secondary seat." + visible_message("\blue [usr] starts to climb into [src.name]") + if(enter_after(40,usr)) + moved_inside(usr) + + else + usr << "You stop entering the spacepod." return /* if (usr.abiotic()) @@ -359,53 +411,162 @@ set src = usr.loc if(usr != src.occupant) + if(src.occupant2) + if(usr != src.occupant2) + return + else + if(src.allow2eject) + inertia_dir = 0 // engage reverse thruster and power down pod + src.occupant2.loc = src.loc + src.occupant2 = null + usr << "You climb out of the pod" + else + usr << "The secondary door is locked." + return + else + return + else + inertia_dir = 0 // engage reverse thruster and power down pod + src.occupant.loc = src.loc + src.occupant = null + usr << "You climb out of the pod" return - inertia_dir = 0 // engage reverse thruster and power down pod - src.occupant.loc = src.loc - src.occupant = null - usr << "You climb out of the pod" - return + +/obj/spacepod/verb/exit_pod2() + if(!src.occupant2) + set hidden = 1 + return + else + set name = "Eject Secondary Seat" + set category = "Spacepod" + set src = usr.loc + set hidden = 0 + + if(usr.ckey == src.occupant2.ckey) + usr << "Use 'Exit Pod'" + return + else + usr << "You eject [src.occupant2.name]." + src.occupant2.visible_message("You were ejected from the pod!") + inertia_dir = 0 // engage reverse thruster and power down pod + src.occupant2.loc = src.loc + src.occupant2 = null + + +/obj/spacepod/verb/locksecondseat() + if(!src.occupant2) + usr << "No point locking that door. " + return + else + set name = "Lock Second Seat" + set category = "Spacepod" + set src in oview(1) + + if(usr.ckey == src.occupant2.ckey) + if(!allow2eject) + usr << "You can't unlock the door from your seat. " + return + else + usr << "You can't lock the door from your seat. " + return + else + if(src.allow2eject) + src.allow2eject = 0 + usr << "You lock the secondary door." + else + src.allow2eject = 1 + usr << "You unlock the secondary door." /obj/spacepod/verb/toggleDoors() - set name = "Toggle Nearby Pod Doors" - set category = "Spacepod" - set src = usr.loc + if(src.occupant2) + if(usr.ckey != src.occupant2.ckey) + set name = "Toggle Nearby Pod Doors" + set category = "Spacepod" + set src = usr.loc - for(var/obj/machinery/door/poddoor/P in oview(3,src)) - if(istype(P, /obj/machinery/door/poddoor/three_tile_hor) || istype(P, /obj/machinery/door/poddoor/three_tile_ver) || istype(P, /obj/machinery/door/poddoor/four_tile_hor) || istype(P, /obj/machinery/door/poddoor/four_tile_ver)) - var/mob/living/carbon/human/L = usr - if(P.check_access(L.get_active_hand()) || P.check_access(L.wear_id)) - if(P.density) - P.open() - return 1 - else - P.close() - return 1 - usr << "Access denied." + for(var/obj/machinery/door/poddoor/P in oview(3,src)) + if(istype(P, /obj/machinery/door/poddoor/three_tile_hor) || istype(P, /obj/machinery/door/poddoor/three_tile_ver) || istype(P, /obj/machinery/door/poddoor/four_tile_hor) || istype(P, /obj/machinery/door/poddoor/four_tile_ver)) + var/mob/living/carbon/human/L = usr + if(P.check_access(L.get_active_hand()) || P.check_access(L.wear_id)) + if(P.density) + P.open() + return 1 + else + P.close() + return 1 + usr << "Access denied." + return + usr << "You are not close to any pod doors." return - usr << "You are not close to any pod doors." - return + else + return + else + set name = "Toggle Nearby Pod Doors" + set category = "Spacepod" + set src = usr.loc + + for(var/obj/machinery/door/poddoor/P in oview(3,src)) + if(istype(P, /obj/machinery/door/poddoor/three_tile_hor) || istype(P, /obj/machinery/door/poddoor/three_tile_ver) || istype(P, /obj/machinery/door/poddoor/four_tile_hor) || istype(P, /obj/machinery/door/poddoor/four_tile_ver)) + var/mob/living/carbon/human/L = usr + if(P.check_access(L.get_active_hand()) || P.check_access(L.wear_id)) + if(P.density) + P.open() + return 1 + else + P.close() + return 1 + usr << "Access denied." + return + usr << "You are not close to any pod doors." + return /obj/spacepod/verb/fireWeapon() - set name = "Fire Pod Weapons" - set desc = "Fire the weapons." - set category = "Spacepod" - set src = usr.loc - equipment_system.weapon_system.fire_weapons() + if(src.occupant2) + if(usr.ckey != src.occupant2.ckey) + set name = "Fire Pod Weapons" + set desc = "Fire the weapons." + set category = "Spacepod" + set src = usr.loc + equipment_system.weapon_system.fire_weapons() + else + return + else + set name = "Fire Pod Weapons" + set desc = "Fire the weapons." + set category = "Spacepod" + set src = usr.loc + equipment_system.weapon_system.fire_weapons() obj/spacepod/verb/toggleLights() - set name = "Toggle Lights" - set category = "Spacepod" - set src = usr.loc - if (usr != occupant) - return - lights = !lights - if(lights) - SetLuminosity(luminosity + lights_power) + if(src.occupant2) + if(usr.ckey != src.occupant2.ckey) + set name = "Toggle Lights" + set category = "Spacepod" + set src = usr.loc + if (usr != occupant) + return + lights = !lights + if(lights) + SetLuminosity(luminosity + lights_power) + else + SetLuminosity(luminosity - lights_power) + occupant << "Toggled lights [lights?"on":"off"]." + return + else + return else - SetLuminosity(luminosity - lights_power) - occupant << "Toggled lights [lights?"on":"off"]." - return + set name = "Toggle Lights" + set category = "Spacepod" + set src = usr.loc + if (usr != occupant) + return + lights = !lights + if(lights) + SetLuminosity(luminosity + lights_power) + else + SetLuminosity(luminosity - lights_power) + occupant << "Toggled lights [lights?"on":"off"]." + return /obj/spacepod/proc/enter_after(delay as num, var/mob/user as mob, var/numticks = 5) var/delayfraction = delay/numticks @@ -480,41 +641,82 @@ obj/spacepod/verb/toggleLights() return 1 /obj/spacepod/relaymove(mob/user, direction) - var/moveship = 1 - if(battery && battery.charge >= 3 && health) - src.dir = direction - switch(direction) - if(1) - if(inertia_dir == 2) - inertia_dir = 0 - moveship = 0 - if(2) - if(inertia_dir == 1) - inertia_dir = 0 - moveship = 0 - if(4) - if(inertia_dir == 8) - inertia_dir = 0 - moveship = 0 - if(8) - if(inertia_dir == 4) - inertia_dir = 0 - moveship = 0 - if(moveship) - step(src, direction) - if(istype(src.loc, /turf/space)) - inertia_dir = direction - else - if(!battery) - user << "No energy cell detected." - else if(battery.charge < 3) - user << "Not enough charge left." - else if(!health) - user << "She's dead, Jim" + if(src.occupant2) + if(user.ckey != src.occupant2.ckey) + var/moveship = 1 + if(battery && battery.charge >= 3 && health) + src.dir = direction + switch(direction) + if(1) + if(inertia_dir == 2) + inertia_dir = 0 + moveship = 0 + if(2) + if(inertia_dir == 1) + inertia_dir = 0 + moveship = 0 + if(4) + if(inertia_dir == 8) + inertia_dir = 0 + moveship = 0 + if(8) + if(inertia_dir == 4) + inertia_dir = 0 + moveship = 0 + if(moveship) + step(src, direction) + if(istype(src.loc, /turf/space)) + inertia_dir = direction + else + if(!battery) + user << "No energy cell detected." + else if(battery.charge < 3) + user << "Not enough charge left." + else if(!health) + user << "She's dead, Jim" + else + user << "Unknown error has occurred, yell at pomf." + return 0 + battery.charge = max(0, battery.charge - 3) else - user << "Unknown error has occurred, yell at pomf." - return 0 - battery.charge = max(0, battery.charge - 3) + return + + else + var/moveship = 1 + if(battery && battery.charge >= 3 && health) + src.dir = direction + switch(direction) + if(1) + if(inertia_dir == 2) + inertia_dir = 0 + moveship = 0 + if(2) + if(inertia_dir == 1) + inertia_dir = 0 + moveship = 0 + if(4) + if(inertia_dir == 8) + inertia_dir = 0 + moveship = 0 + if(8) + if(inertia_dir == 4) + inertia_dir = 0 + moveship = 0 + if(moveship) + step(src, direction) + if(istype(src.loc, /turf/space)) + inertia_dir = direction + else + if(!battery) + user << "No energy cell detected." + else if(battery.charge < 3) + user << "Not enough charge left." + else if(!health) + user << "She's dead, Jim" + else + user << "Unknown error has occurred, yell at pomf." + return 0 + battery.charge = max(0, battery.charge - 3) /obj/effect/landmark/spacepod/random name = "spacepod spawner" From da9f1ed079a6a51d8aa5addfe6169fd889362c0b Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 17 Dec 2014 20:15:03 -0800 Subject: [PATCH 2/3] Fox's suggested changes- Includes ability to lock pod from new entries, But not the occupant. The secondary occupant can still get out by will. Entering a pod with the nuke disk is now impossible. Cannot drag people into pods; This means you can go on adventures with your buddy, but, no shoving people into pods and ejecting them into space. --- code/game/vehicles/spacepods/spacepod.dm | 86 +++++++++++++----------- 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm index ddfc38c7eb7..5e926d39683 100644 --- a/code/game/vehicles/spacepods/spacepod.dm +++ b/code/game/vehicles/spacepods/spacepod.dm @@ -28,7 +28,7 @@ var/health = 100 var/lights = 0 var/lights_power = 6 - var/allow2eject = 1 + var/allow2enter = 1 /obj/spacepod/New() . = ..() @@ -92,6 +92,8 @@ if(!health) spawn(0) if(occupant) + if(occupant2) + occupant2 << "Critical damage to the vessel detected, core explosion imminent!" occupant << "Critical damage to the vessel detected, core explosion imminent!" for(var/i = 10, i >= 0; --i) if(occupant) @@ -310,6 +312,11 @@ return /obj/spacepod/proc/moved_inside(var/mob/living/carbon/human/H as mob) + var/fukkendisk = usr.GetTypeInAllContents(/obj/item/weapon/disk/nuclear) + if(fukkendisk) + usr << "\red The nuke-disk locks the door as you try to get in. You evil person." + return + if(H && H.client && H in range(1)) if(src.occupant) H.reset_view(src) @@ -356,11 +363,7 @@ /obj/spacepod/MouseDrop_T(mob/M as mob, mob/user as mob) if(M != user) - user << "You start putting [M.name] into the pod's second seat." - if(enter_after(40,usr)) - moved_other_inside(M) - else - usr << "You stop moving [M.name] into the spacepod." + return else move_inside(M, user) @@ -369,20 +372,28 @@ set category = "Object" set name = "Enter Pod" set src in oview(1) + var/fukkendisk = usr.GetTypeInAllContents(/obj/item/weapon/disk/nuclear) + + if(fukkendisk) + usr << "\red The nuke-disk is locking the door every time you try to open it. You get the feeling that it doesn't want to go into the spacepod." + return if(usr.restrained() || usr.stat || usr.weakened || usr.stunned || usr.paralysis || usr.resting) //are you cuffed, dying, lying, stunned or other return if (usr.stat || !ishuman(usr)) return if (src.occupant) - usr << "\blue You starts climbing into the secondary seat." - visible_message("\blue [usr] starts to climb into [src.name]") - if(enter_after(40,usr)) - moved_inside(usr) - + if(allow2enter) + usr << "\blue You starts climbing into the secondary seat." + visible_message("\blue [usr] starts to climb into [src.name]") + if(enter_after(40,usr)) + moved_inside(usr) + else + usr << "You stop entering the spacepod." + return else - usr << "You stop entering the spacepod." - return + usr << "\red The [src.name]'s doors are locked." + return /* if (usr.abiotic()) usr << "\blue Subject cannot have abiotic items on." @@ -415,14 +426,11 @@ if(usr != src.occupant2) return else - if(src.allow2eject) - inertia_dir = 0 // engage reverse thruster and power down pod - src.occupant2.loc = src.loc - src.occupant2 = null - usr << "You climb out of the pod" - else - usr << "The secondary door is locked." - return + inertia_dir = 0 // engage reverse thruster and power down pod + src.occupant2.loc = src.loc + src.occupant2 = null + usr << "You climb out of the pod" + else return else @@ -454,28 +462,24 @@ /obj/spacepod/verb/locksecondseat() - if(!src.occupant2) - usr << "No point locking that door. " - return - else - set name = "Lock Second Seat" - set category = "Spacepod" - set src in oview(1) + set name = "Lock Doors" + set category = "Spacepod" + set src = usr.loc - if(usr.ckey == src.occupant2.ckey) - if(!allow2eject) - usr << "You can't unlock the door from your seat. " - return - else - usr << "You can't lock the door from your seat. " - return + if(usr.ckey == src.occupant2.ckey) + if(!allow2enter) + usr << "You can't unlock the doors from your seat. " + return else - if(src.allow2eject) - src.allow2eject = 0 - usr << "You lock the secondary door." - else - src.allow2eject = 1 - usr << "You unlock the secondary door." + usr << "You can't lock the doors from your seat. " + return + else + if(src.allow2enter) + src.allow2enter = 0 + usr << "You lock the doors." + else + src.allow2enter = 1 + usr << "You unlock the doors." /obj/spacepod/verb/toggleDoors() if(src.occupant2) From aeb4841f01a27b2c2afc72e41b39cf992ae68f47 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 17 Dec 2014 20:22:55 -0800 Subject: [PATCH 3/3] Minor change; You can load corpses into the space-pod, but not living people. --- code/game/vehicles/spacepods/spacepod.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm index 5e926d39683..bc2eac85f08 100644 --- a/code/game/vehicles/spacepods/spacepod.dm +++ b/code/game/vehicles/spacepods/spacepod.dm @@ -363,7 +363,10 @@ /obj/spacepod/MouseDrop_T(mob/M as mob, mob/user as mob) if(M != user) - return + if(M.stat != 0) + move_inside(M, user) + else + return else move_inside(M, user)