Skip to content

Commit

Permalink
TGS Test Merge (#6363)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Jun 6, 2024
2 parents 2f18616 + a50f945 commit add658a
Show file tree
Hide file tree
Showing 25 changed files with 4,166 additions and 3,598 deletions.
6 changes: 6 additions & 0 deletions code/__DEFINES/defenses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
#define DEFENSE_BELL_TOWER 4
#define DEFENSE_TESLA_COIL 5

// Defines for /obj/structure/machinery/defenses/sentry/premade/deployable/colony/landing_zone
#define TURRET_BATTERY_STATE_OK 0
#define TURRET_BATTERY_STATE_LOW 1
#define TURRET_BATTERY_STATE_CRITICAL 2
#define TURRET_BATTERY_STATE_DEAD 3

// What range the generator has to be in or defenses has to be in.
#define GEN_SEARCH_RANGE 5
#define GEN_PLASTEEL_COST 10
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define SMOKE_RANK_MED 3
#define SMOKE_RANK_HIGH 4
#define SMOKE_RANK_BOILER 5
#define SMOKE_RANK_MAX 6

// What kind of function to use for Explosions falling off.

Expand Down
8 changes: 8 additions & 0 deletions code/game/area/BigRed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -515,27 +515,35 @@
is_resin_allowed = FALSE
ceiling_muffle = FALSE
base_muffle = MUFFLE_LOW
is_landing_zone = TRUE

/area/bigredv2/outside/telecomm/lz2_cave
name = "\improper Central Grounds Communications Relay"
is_landing_zone = FALSE

/area/bigredv2/outside/telecomm/n_cave
name = "\improper North Cave Communications Relay"
is_landing_zone = FALSE

/area/bigredv2/outside/telecomm/warehouse
name = "\improper Warehouse Communications Relay"
is_landing_zone = FALSE

/area/bigredv2/outside/telecomm/security
name = "\improper Security Communications Relay"
is_landing_zone = FALSE

/area/bigredv2/outside/telecomm/store
name = "\improper General Store Communications Relay"
is_landing_zone = FALSE

/area/bigredv2/outside/telecomm/admin
name = "\improper Administrative Communications Relay"
is_landing_zone = FALSE

/area/bigredv2/outside/telecomm/engi
name = "\improper Engineering Communications Relay"
is_landing_zone = FALSE


/area/bigredv2/outside/engineering
Expand Down
1 change: 0 additions & 1 deletion code/game/area/Corsat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@
/area/corsat/omega/hangar
name = "\improper Landing Bay Omega"
icon_state = "omega_hangar"
is_landing_zone = TRUE

/area/corsat/omega/hangar/office
name = "\improper Omega Hangar Office"
Expand Down
1 change: 1 addition & 0 deletions code/game/area/DesertDam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
/area/desert_dam/building/substation/northwest
name = "Command Substation"
icon_state = "northewestern_ss"
is_landing_zone = TRUE
/area/desert_dam/building/substation/northeast
name = "Command Substation"
icon_state = "northeastern_ss"
Expand Down
5 changes: 5 additions & 0 deletions code/game/area/LV522_Chances_Claim.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
name = "Chance's Claim - Landing Zone One Tunnels"
ceiling = CEILING_METAL

/area/lv522/landing_zone_1/tunnel/far
name = "Chance's Claim - Landing Zone One Tunnels"
ceiling = CEILING_METAL
is_landing_zone = FALSE

/area/shuttle/drop1/lv522
name = "Chance's Claim - Dropship Alamo Landing Zone"
icon_state = "shuttle"
Expand Down
7 changes: 7 additions & 0 deletions code/game/area/Prison_Station_FOP.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
/area/prison/security/checkpoint/hangar
name = "\improper Main Hangar Traffic Control"
is_resin_allowed = FALSE
is_landing_zone = TRUE

/area/prison/storage
icon_state = "engine_storage"
Expand Down Expand Up @@ -211,6 +212,7 @@
name = "\improper Hangar-Barracks Maintenance"
icon_state = "maint_e_shuttle"
is_resin_allowed = FALSE
is_landing_zone = TRUE

/area/prison/canteen
name = "\improper Canteen"
Expand Down Expand Up @@ -457,6 +459,7 @@
/area/prison/monorail/east
name = "\improper East Monorail Station"
is_resin_allowed = FALSE
is_landing_zone = TRUE

/area/prison/monorail/west
name = "\improper West Monorail Station"
Expand All @@ -467,10 +470,12 @@
/area/prison/hanger/main
name = "\improper Main Hanger"
icon_state = "hangar_alpha"
is_landing_zone = TRUE

/area/prison/hanger/research
name = "\improper Research Hanger"
icon_state = "hangar_beta"
is_landing_zone = TRUE

/area/prison/hangar_storage/main
name = "\improper Main Hangar Storage"
Expand All @@ -480,9 +485,11 @@
name = "\improper Research Hangar Storage"
icon_state = "toxstorage"
is_resin_allowed = FALSE
is_landing_zone = TRUE

/area/prison/hangar_storage/research/shuttle
name = "Corporate Shuttle"
is_landing_zone = FALSE

/area/prison/telecomms
name = "\improper Telecommunications"
Expand Down
4 changes: 4 additions & 0 deletions code/game/area/Sulaco.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
flags_area = AREA_NOTUNNEL
is_landing_zone = TRUE
ceiling = CEILING_REINFORCED_METAL
base_lighting_alpha = 0

/area/shuttle/drop1/Enter(atom/movable/O, atom/oldloc)
if(istype(O, /obj/structure/barricade))
Expand All @@ -24,6 +25,7 @@
name = "\improper Dropship Alamo"
icon_state = "shuttlered"
base_muffle = MUFFLE_HIGH
base_lighting_alpha = 255

/area/shuttle/drop1/LV624
name = "\improper Dropship Alamo"
Expand Down Expand Up @@ -71,11 +73,13 @@
flags_area = AREA_NOTUNNEL
is_landing_zone = TRUE
ceiling = CEILING_REINFORCED_METAL
base_lighting_alpha = 0

/area/shuttle/drop2/sulaco
name = "\improper Dropship Normandy"
icon_state = "shuttle"
base_muffle = MUFFLE_HIGH
base_lighting_alpha = 255

/area/shuttle/drop2/LV624
name = "\improper Dropship Normandy"
Expand Down
3 changes: 3 additions & 0 deletions code/game/area/kutjevo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,22 @@
icon_state = "Colony_int"
ceiling = CEILING_METAL
is_resin_allowed = FALSE
is_landing_zone = TRUE

/area/kutjevo/interior/complex/Northwest_Flight_Control
name = "Kutjevo Complex - Northwest Flight Control Room"
icon_state = "Colony_int"
ceiling = CEILING_METAL
is_resin_allowed = FALSE
is_landing_zone = TRUE

/area/kutjevo/interior/complex/Northwest_Security_Checkpoint
name = "Kutjevo Complex - Northwest Security Checkpoint"
icon_state = "Colony_int"
ceiling = CEILING_METAL
is_resin_allowed = FALSE
minimap_color = MINIMAP_AREA_SEC
is_landing_zone = TRUE

//Out buildings + foremans
/area/kutjevo/interior/power
Expand Down
1 change: 1 addition & 0 deletions code/game/area/prison.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
name = "\improper control room"
icon_state = "bridge"
minimap_color = MINIMAP_AREA_COMMAND
is_landing_zone = TRUE

/area/prison/hallway/central_ring
name = "\improper central ring"
Expand Down
1 change: 1 addition & 0 deletions code/game/area/prison_v3_fiorina.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@

/area/fiorina/station/telecomm/lz1_tram
name = "Fiorina - LZ1 Aux Port Communications Relay"
is_landing_zone = TRUE

/area/fiorina/station/telecomm/lz1_engineering
name = "Fiorina - Engineering Primary Communications Relay"
Expand Down
9 changes: 5 additions & 4 deletions code/game/area/shiva.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@
name = "Shiva's Snowball - Blue Warehouse"
icon_state = "hangars1"

/area/shiva/interior/warehouse/caves
name = "Shiva's Snowball - Blue Warehouse Ice Cave"
icon_state = "caves1"

/area/shiva/interior/valley_huts
name = "Shiva's Snowball - Valley Bunker 1"
icon_state = "hangars1"
Expand All @@ -251,17 +255,14 @@
name = "Shiva's Snowball - Valley Disposals"
icon_state = "hangars3"

/area/shiva/interior/warehouse/caves
name = "Shiva's Snowball - Blue Warehouse Ice Cave"
icon_state = "caves1"

/area/shiva/interior/garage
name = "Shiva's Snowball - Cargo Tug Repair Station"
icon_state = "hangars2"

/area/shiva/interior/lz2_habs
name = "Shiva's Snowball - Argentinian Research Headquarters"
icon_state = "bar1"
is_landing_zone = TRUE

/area/shiva/interior/aux_power
name = "Shiva's Snowball - Auxiliary Generator Station"
Expand Down
4 changes: 4 additions & 0 deletions code/game/area/varadero.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
requires_power = FALSE
is_resin_allowed = FALSE
minimap_color = MINIMAP_AREA_LZ
is_landing_zone = TRUE

/area/varadero/exterior/lz1_console/two
name = "New Varadero - Palm Airfield"
Expand All @@ -98,12 +99,14 @@
icon_state = "lz1"
is_resin_allowed = FALSE
minimap_color = MINIMAP_AREA_LZ
is_landing_zone = TRUE

/area/varadero/exterior/lz2_near
name = "New Varadero - Palm Airfield"
icon_state = "lz2"
is_resin_allowed = FALSE
minimap_color = MINIMAP_AREA_LZ
is_landing_zone = TRUE

/area/varadero/exterior/pontoon_beach
name = "New Varadero - Rockabilly Beach"
Expand Down Expand Up @@ -157,6 +160,7 @@
is_resin_allowed = FALSE
minimap_color = MINIMAP_AREA_JUNGLE
sound_environment = SOUND_ENVIRONMENT_ROOM
is_landing_zone = TRUE

/area/varadero/interior/cargo
name = "New Varadero - Cargo"
Expand Down
111 changes: 111 additions & 0 deletions code/game/gamemodes/colonialmarines/colonialmarines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
var/next_research_allocation = 0
var/next_stat_check = 0
var/list/running_round_stats = list()
var/list/lz_smoke = list()

////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -120,9 +121,118 @@

addtimer(CALLBACK(src, PROC_REF(ares_online)), 5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(map_announcement)), 20 SECONDS)
addtimer(CALLBACK(src, PROC_REF(start_lz_hazards)), 3 MINUTES)

return ..()

/datum/game_mode/colonialmarines/ds_first_landed(obj/docking_port/stationary/marine_dropship)
. = ..()
clear_lz_hazards() // This shouldn't normally do anything, but is here just in case

// Assumption: Shuttle origin is its center
// Assumption: dwidth is atleast 2 and dheight is atleast 4 otherwise there will be overlap
var/list/options = list()
var/list/structures_to_break = list(/obj/structure/barricade, /obj/structure/surface/table, /obj/structure/bed)
var/bottom = marine_dropship.y - marine_dropship.dheight - 2
var/top = marine_dropship.y + marine_dropship.dheight + 2
var/left = marine_dropship.x - marine_dropship.dwidth - 2
var/right = marine_dropship.x + marine_dropship.dwidth + 2
var/z = marine_dropship.z

// Bottom left
options += get_valid_sentry_turfs(left, bottom, z, width=5, height=2, structures_to_ignore=structures_to_break)
options += get_valid_sentry_turfs(left, bottom + 2, z, width=2, height=6, structures_to_ignore=structures_to_break)
spawn_lz_sentry(pick(options), structures_to_break)

// Bottom right
options.Cut()
options += get_valid_sentry_turfs(right-4, bottom, z, width=5, height=2, structures_to_ignore=structures_to_break)
options += get_valid_sentry_turfs(right-1, bottom + 2, z, width=2, height=6, structures_to_ignore=structures_to_break)
spawn_lz_sentry(pick(options), structures_to_break)

// Top left
options.Cut()
options += get_valid_sentry_turfs(left, top-1, z, width=5, height=2, structures_to_ignore=structures_to_break)
options += get_valid_sentry_turfs(left, top-7, z, width=2, height=6, structures_to_ignore=structures_to_break)
spawn_lz_sentry(pick(options), structures_to_break)

// Top right
options.Cut()
options += get_valid_sentry_turfs(right-4, top-1, z, width=5, height=2, structures_to_ignore=structures_to_break)
options += get_valid_sentry_turfs(right-1, top-7, z, width=2, height=6, structures_to_ignore=structures_to_break)
spawn_lz_sentry(pick(options), structures_to_break)

///Returns a list of non-dense turfs using the given block arguments ignoring the provided structure types
/datum/game_mode/colonialmarines/proc/get_valid_sentry_turfs(left, bottom, z, width, height, list/structures_to_ignore)
var/valid_turfs = list()
for(var/turf/turf as anything in block(left, bottom, z, left+width-1, bottom+height-1))
if(turf.density)
continue
var/structure_blocking = FALSE
for(var/obj/structure/existing_structure in turf)
if(!existing_structure.density)
continue
if(!is_type_in_list(existing_structure, structures_to_ignore))
structure_blocking = TRUE
break
if(structure_blocking)
continue
valid_turfs += turf
return valid_turfs

///Spawns a droppod with a temporary defense sentry at the given turf
/datum/game_mode/colonialmarines/proc/spawn_lz_sentry(turf/target, list/structures_to_break)
var/obj/structure/droppod/equipment/sentry_holder/droppod = new(target, /obj/structure/machinery/sentry_holder/landing_zone)
droppod.special_structures_to_damage = structures_to_break
droppod.special_structure_damage = 500
droppod.drop_time = 0
droppod.launch(target)

///Creates an OB warning at each LZ to warn of the miasma and then spawns the miasma
/datum/game_mode/colonialmarines/proc/start_lz_hazards()
if(SSobjectives.first_drop_complete)
return // Just for sanity
INVOKE_ASYNC(src, PROC_REF(warn_lz_hazard), locate(/obj/structure/machinery/computer/shuttle/dropship/flight/lz1))
INVOKE_ASYNC(src, PROC_REF(warn_lz_hazard), locate(/obj/structure/machinery/computer/shuttle/dropship/flight/lz2))
addtimer(CALLBACK(src, PROC_REF(spawn_lz_hazards)), OB_TRAVEL_TIMING + 1 SECONDS)

///Creates an OB warning at each LZ to warn of the incoming miasma
/datum/game_mode/colonialmarines/proc/warn_lz_hazard(lz)
if(!lz)
return
var/turf/target = get_turf(lz)
if(!target)
return
var/obj/structure/ob_ammo/warhead/explosive/warhead = new
warhead.name = "\improper CN20-X miasma warhead"
warhead.clear_power = 0
warhead.clear_falloff = 400
warhead.standard_power = 0
warhead.standard_falloff = 30
warhead.clear_delay = 3
warhead.double_explosion_delay = 6
warhead.warhead_impact(target) // This is a blocking call
playsound(target, 'sound/effects/smoke.ogg', vol=50, vary=1, sound_range=75)

///Spawns miasma smoke in landing zones
/datum/game_mode/colonialmarines/proc/spawn_lz_hazards()
var/datum/cause_data/new_cause_data = create_cause_data("CN20-X miasma")
for(var/area/area in GLOB.all_areas)
if(!area.is_landing_zone)
continue
if(!is_ground_level(area.z))
continue
for(var/turf/turf in area)
if(turf.density)
continue
lz_smoke += new /obj/effect/particle_effect/smoke/miasma(turf, null, new_cause_data)

///Clears miasma smoke in landing zones
/datum/game_mode/colonialmarines/proc/clear_lz_hazards()
for(var/obj/effect/particle_effect/smoke/miasma/smoke as anything in lz_smoke)
smoke.time_to_live = rand(1, 5)
lz_smoke.Cut()

#define MONKEYS_TO_TOTAL_RATIO 1/32

/datum/game_mode/colonialmarines/proc/spawn_smallhosts()
Expand Down Expand Up @@ -289,6 +399,7 @@
/datum/game_mode/colonialmarines/ds_first_drop(obj/docking_port/mobile/marine_dropship)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(show_blurb_uscm)), DROPSHIP_DROP_MSG_DELAY)
add_current_round_status_to_end_results("First Drop")
clear_lz_hazards()

///////////////////////////
//Checks to see who won///
Expand Down
Loading

0 comments on commit add658a

Please sign in to comment.