Skip to content

Commit

Permalink
Merge pull request DDMers#87 from Kmc2000/Salvage
Browse files Browse the repository at this point in the history
Salvage
  • Loading branch information
Kmc2000 authored May 6, 2019
2 parents 5ec7264 + a72f144 commit fa4a8a7
Show file tree
Hide file tree
Showing 39 changed files with 20,724 additions and 17,444 deletions.
32 changes: 32 additions & 0 deletions DS13/code/game/objects/trek_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@
icon = 'DS13/icons/turf/trek_turfs.dmi'
icon_state = "trek_edge3"

/turf/open/floor/trek/bsg
name = "Pressed steel hull plating"
desc = "A very militaristic looking hull segment"
icon = 'DS13/icons/turf/floors.dmi'
icon_state = "bsg1"
footstep = FOOTSTEP_PLATING
barefootstep = FOOTSTEP_PLATING
clawfootstep = FOOTSTEP_GENERIC_HEAVY

/turf/open/floor/trek/bsg/tile
name = "Padded steel tile"
icon = 'DS13/icons/turf/floors.dmi'
icon_state = "bsg2"

/turf/open/floor/trek/bsg/corrugated
name = "Corrugated steel hull segment"
icon = 'DS13/icons/turf/floors.dmi'
icon_state = "corrugated"

/obj/structure/chair/trek
name = "padded leather chair"
desc = "Just looking at this thing makes you feel comfy."
Expand Down Expand Up @@ -141,6 +160,19 @@
icon_state = "porthole"
smooth = FALSE

/obj/structure/window/reinforced/fulltile/trek/bsg
name = "Viewport"
icon = 'DS13/icons/obj/window.dmi'
desc = "A heavyset window surrounded by thick steel."
icon_state = "bsg"
smooth = FALSE
dir = 2

/obj/structure/window/reinforced/fulltile/trek/bsg/middle
icon_state = "bsg_mid"
smooth = FALSE
dir = 2

/obj/machinery/door/airlock/trek
name = "Airlock"
icon = 'DS13/icons/obj/machinery/voy_door.dmi'
Expand Down
20 changes: 20 additions & 0 deletions DS13/code/modules/overmap/cinematics.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/datum/cinematic/romulan
id = CINEMATIC_ROMULAN
is_global = TRUE
cleanup_time = 50

/datum/cinematic/romulan/content()
screen.icon = 'icons/effects/trek_cinematics.dmi'
flick("romulan",screen)
sleep(50)
screen.icon_state = "romulan_end"

/datum/cinematic/shipexplode
id = CINEMATIC_SHIPEXPLODE
is_global = TRUE
cleanup_time = 10

/datum/cinematic/shipexplode/content()
screen.icon = 'DS13/icons/effects/shipexplode.gif'
sleep(40)
screen.alpha = 0
34 changes: 23 additions & 11 deletions DS13/code/modules/overmap/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
/obj/structure/overmap/proc/tractor_pull() //Force the target to turn to us and move towards us.
if(!tractor_target)
return
if(tractor_target.z != z) //Runabout safety check.
release_tractor()
return
if(tractor_target.shields.check_vulnerability() || tractor_target.faction == faction)
tractor_target.nav_target = src
tractor_target.vel = 1
Expand Down Expand Up @@ -390,9 +393,12 @@

/obj/structure/overmap/proc/explode()
send_sound_crew('DS13/sound/effects/damage/ship_explode.ogg')
if(warp_core && !QDELETED(warp_core)) //They have a core. So give them a chance to save the ship.
warp_core.containment = 0//Force a warp core breach. No matter if it's on or not. They'll then have 45 seconds to haul ass to engi and eject the core.
warp_core.breach()
if(main_overmap)
SSredbot.send_discord_message("admin", "[src] is undergoing a core breach!", "game")
if(warp_core && !QDELETED(warp_core) && !destroyed) //They have a core. So give them a chance to save the ship.
warp_core.containment = -5//Force a warp core breach. No matter if it's on or not. They'll then have 45 seconds to haul ass to engi and eject the core.
warp_core.breach(TRUE) //Force a core breach. It's done like this to prevent an infinite loop.
destroyed = TRUE
addtimer(CALLBACK(src, .proc/check_breach), 450)
for(var/mob/A in operators)
to_chat(A, "<span class='cult'><font size=3>Antimatter containment failing, evacuate the ship!</font></span>")
Expand All @@ -413,17 +419,23 @@
A.remote_control.forceMove(get_turf(A))
core_breach()


/obj/structure/overmap/proc/check_breach()
/obj/structure/overmap/proc/check_breach() //Check if the active warp core is salvaged. If not, explode the ship.
if(!warp_core || QDELETED(warp_core))
warp_core = null
health = 50 //Second wind! Gives them time to run, because the next core breach will actually destroy them.
destroyed = FALSE
message_admins("[src]'s warp core was ejected before it could breach.")
return FALSE
else
if(warp_core.containment <= 0) //They saved it.
health = 50 //Second wind! Gives them time to run, because the next core breach will actually destroy them.
return TRUE
return FALSE
if(warp_core.containment >= 0) //They saved it.
health = 50 //Second wind! Gives them time to run, because the next core breach will actually destroy them.
destroyed = FALSE
warp_core.breaching = FALSE
message_admins("[src]'s warp core was stabilized before it could breach.")
return TRUE
message_admins("[src]'s warp core has breached.")
core_breach_finish() //They didn't save it. Explode them.
if(main_overmap)
SSredbot.send_discord_message("admin", "[src]'s antimatter containment failed, ending the round", "game")

/obj/structure/overmap/proc/core_breach()
if(!main_overmap)
Expand All @@ -439,7 +451,7 @@

/obj/structure/overmap/proc/core_breach_finish()
if(main_overmap)
Cinematic(CINEMATIC_NUKE_WIN,world)
Cinematic(CINEMATIC_SHIPEXPLODE,world)
SSticker.mode.check_finished(TRUE)
SSticker.force_ending = 1
for(var/X in GLOB.teleportlocs) //If it's not a game-ender. Blow the shit out of the ship map
Expand Down
132 changes: 126 additions & 6 deletions DS13/code/modules/overmap/events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ GLOBAL_LIST_INIT(overmap_event_spawns, list())

/datum/overmap_event/proc/clear_elements()
if(target)
var/obj/structure/overmap/saved = target
target = null //So that QDEL'ing it doesn't cause the mission to fail after it's already complete
qdel(saved)
qdel(target)

/datum/overmap_event/proc/fail()
if(completed)
Expand Down Expand Up @@ -79,6 +77,12 @@ GLOBAL_LIST_INIT(overmap_event_spawns, list())
warbird.target = target
warbird.linked_event = src
elements += warbird
var/obj/structure/overmap/ai/simulated/bigbird = new /obj/structure/overmap/ai/simulated(get_turf(pick(orange(spawner,6)))) //Make one warbird that can be salvaged / boarded.
bigbird.force_target = target //That freighter ain't no fortunate oneeeee n'aw lord IT AINT HEEEE IT AINT HEEEE
bigbird.nav_target = target
bigbird.target = target
bigbird.linked_event = src
elements += bigbird

/obj/effect/landmark/overmap_event_spawn
name = "Overmap event spawner"
Expand Down Expand Up @@ -225,6 +229,7 @@ GLOBAL_LIST_INIT(overmap_event_spawns, list())
class = "crashed_borg"
max_shield_health = 0
layer = 2.9
movement_block = TRUE

/datum/overmap_event/crashed_borg/succeed()
return //Impossible to succeed, or fail.
Expand Down Expand Up @@ -436,7 +441,7 @@ GLOBAL_LIST_INIT(overmap_event_spawns, list())
name = "Tal shiar agent"
assignedrole = "romulan"
outfit = /datum/outfit/talshiar
flavour_text = "<span class='big bold'>You are a tal shiar agent!</span><br> You and your comrades have been dispatched to the museum ship Enterprise under the guise of starfleet inspectors. You're equipped with state of the art stealth tech, so you can assume any identity you need but be careful, and be subtle.<br> It is an incredibly weak ship, but it should provide enough cover for you to complete your true goal: <b>Capture</b> the main ship for the romulan empire!"
flavour_text = "<span class='big bold'>You are a tal shiar agent!</span><br> You and your comrades have been dispatched to the museum ship Enterprise under the guise of starfleet inspectors. You're equipped with state of the art stealth tech, so you can assume any identity you need but be careful, and be subtle.<br> It is an incredibly weak ship, but it should provide enough cover for you to complete your true goal: <b>Capture the main ship for the romulan empire by using your ominous tricorder on the bridge!</b>"

/datum/outfit/talshiar
name = "Tal shiar agent"
Expand All @@ -452,7 +457,105 @@ GLOBAL_LIST_INIT(overmap_event_spawns, list())
back = /obj/item/storage/backpack/satchel
ears = /obj/item/radio/headset/syndicate/alt
back = /obj/item/storage/backpack/satchel
backpack_contents = list(/obj/item/storage/box/syndie_kit/chameleon=1,/obj/item/book/granter/martial/cqc=1,/obj/item/reagent_containers/syringe/mulligan=1)
backpack_contents = list(/obj/item/storage/box/syndie_kit/chameleon=1,/obj/item/book/granter/martial/cqc=1,/obj/item/reagent_containers/syringe/mulligan=1,/obj/item/ship_hijack_spawner=1)
implants = list(/obj/item/implant/storage) //Eases up on the meta a bit

/obj/item/ship_hijack_spawner //Device used by tal shiar to formally take over the ship
name = "Ominous tricorder"
desc = "A device which allows you to summon a ship network hijacker, allowing one to take over a ship. ONCE YOU SPAWN THE HIJACKER, THERE IS NO TURNING BACK."
icon = 'DS13/icons/obj/device.dmi'
icon_state = "health"

/obj/item/ship_hijack_spawner/attack_self(mob/user)
. = ..()
var/area/AR = get_area(src)
if(!AR.linked_overmap || !AR.linked_overmap.main_overmap)
to_chat(user, "<span class='warning'>This device can only be used to capture [station_name()], starfleet's main ship in this sector.</span>")
return
var/obj/structure/overmap_component/helm/helmcheck = locate(/obj/structure/overmap_component/helm) in AR
if(!helmcheck)
to_chat(user, "<span class='warning>You can only do this from the bridge!</span>")
return
if(AR.linked_overmap.capture_in_progress)
to_chat(user, "<span class='warning'>Someone else has already placed a capture device.</span>")
return
var/question = alert("Really spawn a ship capture device? THERE IS NO GOING BACK ONCE YOU DO THIS",name,"yes","no")
if(question == "no" || !question)
return
new /obj/effect/temp_visual/transporter/mob(get_turf(src))
playsound(src.loc, 'DS13/sound/effects/transporter/send.ogg', 100, 4)
to_chat(user, "A capture device has been transported in, Jolan Tru!")
new /obj/structure/ship_hijacker(get_turf(user))
qdel(src)

/obj/structure/ship_hijacker
name = "Optronic data hijacker"
desc = "A huge device which will systematically purge pre-existing command codes from a ship's command subroutines while simultaneously plotting in a pre-programmed course for the ship to follow. <b> This can't be good...</b>"
icon = 'icons/obj/machines/dominator.dmi'
icon_state = "dominator"
obj_integrity = 250
max_integrity = 250 //Takes a beating to remove.
anchored = TRUE
density = TRUE
var/active = FALSE
var/start_time = 0
var/end_time = 0
var/domtime = 1480 //2 : 30 minutes to capture the ship ((when the anthem stops, you lose)).

/obj/structure/ship_hijacker/examine(mob/user)
. = ..()
if(!active)
return
to_chat(user, "<span class='warning'>It is currently attempting to hijack [station_name()]!</span>")
var/timeleft = (end_time - world.time)/10
to_chat(user, "<span class='warning'>A display shows that there's [timeleft] seconds left until the takeover is complete!</span>")


/obj/structure/ship_hijacker/attack_hand(mob/user)
if(active)
to_chat(user, "<span class='notice'>There is already an active system takeover in progress!</span>")
return
var/question = alert("Are you ready to begin a system takeover of [station_name()]?",name,"yes","no")
if(question == "no" || !question)
return
active = TRUE
var/area/AR = get_area(src)
if(AR.linked_overmap)
AR.linked_overmap.capture_in_progress = TRUE
priority_announce("WARNING: Optronic data pathway decription attempt detected in [AR]. Hostile takeover in progress!","LCARS computer subsystem:",'sound/ai/commandreport.ogg')
start_time = world.time
end_time = start_time + domtime
to_chat(user, "<span class='notice'>You have begun a system takeover, defend this device for the romulan empire!</span>")
light_color = LIGHT_COLOR_RED
set_light(5)
icon_state = "dominator-red"
sound_to_playing_players('DS13/sound/ambience/ship_takeover.ogg') //ALL CREDIT GOES TO: Volker400 https://www.youtube.com/watch?v=ooS0Hop_zhk
GLOB.music_controller.force_stop() //Avoids annoying overlapping music.
START_PROCESSING(SSobj,src)

/obj/structure/ship_hijacker/process()
if(!active)
return
if(world.time >= end_time)
active = FALSE
priority_announce("Ieiuqh warp drive avaihh'etrehh-capable rrhiet khina 'hh ours. Temmehrr'dochai ch'rihan. Jolan Tru!","LCARS computer subsystem:",'sound/ai/commandreport.ogg')
Cinematic(CINEMATIC_ROMULAN,world)
SSticker.mode.check_finished(TRUE)
SSticker.force_ending = 1
STOP_PROCESSING(SSobj,src)
qdel(src)

/obj/structure/ship_hijacker/Destroy()
if(active)
for(var/mob/M in GLOB.player_list) //Stop the romulan anthem.
if(M.client)
SEND_SOUND(M, sound(null))
priority_announce("Hostile takeover attempt ceased. Cycling encryption and command codes.","LCARS computer subsystem:",'sound/ai/commandreport.ogg')
GLOB.music_controller.reset()
var/area/AR = get_area(src)
if(AR.linked_overmap)
AR.linked_overmap.capture_in_progress = FALSE
. = ..()

/area/ship/bridge/museum
name = "USS Enterprise (NX-01)"
Expand All @@ -470,7 +573,7 @@ GLOBAL_LIST_INIT(overmap_event_spawns, list())

/datum/overmap_event/museum_hijack/start() //Now we have a spawn. Let's do whatever this mission is supposed to. Override this when you make new missions
target = new /obj/structure/overmap/nx01(get_turf(spawner))
priority_announce("[station_name()]. We've just received a report from the NX01-Enterprise exhibit. It appears the enterprise is missing.... Recapture the ship at all costs, and do NOT allow it to be destroyed.","Intercepted subspace transmission:",'sound/ai/commandreport.ogg')
priority_announce("[station_name()]. We've just received a report from the NX01-Enterprise exhibit. It appears the enterprise is missing...? You are ordered to investigate what has happened, but be advised that this could possibly just be a clerical error.","Intercepted subspace transmission:",'sound/ai/commandreport.ogg')
elements += target
sleep(20)//Give it a chance to link.
if(target.linked_area)
Expand Down Expand Up @@ -605,6 +708,9 @@ GLOBAL_LIST_INIT(overmap_event_spawns, list())
spawner.used = FALSE
completed = TRUE

/datum/overmap_event/deliver_item/clear_elements()
return FALSE //Dont delete the stations!

/datum/overmap_event/deliver_item/check_completion(var/atom/what)
if(what == destination || what == source)
fail()
Expand Down Expand Up @@ -717,6 +823,20 @@ GLOBAL_LIST_INIT(overmap_event_spawns, list())
if(plant_amount <= 0)
succeed()

/datum/overmap_event/m_class/succeed()
if(completed)
return
to_chat(world, "<span class='notice'>Starfleet command has issued a commendation to the crew of [station_name()]. The ship has been allocated extra operational budget ([reward]) by Starfleet command.</span>")
priority_announce(succeed_text,"Incoming hail:",'sound/ai/commandreport.ogg')
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR)
completed = TRUE
if(D)
D.adjust_money(reward)
return

/datum/overmap_event/m_class/clear_elements()
return FALSE //Dont delete the M CLASS planet!

/obj/item/twohanded/required/kirbyplants
var/datum/overmap_event/m_class/linked_event
var/scanned = FALSE //Sanity check
Expand Down
9 changes: 4 additions & 5 deletions DS13/code/modules/overmap/movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,14 @@
var/pixel_collision_size_y = I.Height()
for(var/atom/e in obounds(src, real_pixel_x + x_to_move + pixel_collision_size_x/4, real_pixel_y + y_to_move + pixel_collision_size_y/4, real_pixel_x + x_to_move + -pixel_collision_size_x/4, real_pixel_y + y_to_move + -pixel_collision_size_x/4) )//Basic block collision
if(e.density == 1) //We can change this so the ship takes damage later
if(ismob(e))
return //Ignore mobs. Prevents the glitchy runabout behaviour
if(istype(e, /obj/structure/meteor))
var/obj/structure/meteor/S = e
S.crash(src)
O.vel = 0
else
if(istype(src, /obj/structure/overmap))
O.angle -= 180
O.EditAngle()
O.vel = 1
sleep(10)
if(istype(src, /obj/structure/overmap) && isturf(e))
O.vel = 0
return FALSE
real_pixel_x = real_pixel_x + x_to_move
Expand Down
6 changes: 6 additions & 0 deletions DS13/code/modules/overmap/music.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ GLOBAL_DATUM_INIT(music_controller, /datum/music_controller, new)
var/client/CCE = M.client
CCE.chatOutput.stopMusic()

/datum/music_controller/proc/force_stop() //When we're playing music and want it to STFU.
stop()
playing = TRUE
for(var/datum/X in active_timers)
qdel(X)

/datum/music_controller/proc/play(var/danger = FALSE)
if(!playing) //no random switching to calm orchestral music mid fight!
stop()
Expand Down
1 change: 1 addition & 0 deletions DS13/code/modules/overmap/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ GLOBAL_LIST_INIT(overmap_ships, list())
var/warping = FALSE //Are we mid warp? This tells movement code to do the special FX for when we exit warp if we slow down too much.
var/datum/action/innate/warp/warp_action = new
var/max_warp = WARP_5
var/capture_in_progress = FALSE //Is someone trying to hijack the ship?

/obj/shield_overlay
name = ""
Expand Down
Loading

0 comments on commit fa4a8a7

Please sign in to comment.