Skip to content

Commit

Permalink
upd_1
Browse files Browse the repository at this point in the history
  • Loading branch information
homexp13 committed Jul 9, 2024
1 parent 9db80cc commit bf757c3
Show file tree
Hide file tree
Showing 21 changed files with 28,422 additions and 5 deletions.
27,887 changes: 27,887 additions & 0 deletions _maps/map_files/Xeno_den/Xeno_den.dmm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions code/__DEFINES/_subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
#define INIT_ORDER_ICON_SMOOTHING -16
#define INIT_ORDER_LIGHTING -20
#define INIT_ORDER_SHUTTLE -21
#define INIT_ORDER_XENODEN -23
#define INIT_ORDER_PATH -50
//#define INIT_ORDER_EXPLOSIONS -69 // RUTGMC DELETION
#define INIT_ORDER_EXCAVATION -78
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
#define iscombatpatrolgamemode(O) (istype(O, /datum/game_mode/hvh/combat_patrol))
#define issensorcapturegamemode(O) (istype(O, /datum/game_mode/hvh/combat_patrol/sensor_capture))
#define iscampaigngamemode(O) (istype(O, /datum/game_mode/hvh/campaign))
#define ispointsdefencegamemode(O) (istype(O, /datum/game_mode/infestation/distress/points_defence))

#define isxenoresearcharea(A) (istype(A, /area/mainship/medical/medical_science))

Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/maps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ require only minor tweaks.
#define ZTRAIT_STATION "Station"
#define ZTRAIT_RESERVED "Transit/Reserved"
#define ZTRAIT_GROUND "Ground"
#define ZTRAIT_XENO "XENO"
#define ZTRAIT_MARINE_MAIN_SHIP "Marine Main Ship"
#define ZTRAIT_DOUBLE_SHIPS "Double Marine Ship"
#define ZTRAIT_AWAY "Away"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@
#define INFESTATION_MARINE_DEPLOYMENT 0
#define INFESTATION_MARINE_CRASHING 1
#define INFESTATION_DROPSHIP_CAPTURED_XENOS 2
#define INFESTATION_MARINE_MINOR 3
#define INFESTATION_MARINE_DEN_RUSH 4
#define INFESTATION_MARIN_RUSH_MAJOR 5

#define NUCLEAR_WAR_LARVA_POINTS_NEEDED 8
#define CRASH_LARVA_POINTS_NEEDED 10
Expand Down
2 changes: 1 addition & 1 deletion code/_compile_options.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//#define TESTING //By using the testing("message") proc you can create debug-feedback for people with this
#define TESTING //By using the testing("message") proc you can create debug-feedback for people with this
//uncommented, but not visible in the release version)

//#define DATUMVAR_DEBUGGING_MODE //Enables the ability to cache datum vars and retrieve later for debugging which vars changed.
Expand Down
6 changes: 6 additions & 0 deletions code/_globalvars/lists/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ GLOBAL_LIST_INIT(ammo_list, init_ammo_list()) //List of all ammo types. Use

GLOBAL_LIST_EMPTY(xeno_egg_hugger)

GLOBAL_LIST_EMPTY(miners_phorone)
GLOBAL_LIST_EMPTY(miners_platinum)

GLOBAL_LIST_EMPTY(miner_phorone_locs)
GLOBAL_LIST_EMPTY(miner_platinum_locs)

/proc/init_ammo_list()
. = list()
// Our ammo stuff is initialized here.
Expand Down
17 changes: 17 additions & 0 deletions code/controllers/subsystem/xeno_den.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#define XENO_DEN_LEVEL_PATH "_maps/map_files/Xeno_den/Xeno_den.dmm"

SUBSYSTEM_DEF(Xenoden)
name = "Xenoden"
init_order = INIT_ORDER_XENODEN
flags = SS_NO_FIRE

// Current template in use
var/datum/map_template/xenoden_template

///The actual z-level the den is played on
var/datum/space_level/xenoden_z_level

//Может карту можно как то по другому подгружать и не загружать когда не нужно
/datum/controller/subsystem/Xenoden/Initialize(timeofday)
xenoden_z_level = load_new_z_level(XENO_DEN_LEVEL_PATH, "Xenoden", TRUE, list(ZTRAIT_GROUND = TRUE, ZTRAIT_XENO = TRUE)) // надеюсь ZTRAIT_GROUND будет работать корректно, в противном случает сделать новый трейт

4 changes: 4 additions & 0 deletions code/datums/gamemodes/_game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ GLOBAL_LIST_INIT(bioscan_locations, list(
parts += "[GLOB.round_statistics.larva_from_psydrain] larvas came from psydrain."
if(GLOB.round_statistics.larva_from_silo)
parts += "[GLOB.round_statistics.larva_from_silo] larvas came from silos."
if(GLOB.round_statistics.larva_from_towers)
parts += "[GLOB.round_statistics.larva_from_towers] larvas came from infestation towers."
if(GLOB.round_statistics.larva_from_cocoon)
parts += "[GLOB.round_statistics.larva_from_cocoon] larvas came from cocoons."
if(GLOB.round_statistics.larva_from_marine_spawning)
Expand All @@ -466,6 +468,8 @@ GLOBAL_LIST_INIT(bioscan_locations, list(
parts += "[GLOB.round_statistics.psy_shield_blasts] number of times Warlocks detonated a Psychic Shield."
if(GLOB.round_statistics.points_from_mining)
parts += "[GLOB.round_statistics.points_from_mining] requisitions points gained from mining."
if(GLOB.round_statistics.points_from_towers)
parts += "[GLOB.round_statistics.points_from_towers] requisitions points gained from infestation towers."
if(GLOB.round_statistics.points_from_research)
parts += "[GLOB.round_statistics.points_from_research] requisitions points gained from research."
if(length(GLOB.round_statistics.req_items_produced))
Expand Down
224 changes: 224 additions & 0 deletions code/datums/gamemodes/points_defence.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
/datum/game_mode/infestation/distress/points_defence
name = "Points Defence"
config_tag = "Points Defence"
silo_scaling = 0 //do you really need a silo?

///The amount of sensor towers in sensor defence

var/sensors_activated = 0

var/victory_condition_sensors_amount
var/phorone_sensors
var/platinum_sensors

//points generation
var/points_check_interval = 1 MINUTES
///Last time points balance was checked
var/last_points_check
///Ponderation rate of sensors output
var/sensors_larva_points_scaling = 2.4

//Victory point
var/marine_victory_point = 5000
var/xeno_victory_point = 5000

var/points_to_win = 5000

flags_round_type = MODE_INFESTATION|MODE_LATE_OPENING_SHUTTER_TIMER|MODE_XENO_RULER|MODE_PSY_POINTS|MODE_PSY_POINTS_ADVANCED|MODE_DEAD_GRAB_FORBIDDEN|MODE_HIJACK_POSSIBLE|MODE_SILO_RESPAWN|MODE_SILOS_SPAWN_MINIONS|MODE_ALLOW_XENO_QUICKBUILD

/datum/game_mode/infestation/distress/points_defence/post_setup()
. = ..()

//delete miners
for(var/atom/A AS in GLOB.miners_phorone)
qdel(A)
for(var/atom/A AS in GLOB.miners_platinum)
qdel(A)

//number of sensors
//the number of sensors is greater than necessary to win, so that the late game does not turn into a 1 point defense
switch(TGS_CLIENT_COUNT)
if(1 to 15) //i dunno who will play it
victory_condition_sensors_amount = 2
phorone_sensors = 1
platinum_sensors = 1
if(16 to 30)
victory_condition_sensors_amount = 2
phorone_sensors = 1
platinum_sensors = 2
if(31 to 40)
victory_condition_sensors_amount = 3
phorone_sensors = 2
platinum_sensors = 2
if(41 to 50)
victory_condition_sensors_amount = 3
phorone_sensors = 1
platinum_sensors = 3
if(51 to 75)
victory_condition_sensors_amount = 4
phorone_sensors = 2
platinum_sensors = 3
if(76 to 100)
victory_condition_sensors_amount = 4
phorone_sensors = 1
platinum_sensors = 4
else //madness
victory_condition_sensors_amount = 5
phorone_sensors = 3
platinum_sensors = 3


// TODOD поменять на стационарные точки
//setip sensor towers
for(var/i in 1 to phorone_sensors)
var/turf/T = pick(GLOB.miner_phorone_locs)
new /obj/structure/sensor_tower_infestation(T)
GLOB.miner_phorone_locs -= T

for(var/i in 1 to platinum_sensors)
var/turf/T = pick(GLOB.miner_platinum_locs)
new /obj/structure/sensor_tower_infestation(T)
GLOB.miner_platinum_locs -= T

/datum/game_mode/infestation/distress/points_defence/check_finished()
if(round_finished)
return TRUE

if(world.time < (SSticker.round_start_time + 5 SECONDS))
return FALSE

var/list/living_player_list = count_humans_and_xenos(count_flags = COUNT_IGNORE_ALIVE_SSD|COUNT_IGNORE_XENO_SPECIAL_AREA)
var/num_humans = living_player_list[1]
var/num_xenos = living_player_list[2]
var/num_humans_ship = living_player_list[3]

//TODO поменять условие победы на очки и чтобы была возможность пройти на 2 этап игры
if(SSevacuation.dest_status == NUKE_EXPLOSION_FINISHED)
message_admins("Round finished: [MODE_GENERIC_DRAW_NUKE]") //ship blows, no one wins
round_finished = MODE_GENERIC_DRAW_NUKE
return TRUE

if(round_stage == INFESTATION_DROPSHIP_CAPTURED_XENOS)
message_admins("Round finished: [MODE_INFESTATION_X_MINOR]")
round_finished = MODE_INFESTATION_X_MINOR
return TRUE

if(round_stage == INFESTATION_MARINE_MINOR)
message_admins("Round finished: [MODE_INFESTATION_M_MINOR]")
round_finished = MODE_INFESTATION_M_MINOR
return TRUE

if(round_stage == INFESTATION_MARIN_RUSH_MAJOR)
message_admins("Round finished: [MODE_INFESTATION_M_MAJOR]")
round_finished = MODE_INFESTATION_M_MAJOR
return TRUE

if(!num_humans)
if(!num_xenos)
message_admins("Round finished: [MODE_INFESTATION_DRAW_DEATH]") //everyone died at the same time, no one wins
round_finished = MODE_INFESTATION_DRAW_DEATH
return TRUE
message_admins("Round finished: [MODE_INFESTATION_X_MAJOR]") //xenos wiped out ALL the marines without hijacking, xeno major victory
round_finished = MODE_INFESTATION_X_MAJOR
return TRUE
if(!num_xenos)
if(round_stage == INFESTATION_MARINE_CRASHING)
message_admins("Round finished: [MODE_INFESTATION_M_MINOR]") //marines lost the ground operation but managed to wipe out Xenos on the ship at a greater cost, minor victory
round_finished = MODE_INFESTATION_M_MINOR
return TRUE
message_admins("Round finished: [MODE_INFESTATION_M_MAJOR]") //marines win big
round_finished = MODE_INFESTATION_M_MAJOR
return TRUE
if(round_stage == INFESTATION_MARINE_CRASHING && !num_humans_ship)
if(SSevacuation.human_escaped > SSevacuation.initial_human_on_ship * 0.5)
message_admins("Round finished: [MODE_INFESTATION_X_MINOR]") //xenos have control of the ship, but most marines managed to flee
round_finished = MODE_INFESTATION_X_MINOR
return
message_admins("Round finished: [MODE_INFESTATION_X_MAJOR]") //xenos wiped our marines, xeno major victory
round_finished = MODE_INFESTATION_X_MAJOR
return TRUE
return FALSE

/datum/game_mode/infestation/distress/points_defence/process()
. = ..()
if(world.time > last_points_check + points_check_interval)
add_larva_points()
add_victory_points()
last_points_check = world.time

/datum/game_mode/infestation/distress/points_defence/proc/add_larva_points()
//prohibit generation before the shutters open
if(!SSsilo.can_fire)
return

//we should not spawn larvas on shipside
if(SSmonitor.gamestate == SHIPSIDE)
return

var/current_larva_spawn_rate = 0

var/datum/job/xeno_job = SSjob.GetJobType(/datum/job/xenomorph)
var/active_humans = length(GLOB.humans_by_zlevel["2"]) + length(GLOB.humans_by_zlevel["6"]) //we should not spawn larvas on shipside anyway
var/active_xenos = xeno_job.total_positions - xeno_job.current_positions //burrowed
for(var/mob/living/carbon/xenomorph/xeno AS in GLOB.alive_xeno_list_hive[XENO_HIVE_NORMAL])
if(xeno.xeno_caste.caste_flags & CASTE_IS_A_MINION)
continue
active_xenos ++
current_larva_spawn_rate = (victory_condition_sensors_amount - sensors_activated) / victory_condition_sensors_amount
//We then are normalising with the number of alive marines, so the balance is roughly the same whether or not we are in high pop
current_larva_spawn_rate *= SILO_BASE_OUTPUT_PER_MARINE * active_humans
current_larva_spawn_rate *= sensors_larva_points_scaling
//We scale the rate based on the current ratio of humans to xenos
var/current_human_to_xeno_ratio = active_humans / active_xenos
var/optimal_human_to_xeno_ratio = xeno_job.job_points_needed / (LARVA_POINTS_REGULAR + 1) // TODO это надо дополнительно отбалансить
current_larva_spawn_rate *= clamp(current_human_to_xeno_ratio / optimal_human_to_xeno_ratio , 0, 3) // TODO это надо дополнительно отбалансить

GLOB.round_statistics.larva_from_towers += current_larva_spawn_rate / xeno_job.job_points_needed

xeno_job.add_job_points(current_larva_spawn_rate)

var/datum/hive_status/normal_hive = GLOB.hive_datums[XENO_HIVE_NORMAL]
normal_hive.update_tier_limits()

/datum/game_mode/infestation/distress/points_defence/proc/add_victory_points()
//prohibit generation before the shutters open
if(!SSsilo.can_fire)
return
//Victory point
marine_victory_point += sensors_activated * (points_check_interval / 10)
xeno_victory_point += ((phorone_sensors + platinum_sensors) - sensors_activated) * (points_check_interval / 10)

/datum/game_mode/infestation/distress/points_defence/siloless_hive_collapse()
return

/datum/game_mode/infestation/distress/points_defence/get_siloless_collapse_countdown()
return

/datum/game_mode/infestation/distress/points_defence/update_silo_death_timer(datum/hive_status/silo_owner)
return

///Add gamemode related items to statpanel
/datum/game_mode/infestation/distress/points_defence/get_status_tab_items(datum/dcs, mob/source, list/items)
. = ..()
if(isobserver(source))
items +="Marine victory points: [marine_victory_point]"
items +="Xeno victory points: [xeno_victory_point]"
else
if(isxeno(source))
items +="Victory points: [xeno_victory_point]"
else
items +="Victory points: [marine_victory_point]"

///Add gamemode related items to statpanel
/datum/game_mode/infestation/distress/points_defence/proc/start_hunt()
//marine announce
for(var/mob/living/carbon/human/human AS in GLOB.alive_human_list)
if(human.faction == FACTION_TERRAGOV)
human.playsound_local(human, "sound/effects/CIC_order.ogg", 10, 1)
human.play_screen_text("<span class='maptext' style=font-size:24pt;text-align:left valign='top'><u>OVERWATCH</u></span><br>" + "New Destination has been added to the Normandy, take off and destroy them to the end", /atom/movable/screen/text/screen_text/picture/potrait)
round_stage = INFESTATION_MARINE_DEN_RUSH

/datum/game_mode/infestation/distress/points_defence/proc/can_hunt()
if(marine_victory_point >= points_to_win && round_stage != INFESTATION_MARINE_DEN_RUSH)
return TRUE
return FALSE
2 changes: 2 additions & 0 deletions code/datums/round_statistics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ GLOBAL_DATUM_INIT(round_statistics, /datum/round_statistics, new)
var/psy_lances = 0
var/psy_shields = 0
var/psy_shield_blasts = 0
var/larva_from_towers = 0
var/points_from_towers = 0
6 changes: 6 additions & 0 deletions code/game/objects/machinery/miner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
init_marker()
start_processing()
RegisterSignal(SSdcs, COMSIG_GLOB_DROPSHIP_HIJACKED, PROC_REF(disable_on_hijack))
if(mineral_value >= PLATINUM_CRATE_SELL_AMOUNT)
GLOB.miners_platinum += src
GLOB.miner_platinum_locs += loc
else
GLOB.miners_phorone += src
GLOB.miner_phorone_locs += loc

/**
* This proc is called during Initialize() and should be used to initially setup the minimap marker of a functional miner.
Expand Down
Loading

0 comments on commit bf757c3

Please sign in to comment.