Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66,224 changes: 66,224 additions & 0 deletions _maps/templates/boarding/syndicate/smalloutpost.dmm

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion code/__DEFINES/nsv13.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ GLOBAL_DATUM_INIT(conquest_role_handler, /datum/conquest_role_handler, new)

#define ENGINE_RPM_SPUN 8000

#define COMSIG_SHIP_BOARDED "ship_boarded"
#define COMSIG_GLOB_CHECK_INTERDICT "check_interdict" //from interdiction component
#define WEAK_INTERDICT (1<<0) //! Not a "true" interdiction in that it disrupts the drive field, relies on scrambling calculations and rendering a jump too dangerous to execute.
#define STRONG_INTERDICT (1<<1) //! The "true" interdiction, disrupts drive fields to the point any shift is impossible.
Expand Down
1 change: 1 addition & 0 deletions code/datums/elements/_element.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

/// Deactivates the functionality defines by the element on the given datum
/datum/element/proc/Detach(datum/source, ...)
SHOULD_CALL_PARENT(TRUE)
SIGNAL_HANDLER
SHOULD_CALL_PARENT(TRUE) //nsv13 - set calls need to be first in proc.

Expand Down
4 changes: 4 additions & 0 deletions code/game/machinery/porta_turret/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
underlays += base
if(!has_cover)
INVOKE_ASYNC(src, PROC_REF(popUp))
//NSV13 Keep track of turrets on a ship
get_overmap()?.turrets_in_ship |= src

/obj/machinery/porta_turret/proc/toggle_on(var/set_to)
var/current = on
Expand Down Expand Up @@ -186,6 +188,8 @@
QDEL_NULL(stored_gun)
QDEL_NULL(spark_system)
remove_control()
//NSV13 Keep track of turrets on a ship
get_overmap().turrets_in_ship -= src
return ..()


Expand Down
1 change: 1 addition & 0 deletions nsv13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3771,6 +3771,7 @@
#include "nsv13\code\game\gamemodes\overmap\shakedown.dm"
#include "nsv13\code\game\gamemodes\overmap\objectives\apnw_efficiency.dm"
#include "nsv13\code\game\gamemodes\overmap\objectives\board_ship.dm"
#include "nsv13\code\game\gamemodes\overmap\objectives\board_station.dm"
#include "nsv13\code\game\gamemodes\overmap\objectives\destroy_fleet.dm"
#include "nsv13\code\game\gamemodes\overmap\objectives\perform_jumps.dm"
#include "nsv13\code\game\gamemodes\overmap\objectives\rubicon.dm"
Expand Down
1 change: 1 addition & 0 deletions nsv13/code/__DEFINES/components.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
#define COMSIG_TARGET_LOCKED "target_locked" //! from base of /obj/structure/overmap/proc/select_target: (target)
#define COMSIG_LOCK_LOST "lock_lost" //! from base of /obj/structure/overmap/proc/dump_lock: (target)

#define COMSIG_SHIP_IFF_CHANGE "iff_change"
Comment thread
Bokkiewokkie marked this conversation as resolved.
#define COMSIG_SHIP_RELEASE_BOARDING "release_boarding"
#define COMSIG_SHIP_BLOCKS_RELEASE_BOARDING 1
2 changes: 1 addition & 1 deletion nsv13/code/controllers/subsystem/overmap_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ SUBSYSTEM_DEF(overmap_mode)
if(isnull(S))
return
var/extra
if(ispath(S,/datum/overmap_objective/clear_system))
if(ispath(S,/datum/overmap_objective/clear_system) || ispath(S,/datum/overmap_objective/board_station))
extra = input(usr, "Select a target system", "Select System") as null|anything in SSstar_system.systems
SSovermap_mode.mode.objectives += new S(extra)
SSovermap_mode.instance_objectives()
Expand Down
6 changes: 6 additions & 0 deletions nsv13/code/controllers/subsystem/starsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,12 @@ Returns a faction datum by its name (case insensitive!)
anomalies[++anomalies.len] = anomaly_info
return anomalies

/datum/star_system/proc/has_anomaly_type(anomaly_type)
for(var/obj/effect/overmap_anomaly/OA in system_contents)
if(istype(OA, anomaly_type))
return TRUE
return FALSE

/obj/effect/overmap_anomaly //Should not appear normally.
name = "Tear in reality"
desc = "Your mind is shattering just from looking at this."
Expand Down
11 changes: 6 additions & 5 deletions nsv13/code/game/gamemodes/overmap/objectives/board_ship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
target_ship = instance_overmap(ship_type)
target_ship.block_deletion = TRUE
target_ship.essential = TRUE
RegisterSignal(target_ship, COMSIG_SHIP_BOARDED, PROC_REF(check_completion), target_ship)
RegisterSignal(target_ship, COMSIG_SHIP_IFF_CHANGE, PROC_REF(check_completion), target_ship)
RegisterSignal(target_ship, COMSIG_SHIP_RELEASE_BOARDING, PROC_REF(release_boarding), target_ship)
target_ship.ai_load_interior(SSstar_system.find_main_overmap())
// give it a name
Expand All @@ -22,7 +22,7 @@
var/list/candidates = list()
for(var/datum/star_system/S in SSstar_system.systems)
// Is this even in a reasonable location?
if(S.hidden || (S.sector != 2) || S.get_info()?["Black hole"])
if(S.hidden || (S.sector != 2) || S.has_anomaly_type(/obj/effect/overmap_anomaly/singularity))
continue
// Don't put it where it will immediately get shot
if((S.alignment != target_ship.faction) && (S.alignment != "unaligned") && (S.alignment != "uncharted"))
Expand All @@ -44,9 +44,9 @@
F.add_ship(target_ship, "battleships")

// How long should this take?
var/list/fastest_route = find_route(SSstar_system.find_system(SSovermap_mode.mode.starting_system), target_system)
var/list/fastest_route = find_route(SSstar_system.find_system(SSovermap_mode.mode.starting_system), target_system, wormholes_allowed = FALSE)
var/distance = 0
for(var/i = 2; i < length(fastest_route); i++)
for(var/i = 2; i <= length(fastest_route); i++)
var/datum/star_system/start = fastest_route[i-1]
var/datum/star_system/finish = fastest_route[i]
distance += start.dist(finish)
Expand All @@ -62,10 +62,11 @@
status = 1
target_ship.block_deletion = FALSE
target_ship.essential = FALSE
UnregisterSignal(target_ship, COMSIG_SHIP_BOARDED)
UnregisterSignal(target_ship, COMSIG_SHIP_IFF_CHANGE)
UnregisterSignal(target_ship, COMSIG_SHIP_RELEASE_BOARDING)

/datum/overmap_objective/board_ship/proc/release_boarding()
SIGNAL_HANDLER
// Don't let them kill the ship if they haven't won yet
if(status != 1 && status != 3) // complete or admin override
return COMSIG_SHIP_BLOCKS_RELEASE_BOARDING
Expand Down
92 changes: 92 additions & 0 deletions nsv13/code/game/gamemodes/overmap/objectives/board_station.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/datum/overmap_objective/board_station
name = "Board Station"
desc = "Find and board a station, then defend the station."
brief = "Capture the syndicate outpost CALLANADMIN in SYSTEM by boarding it, defeating the enemies therein, and modifying its IFF codes."
var/defense_complete
var/datum/star_system/target_system = null
var/obj/structure/overmap/target_station = null

/datum/overmap_objective/board_station/New(datum/star_system/passed_input)
.=..()
if(passed_input) //Let us select a system in the gamemode controller
target_system = passed_input
if(!target_system)
var/list/candidates = list()
for(var/datum/star_system/S in SSstar_system.neutral_zone_systems)
// Is this even in a reasonable location?
if(S.hidden || (S.sector != 2) || S.name == "Rubicon" || S.has_anomaly_type(/obj/effect/overmap_anomaly/singularity))
continue
// Don't put it where it will immediately get shot
if((S.alignment != "syndicate") && (S.alignment != "unaligned") && (S.alignment != "uncharted"))
continue
// This shouldn't be needed with the faction check, but don't put it in the spawn location
if(S == SSstar_system.system_by_id(SSovermap_mode.mode.starting_system))
continue
candidates += S
target_system = pick(candidates)

/datum/overmap_objective/board_station/instance()
. = ..()
// make a station
var/station = /obj/structure/overmap/trader/syndicate/outpost
target_station = instance_overmap(station)
target_station.block_deletion = TRUE
target_station.essential = TRUE
RegisterSignal(target_station, COMSIG_SHIP_IFF_CHANGE, PROC_REF(iff_change), target_station)
RegisterSignal(target_station, COMSIG_SHIP_RELEASE_BOARDING, PROC_REF(release_boarding), target_station)
target_station.ai_load_interior(SSstar_system.find_main_overmap())
var/ship_name = generate_ship_name()
target_station.name = ship_name
brief = "Capture the syndicate outpost [target_station] in [target_system] by boarding it, defeating the enemies therein, and modifying its IFF codes."
target_system.add_ship(target_station)
target_system.enemies_in_system += target_station
target_system.objective_sector = TRUE
// give it some friends :)
var/datum/faction/S = SSstar_system.faction_by_id(FACTION_ID_SYNDICATE)
S.send_fleet(target_system, null, TRUE)
var/datum/fleet/F = pick(target_system.fleets)
F.fleet_trait = FLEET_TRAIT_DEFENSE
F.add_ship(target_station, "supply")

// How long should this take?
var/list/fastest_route = find_route(SSstar_system.find_system(SSovermap_mode.mode.starting_system), target_system, wormholes_allowed = FALSE)
var/distance = 0
for(var/i = 2; i <= length(fastest_route); i++)
var/datum/star_system/start = fastest_route[i-1]
var/datum/star_system/finish = fastest_route[i]
distance += start.dist(finish)
var/obj/structure/overmap/OM = SSstar_system.find_main_overmap()
var/travel_time = (distance / (OM.ftl_drive.get_jump_speed() * 10)) SECONDS // Time spent flying
travel_time += 2 MINUTES * length(fastest_route) // Time spent spooling FTL drive
travel_time += 15 MINUTES //Time spent defending the objective after capture
travel_time *= 1.2 // Time spent lolligagging
SSovermap_mode.mode.objective_reminder_interval = max((travel_time / 5), SSovermap_mode.mode.objective_reminder_interval)
message_admins("Reminder interval set to [(SSovermap_mode.mode.objective_reminder_interval) / 600] minutes")

/datum/overmap_objective/board_station/check_completion()
if(defense_complete)
status = 1
UnregisterSignal(target_system, COMSIG_SHIP_RELEASE_BOARDING) //Now that you've captured it you can do whatever
.=..()

/datum/overmap_objective/board_station/proc/release_boarding()
Comment thread
Bokkiewokkie marked this conversation as resolved.
SIGNAL_HANDLER
// Don't let them kill the ship if they haven't won yet
if(status != 1 && status != 3) // complete or admin override
return COMSIG_SHIP_BLOCKS_RELEASE_BOARDING
return 0

/datum/overmap_objective/board_station/proc/iff_change()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SIGNAL_HANDLER

Also the comsig for this is currently sent before actually changing the faction - maybe use the unimplemented comsig you added?

@DeltaFire15 DeltaFire15 Jul 14, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't resolved. COMSIG_SHIP_IFF_CHANGE (triggering this proc's call) is sent before faction changes (not after, as the if in this proc assumes)

Additionally, for compatibility with SIGNAL_HANDLER, just moving the reinforcements part into an async-called proc would work.

(I've also noticed the COMSIG_SHIP_KILLED_FLEET register seems a bit fishy, since this comsig is only sent to objects that have mobs within them (which if they station is left it isn't going to have), aswell as triggering on any fleet destruction. Is there a reason it doesn't just register the COMSIG_PARENT_QDELETING signal on the reinforcement fleet?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the second comment, I'll look at it some more then and refactor it properly. Honestly haven't had to work with signals much so I appreciate the help. 👍

if(target_station.faction == SSovermap_mode.mode.starting_faction)
target_station.block_deletion = FALSE //You captured it, it's now your responsibility
target_station.essential = FALSE
UnregisterSignal(target_station, COMSIG_SHIP_IFF_CHANGE)
var/datum/star_system/adjacent = SSstar_system.system_by_id(pick(target_system.adjacency_list))
var/datum/fleet/reinforcements = adjacent.spawn_fleet(/datum/fleet/boarding, 5) //Harder fight
reinforcements.move(target_system, TRUE)
RegisterSignal(target_station, COMSIG_SHIP_KILLED_FLEET, PROC_REF(fleet_destroyed), target_station) //Kill the fleet and you're done

/datum/overmap_objective/board_station/proc/fleet_destroyed()
Comment thread
Bokkiewokkie marked this conversation as resolved.
SIGNAL_HANDLER
defense_complete = 1
check_completion()
2 changes: 1 addition & 1 deletion nsv13/code/game/machinery/computer/salvage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
radio.talk_into(src, "EWAR scrambling equipment is starting up or shutting down. Try again later.", radio_channel)
return FALSE
if(SEND_SIGNAL(linked.active_boarding_target, COMSIG_SHIP_RELEASE_BOARDING))
radio.talk_into(src, "Target is mission critical. Cannot cancel EWAR scrambling on [linked.active_boarding_target].", radio_channel)
radio.talk_into(src, "Target is designated for capture. Cannot cancel EWAR scrambling on [linked.active_boarding_target].", radio_channel)
return FALSE // Something blocked this
if(alert("Are you sure? (ALL BOARDERS WILL BE KILLED)",name,"Release Hammerlock","Cancel") == "Cancel")
return FALSE
Expand Down
69 changes: 46 additions & 23 deletions nsv13/code/game/machinery/iff_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ If someone hacks it, you can always rebuild it.
hacking = FALSE
hack_goal = max(hack_goal -= (world.time - hack_start_time), 1 SECONDS)
return TRUE
hack()
hack(user)
var/obj/structure/overmap/OM = get_overmap()
log_game("[user] changed the IFF of [OM] to [OM?.faction]")
hacking = FALSE
Expand Down Expand Up @@ -121,42 +121,65 @@ If someone hacks it, you can always rebuild it.
ui.set_autoupdate(TRUE) // hackerman

//Uh oh...
/obj/machinery/computer/iff_console/proc/hack()
/obj/machinery/computer/iff_console/proc/hack(mob/user)
hack_goal = initial(hack_goal)
var/obj/structure/overmap/OM = get_overmap()
if(!OM)
return FALSE
SEND_SIGNAL(OM, COMSIG_SHIP_BOARDED)
SEND_SIGNAL(OM, COMSIG_SHIP_IFF_CHANGE)
OM.relay(pick('sound/ambience/ambitech.ogg', 'sound/ambience/ambitech3.ogg'))
say(pick("981d5d2ef58bae5aec45eb7030e56d29","0d4b1c990a4d84aba5aa0560c55a3f4e", "e935f4417ad97a36e540bc67a807d5c4"))
playsound(loc, 'nsv13/sound/effects/computer/alarm_3.ogg', 80)
switch(OM.faction)
if("syndicate")
OM.faction = "nanotrasen"
OM.swap_faction("nanotrasen")
faction = OM.faction
return
if("nanotrasen")
OM.faction = "syndicate"
var/new_faction = "syndicate"
if(faction_check(user.faction, list("pirate")))
new_faction = "pirate"
OM.swap_faction(new_faction)
faction = OM.faction
if(OM.role == MAIN_OVERMAP) // Make Solgov come get them
var/datum/star_system/player_system = OM.current_system
if(!player_system)
player_system = SSstar_system.ships[OM]["target_system"]
var/datum/star_system/starting_point = SSstar_system.system_by_id(pick(player_system.adjacency_list))

var/datum/fleet/F = new /datum/fleet/solgov/interdiction
starting_point.fleets += F
F.current_system = starting_point
F.assemble(starting_point)
for(var/obj/structure/overmap/ship in starting_point.system_contents)
if(length(ship.mobs_in_ship) && ship.reserved_z)
F.encounter(ship)
message_admins("Solgov interdictor fleet created at [starting_point].")
priority_announce("Contact with [GLOB.station_name] lost. Code Charlie Foxtrot One Niner Eight Four.", "White Rapids Fleet Command")
return
if("pirate")
OM.faction = "nanotrasen"
var/new_faction = "nanotrasen"
if(faction_check(user.faction, list("Syndicate"))) //If the Syndicate somehow manage it
new_faction = "syndicate"
OM.swap_faction(new_faction)
faction = OM.faction
return
//Fallback. Maybe we tried to IFF hack an IFF scrambled ship...?
OM.faction = initial(OM.faction)

/obj/structure/overmap/proc/swap_faction(new_faction)
if(new_faction == initial(faction)) //If you've just reversed your swap, set it to the original faction without hassle
faction = new_faction
return
faction = new_faction
if(role == MAIN_OVERMAP && faction != "nanotrasen")
var/list/valid_systems = list()
for(var/systemtext in current_system.adjacency_list)
var/datum/star_system/S = SSstar_system.system_by_id(systemtext)
if(S.alignment == "syndicate" || S.alignment == "pirate") //We can't spawn a solgov fleet in enemy territory.
continue
valid_systems += S
if(!length(valid_systems))
valid_systems += SSstar_system.system_by_id("Feliciana") //If there's no valid systems just send them to the sector entrance.
var/datum/star_system/starting_point = pick(valid_systems)
var/datum/fleet/F = new /datum/fleet/solgov/interdiction
starting_point.fleets += F
F.current_system = starting_point
F.assemble(starting_point)
for(var/obj/structure/overmap/ship in starting_point.system_contents)
if(length(ship.mobs_in_ship) && ship.reserved_z)
F.encounter(ship)
message_admins("Solgov interdictor fleet created at [starting_point].")
priority_announce("Contact with [GLOB.station_name] lost. Code Charlie Foxtrot One Niner Eight Four.", "White Rapids Fleet Command")
for(var/obj/machinery/porta_turret/T in turrets_in_ship) //Update the turrets too, those will be a pain otherwise
T.faction = list("turret")
switch(new_faction)
if("syndicate")
T.faction += FACTION_SYNDICATE
if("nanotrasen")
T.faction += list("neutral","silicon", "Station")
else
T.faction += new_faction
2 changes: 1 addition & 1 deletion nsv13/code/modules/overmap/ai-skynet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ Adding tasks is easy! Just define a datum for it.
current_system.enemies_in_system += member
all_ships += member
RegisterSignal(member, COMSIG_PARENT_QDELETING , /datum/fleet/proc/remove_ship, member)
RegisterSignal(member, COMSIG_SHIP_BOARDED , /datum/fleet/proc/remove_ship, member)
RegisterSignal(member, COMSIG_SHIP_IFF_CHANGE , /datum/fleet/proc/remove_ship, member)

if(current_system.occupying_z)
current_system.add_ship(member)
Expand Down
2 changes: 1 addition & 1 deletion nsv13/code/modules/overmap/fleet_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
if(OM.alpha >= 150)
if(OM == SSstar_system.find_main_overmap())
OM.hail(pick(traitor_taunts), name)
RegisterSignal(OM, COMSIG_SHIP_BOARDED, PROC_REF(handle_iff_change))
RegisterSignal(OM, COMSIG_SHIP_IFF_CHANGE, PROC_REF(handle_iff_change))
else
OM.hail(pick(taunts), name)
last_encounter_time = world.time
Expand Down
3 changes: 3 additions & 0 deletions nsv13/code/modules/overmap/overmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
//Beacons
var/list/beacons_in_ship = list()

//Turrets
var/list/turrets_in_ship = list()

// Controlling equipment

/*
Expand Down
2 changes: 1 addition & 1 deletion nsv13/code/modules/overmap/starmap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define STARMAP 1

/**
Starmap code largely copied from FT13's starmap, so credit to them! (And monster860...again)
Starmap code largely copied from FTL13's starmap, so credit to them! (And monster860...again)
*/

/datum/asset/simple/starmap
Expand Down
29 changes: 27 additions & 2 deletions nsv13/code/modules/overmap/traders_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@
var/datum/trader/inhabited_trader = null

/obj/structure/overmap/trader/try_hail(mob/living/user)
if(!isliving(user) || !allowed(user)) //Only cargo auth'd personnel can make purchases.
to_chat(user, "<span class='warning'>Warning: You cannot open a communications channel without appropriate requisitions access registered to your ID card.</span>")
if(!isliving(user))
return FALSE
if(inhabited_trader)
if(!allowed(user)) //Only cargo auth'd personnel can make purchases at traders.
to_chat(user, "<span class='warning'>Warning: You cannot open a communications channel without appropriate requisitions access registered to your ID card.</span>")
return FALSE
inhabited_trader.greeting = pick(inhabited_trader.greetings)
inhabited_trader.ui_interact(user)
SEND_SOUND(user, 'nsv13/sound/effects/ship/freespace2/computer/textdraw.wav')
to_chat(user, "<span class='boldnotice'>[pick(inhabited_trader.greetings)]</span>")
else
return ..()

/obj/structure/overmap/trader/can_move()
//Nope!
Expand Down Expand Up @@ -58,6 +62,27 @@
if((datum_flags & DF_ISPROCESSING) && (!current_system || !current_system.occupying_z))
STOP_PROCESSING(SSphysics_processing, src)

/datum/map_template/boarding/smalloutpost
name = "Crab class outpost (interior)"
mappath = "_maps/templates/boarding/syndicate/smalloutpost.dmm"

/obj/structure/overmap/trader/syndicate/outpost
name = "Syndicate Outpost"
icon = 'nsv13/icons/overmap/smallstation.dmi'
icon_state = "outpost"
ai_controlled = TRUE
ai_behaviour = AI_GUARD
missiles = 4
armor = list("overmap_light" = 90, "overmap_medium" = 50, "overmap_heavy" = 40)
overmap_deletion_traits = DAMAGE_STARTS_COUNTDOWN //When it's been boarded, it can break
can_resupply = TRUE //Of course the station can supply
ai_flags = AI_FLAG_STATIONARY
combat_dice_type = /datum/combat_dice/civilian
area_type = /area/ruin/powered/nsv13/boarding_interior
possible_interior_maps = list(/datum/map_template/boarding/smalloutpost)

/obj/structure/overmap/trader/syndicate/outpost/set_trader()
return //They're for boarding, not trading

//General items:

Expand Down
Loading
Loading