Skip to content

Commit

Permalink
Points Defence clean up (#202)
Browse files Browse the repository at this point in the history
* clean

* bley
  • Loading branch information
homexp13 authored Sep 3, 2024
1 parent 1b0d105 commit 6d22704
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 44 deletions.
38 changes: 5 additions & 33 deletions code/datums/gamemodes/points_defence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name = "Points Defence"
config_tag = "Points Defence"
silo_scaling = 0 //do you really need a silo?
max_silo_ammount = 1

///The amount of sensor towers in sensor defence

Expand All @@ -22,17 +23,12 @@
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 = 0
var/xeno_victory_point = 0

///Xeno points multiplier
var/marine_victory_points_factor = 1.25
///Xeno points multiplier
var/xeno_victory_points_factor = 0.9 //xeno have towers round start, so
var/marine_victory_points_factor = 1

///Amount of points to be scored
var/points_to_win = 5000
Expand All @@ -42,10 +38,9 @@
///Den rush xeno factor
var/second_stage_xeno_factor = 1.2

var/allow_hijack = FALSE
var/can_hunt = FALSE

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|MODE_TELETOWER|MODE_XENO_DEN
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|MODE_XENO_DEN

/datum/game_mode/infestation/distress/points_defence/post_setup()
. = ..()
Expand Down Expand Up @@ -101,12 +96,6 @@
new /obj/structure/sensor_tower_infestation(T)
GLOB.miner_platinum_locs -= T

//comms
for(var/i in 1 to phorone_sensors_amount)
var/turf/T = pick(GLOB.miner_phorone_locs)
new /obj/machinery/telecomms/relay/preset/tower(T)
GLOB.miner_phorone_locs -= T

/* татарла мапит
// /obj/effect/landmark/sensor_tower_infestation_ground
Expand Down Expand Up @@ -139,7 +128,6 @@

#ifdef TESTING
marine_victory_point = points_to_win
xeno_victory_point = points_to_win
#endif

/datum/game_mode/infestation/distress/points_defence/check_finished()
Expand Down Expand Up @@ -240,21 +228,14 @@

//Victory point
marine_victory_point += sensors_activated * (points_check_interval / 10) * marine_victory_points_factor / (phorone_sensors_amount + platinum_sensors_amount) * (sensors_activated >= boost_condition_sensors_amount) ? 1 : 5 //xeno is fucked up, so skip ground and go to xenorush
if(marine_victory_point >= points_to_win && !can_hunt && !allow_hijack)
if(marine_victory_point >= points_to_win && !can_hunt)
can_hunt = TRUE
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. Extra points awarded in cargo", /atom/movable/screen/text/screen_text/picture/potrait)
SSpoints.supply_points[FACTION_TERRAGOV] += 150

xeno_victory_point += ((phorone_sensors_amount + platinum_sensors_amount) - sensors_activated) * (points_check_interval / 10) * xeno_victory_points_factor/ (phorone_sensors_amount + platinum_sensors_amount)
if(xeno_victory_point >= points_to_win && !allow_hijack && !can_hunt)
allow_hijack = TRUE
for(var/mob/living/carbon/xenomorph/xeno AS in GLOB.alive_xeno_list_hive[XENO_HIVE_NORMAL])
xeno.playsound_local(xeno, "sound/voice/alien_hiss1.ogg", 10, 1)
xeno.play_screen_text("<span class='maptext' style=font-size:24pt;text-align:left valign='top'><u>HIVEMIND</u></span><br>" + "We have enough strength. Hijack a bird freely", /atom/movable/screen/text/screen_text/picture/potrait/queen_mother)

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

Expand All @@ -267,14 +248,8 @@
///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))
if(isobserver(source) || !isxeno(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]"

/datum/game_mode/infestation/distress/points_defence/proc/start_hunt()
//marine announce
Expand All @@ -287,7 +262,4 @@
/datum/game_mode/infestation/distress/points_defence/proc/can_hunt()
return can_hunt && round_stage != INFESTATION_MARINE_DEN_RUSH

/datum/game_mode/infestation/distress/points_defence/proc/allow_hijack()
return allow_hijack

#undef XENO_DEN_LEVEL_PATH
8 changes: 2 additions & 6 deletions code/game/objects/items/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
wearer = user
squadhud = GLOB.huds[GLOB.faction_to_data_hud[faction]]
enable_squadhud()
RegisterSignals(user, list(COMSIG_MOB_REVIVE, COMSIG_MOB_DEATH, COMSIG_HUMAN_SET_UNDEFIBBABLE, COMSIG_HUMAN_DEATH_STAGE_CHANGE, COMSIG_MOVABLE_Z_CHANGED), PROC_REF(update_minimap_icon))
RegisterSignal(SSdcs, COMSIG_GLOB_TELETOWER, PROC_REF(update_minimap_icon))
RegisterSignals(user, list(COMSIG_MOB_REVIVE, COMSIG_MOB_DEATH, COMSIG_HUMAN_SET_UNDEFIBBABLE, COMSIG_HUMAN_DEATH_STAGE_CHANGE), PROC_REF(update_minimap_icon))
if(camera)
camera.c_tag = user.name
if(user.assigned_squad)
Expand All @@ -224,8 +223,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
camera.c_tag = "Unknown"
if(user.assigned_squad)
camera.network -= lowertext(user.assigned_squad.name)
UnregisterSignal(user, list(COMSIG_MOB_DEATH, COMSIG_HUMAN_SET_UNDEFIBBABLE, COMSIG_MOB_REVIVE, COMSIG_HUMAN_DEATH_STAGE_CHANGE, COMSIG_MOVABLE_Z_CHANGED))
UnregisterSignal(SSdcs, COMSIG_GLOB_TELETOWER)
UnregisterSignal(user, list(COMSIG_MOB_DEATH, COMSIG_HUMAN_SET_UNDEFIBBABLE, COMSIG_MOB_REVIVE, COMSIG_HUMAN_DEATH_STAGE_CHANGE))
return ..()

/obj/item/radio/headset/mainship/Destroy()
Expand Down Expand Up @@ -279,8 +277,6 @@ GLOBAL_LIST_INIT(channel_tokens, list(
if(!wearer.job || !wearer.job.minimap_icon)
return
var/marker_flags = initial(minimap_type.marker_flags)
if(!SSmapping.level_has_any_trait(wearer.z, list(ZTRAIT_MARINE_MAIN_SHIP)) && (SSticker.mode?.flags_round_type & MODE_TELETOWER) && !GLOB.tower_relay)
marker_flags = MINIMAP_FLAG_UNIDENTIFIED
if(wearer.stat == DEAD)
if(HAS_TRAIT(wearer, TRAIT_UNDEFIBBABLE))
if(issynth(wearer))
Expand Down
5 changes: 0 additions & 5 deletions code/modules/mob/living/carbon/xenomorph/hive_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,6 @@ GLOBAL_LIST_INIT(tier_to_primo_upgrade, list(
if(!.)
return

if(SSticker.mode?.flags_round_type & MODE_XENO_DEN)
if(!silent)
to_chat(buyer, span_xenowarning("You cannot build silo in this gamemode!"))
return FALSE

var/turf/buildloc = get_step(buyer, building_loc)
if(!buildloc)
return FALSE
Expand Down

0 comments on commit 6d22704

Please sign in to comment.