-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
28,422 additions
and
5 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 будет работать корректно, в противном случает сделать новый трейт | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.