Skip to content

Commit

Permalink
Настраиваем антаг_микс на возможность спавнить кукол в сценариях, доб…
Browse files Browse the repository at this point in the history
…авляем радио
  • Loading branch information
PhantornRU committed Jan 6, 2024
1 parent e32e08a commit 5f6ed26
Show file tree
Hide file tree
Showing 24 changed files with 257 additions and 49 deletions.
12 changes: 6 additions & 6 deletions config/example/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1047,11 +1047,11 @@ tag = "blood_brothers"
tag = "vox_raiders"

[antag_mix_gamemode_configuration.antag_scenarios_configuration.params]
"required_players" = 1
"cost" = 1
"weight" = 1
"antag_cap" = 1
"team_size" = 1
"candidates_required" = 1
"required_players" = 30
"cost" = 30
"weight" = 0.25
"antag_cap" = 6
"team_size" = 6
"candidates_required" = 2

################################################################
2 changes: 1 addition & 1 deletion modular_ss220/_defines220/_defines220.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "code/signals_mob/signals_mob_main.dm"
#include "code/signals_mob/signals_mob_silicon.dm"
#include "code/signals_mob/signals_mob_simple.dm"
#include "code/role_preferences.dm"
#include "code/antagonists.dm"
#include "code/gamemode.dm"
#include "code/signals_keybindings.dm"
#include "code/signals_obj.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#define ROLE_BLOOD_BROTHER "blood brother"
#define ROLE_VOX_RAIDER "vox raider"

#define VOX_RAID_FREQ 1220

GLOBAL_LIST_EMPTY(raider_spawn)
12 changes: 12 additions & 0 deletions modular_ss220/antagonists/_antagonists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@
GLOB.huds += new/datum/atom_hud/antag/hidden()
GLOB.special_roles |= ROLE_BLOOD_BROTHER
GLOB.special_roles |= ROLE_VOX_RAIDER

SSradio.ANTAG_FREQS |= list(VOX_RAID_FREQ)

SSradio.radiochannels |= list(
//"Special Ops" = DTH_FREQ,
"VoxCom" = VOX_RAID_FREQ,
)

GLOB.department_radio_keys |= list(
":V" = "VoxCom", "#V" = "VoxCom", ".V" = "VoxCom",
":v" = "VoxCom", "#v" = "VoxCom", ".v" = "VoxCom",
)
10 changes: 7 additions & 3 deletions modular_ss220/antagonists/_antagonists.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
#include "code/antag_mix/scenarios/antag_scenario.dm"
#include "code/antag_mix/scenarios/antag_team_scenario.dm"
#include "code/antag_mix/scenarios/minor_scenarios.dm"
#include "code/antag_mix/scenarios/major_scenarios.dm"
#include "code/configuration/antag_mix_configuration.dm"
#include "code/mind/memory_edit.dm"
#include "code/antag_mix/antag_mix.dm"
#include "code/antagonist_radio.dm"
#include "code/landmarks.dm"
#include "code/antag_datum.dm"
#include "code/objectives.dm"
#include "code/radio.dm"

// Battle Brothers
#include "code/blood_brothers/blood_brothers_team.dm"
// Blood Brothers
#include "code/blood_brothers/blood_brothers_datum.dm"
#include "code/blood_brothers/blood_brothers_team.dm"

// Vox Raiders
#include "code/vox_raider/clothing/vox_backpack.dm"
Expand All @@ -32,4 +35,5 @@
#include "code/vox_raider/objects/vox_trade_instrument.dm"
#include "code/vox_raider/objects/vox_trade.dm"
#include "code/vox_raider/vox_raider_datum.dm"
#include "code/vox_raider/vox_raider_mode.dm"
#include "code/vox_raider/vox_raider_team.dm"
33 changes: 33 additions & 0 deletions modular_ss220/antagonists/code/antag_datum.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/datum/antagonist/proc/create_mob(spawn_loc, species_name = null, list/possible_species, try_use_preference = FALSE)
var/mob/living/carbon/human/H = new(spawn_loc)
var/datum/character_save/character

var/client/client = owner.current.client // !!!!!!! проверить что клиент вообще вызывается даже у гостов
if(try_use_preference && client && client.prefs && length(client.prefs.character_saves))
for(var/datum/character_save/character_save in client.prefs.character_saves)
var/temp_species_name = species_name
if(!temp_species_name)
if(length(possible_species))
temp_species_name = pick(possible_species)
else
temp_species_name = "Human"
if(character_save.species == temp_species_name)
character = character_save
species_name = temp_species_name
break
else
// Randomize appearance
character = new
character.species = species_name ? species_name : get_random_species(TRUE)
character.randomise()

character.copy_to(H)

// species
//H.dna.species.create_organs(H) // !!!!!! Проверить есть ли НУЖНЫЕ органы
H.cleanSE() //No fat/blind/colourblind/epileptic/whatever ops.
H.overeatduration = 0
H.flavor_text = null
H.update_body()

owner.store_memory("<B> Я Вокс-Рейдер, основа моя: беречь стаю, тащить ценности. </B>.")
5 changes: 4 additions & 1 deletion modular_ss220/antagonists/code/antag_mix/antag_mix.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
var/max_antag_fraction = 1
/// How much budget has left
var/budget = 0
/// Scenarious for choose
var/list/datum/antag_scenario/list_scenarios = list()
/// List of scenarios chosen on `pre_setup` stage, and which will be applied on `post_setup`
var/list/datum/antag_scenario/executed_scenarios = list()


/datum/game_mode/antag_mix/New()
. = ..()
apply_configuration()
list_scenarios = subtypesof(/datum/antag_scenario)


/datum/game_mode/antag_mix/pre_setup()
var/list/datum/antag_scenario/possible_scenarios = subtypesof(/datum/antag_scenario)
var/list/datum/antag_scenario/possible_scenarios = list_scenarios

var/list/mob/new_player/ready_players = get_ready_players()
var/ready_players_amount = length(ready_players)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@
/// List of players that were drafted to be antagonists of this scenario
var/list/datum/mind/assigned = list()

/// Is the antagonist chosen from the station's crew?
var/is_crew_antag = TRUE
/// Spawn antagonist at landmark name
var/obj/effect/landmark/spawner/landmark_type = /obj/effect/landmark/spawner/rev
/// What species can be used for the antagonist
var/list/possible_species = list("Human")
/// Recommended species at prefs to increase the chance of getting a role for RP-experienced players
var/list/recommended_species_active_pref
/// Multiplication modifier that increases the chance of landing by N times
var/recommended_species_mod = 0

/datum/antag_scenario/New()
if(abstract)
stack_trace("Instantiation of abstract antag scenarios is prohibited.")
Expand Down Expand Up @@ -105,6 +116,8 @@
if(!length(candidates))
break

modif_chance_recommended_species()

var/mob/new_player/chosen = pick_n_take(candidates)

// We will check if something bad happened with candidates here.
Expand All @@ -118,8 +131,10 @@
chosen_mind.special_role = antag_special_role
chosen_mind.restricted_roles |= restricted_roles

return length(assigned) - assigned_before > 0
if(!try_create_characters())
return FALSE

return length(assigned) - assigned_before > 0
/**
* Called in `post_setup`, which means that all players already have jobs. Here antags should receive everything they need.
* Can fail here, but there is nothing we can do on this stage - all players already have their jobs.
Expand Down Expand Up @@ -178,3 +193,65 @@

if(candidate_mind.assigned_role in restricted_roles)
candidates.Remove(candidate)

/**
* Сreate characters if the antagonist is not from the crew.
*/
/datum/antag_scenario/proc/try_create_characters()
if(is_crew_antag)
return FALSE

if(!length(assigned))
return FALSE

var/list/landmarks = list()
for(var/obj/effect/landmark/landmark in GLOB.landmarks_list)
if(!istype(landmark, landmark_type))
continue
landmarks.Add(landmark)

if(!length(landmarks))
for(var/obj/effect/landmark/spawner/late/landmark in GLOB.landmarks_list)
landmarks.Add(landmark)

if(!length(landmarks))
return FALSE

var/list/temp_landmarks = list()
for(var/datum/mind/mind in assigned)
if(!length(temp_landmarks))
temp_landmarks = landmarks
var/picked_landmark = pick(temp_landmarks)
temp_landmarks.Remove(picked_landmark)
var/turf/loc_spawn = get_turf(picked_landmark)
make_character(mind, loc_spawn)

return TRUE

/**
* Сreate characters if the antagonist is not from the crew.
*/
/datum/antag_scenario/proc/make_character(datum/mind/mind, turf/loc_spawn)
var/picked_species = pick(possible_species)
var/datum/antagonist/temp_antag_datum = locate(antag_datum) in mind.antag_datums
temp_antag_datum.create_mob(loc_spawn, TRUE, picked_species, possible_species)

/**
* Recommended species increase the chance of getting a role for RP-experienced players
*/
/datum/antag_scenario/proc/modif_chance_recommended_species()
if(!length(candidates))
return

if(!recommended_species_mod)
return

if(!length(recommended_species_active_pref))
return

for(var/mob/new_player/candidate in candidates)
var/list/datum/character_save/characters = candidate.client.prefs.character_saves
for(var/datum/character_save/character in characters)
if(character.species in recommended_species_active_pref)
for(var/j in recommended_species_mod)
candidates.Add(candidate)
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
message_admins("Picked team of: [json_encode(members)]")
picked_teams += list(members)

if(!try_create_characters())
return FALSE

return length(picked_teams) - teams_before > 0


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/datum/antag_scenario/team/vox_raiders
name = "Vox Raider"
config_tag = "vox_raiders"
abstract = FALSE
antag_role = ROLE_VOX_RAIDER
antag_special_role = SPECIAL_ROLE_VOX_RAIDER
antag_datum = /datum/antagonist/vox_raider
antag_team = /datum/team/vox_raiders_team
required_players = 30
cost = 30
weight = 0.25
antag_cap = 6
candidates_required = 2
team_size = 6

is_crew_antag = FALSE
landmark_type = /obj/effect/landmark/spawner/vox_raider
possible_species = list("Vox")
recommended_species_active_pref = list("Vox")
recommended_species_mod = 3
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,3 @@
"Special Operations Officer",
"Syndicate Officer",
"Solar Federation General")

/datum/antag_scenario/team/vox_raiders
name = "Vox Raider"
config_tag = "vox_raiders"
abstract = FALSE
antag_role = ROLE_VOX_RAIDER
antag_special_role = SPECIAL_ROLE_VOX_RAIDER
antag_datum = /datum/antagonist/vox_raider
antag_team = /datum/team/vox_raiders_team
required_players = 20
cost = 20
weight = 1
antag_cap = 4
candidates_required = 4
team_size = 4
8 changes: 8 additions & 0 deletions modular_ss220/antagonists/code/landmarks.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/obj/effect/landmark/spawner/vox_raider
name = "Vox Raider"
icon = 'modular_ss220/antagonists/icons/landmark.dmi'
icon_state = "vox_raider"

/obj/effect/landmark/spawner/vox_raider/Initialize(mapload)
spawner_list = GLOB.raider_spawn
return ..()
15 changes: 12 additions & 3 deletions modular_ss220/antagonists/code/mind/memory_edit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@
if("clear")
clear_antag_datum(/datum/antagonist/blood_brother)
if("make")
var/datum/antagonist/blood_brother/brother_antag_datum = new
if(!brother_antag_datum.admin_add(usr, src))
qdel(brother_antag_datum)
var/datum/antagonist/blood_brother/antag_datum = new
if(!antag_datum.admin_add(usr, src))
qdel(antag_datum)

if(href_list["vox_raider"])
switch(href_list["vox_raider"])
if("clear")
clear_antag_datum(/datum/antagonist/vox_raider)
if("make")
var/datum/antagonist/vox_raider/antag_datum = new
if(!antag_datum.admin_add(usr, src))
qdel(antag_datum)

. = ..()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
var/global/const/VOX_RAID_FREQ = 1245
// =============== FREQUENCE ===============
// Часть модуля кода частот в /datum/modpack/antagonists/initialize()

var/global/list/radiochannels |= list(
"Vox Raider" = V_RAID_FREQ,
)

/datum/controller/subsystem/blackbox/LogBroadcast(freq)
if(sealed)
return
switch(freq)
if(VOX_RAID_FREQ)
record_feedback("tally", "radio_usage", 1, "voxcom")
. = ..()


// =============== HEADSETS ===============

/obj/item/radio/headset/vox
name = "vox headset"
Expand All @@ -12,6 +21,7 @@ var/global/list/radiochannels |= list(
requires_tcomms = FALSE
instant = TRUE // Work instantly if there are no comms
freqlock = TRUE
frequency = VOX_RAID_FREQ

/obj/item/radio/headset/vox/alt
name = "vox protect headset"
Expand All @@ -20,3 +30,11 @@ var/global/list/radiochannels |= list(
item_state = "com_headset_alt"
origin_tech = "syndicate=3"
flags = EARBANGPROTECT

/obj/item/encryptionkey/vox
name = "syndicate encryption key"
icon = 'modular_ss220/antagonists/icons/trader_machine.dmi'
icon_state = "vox_key"
channels = list("VoxCom" = 1, "Syndicate" = 1)
origin_tech = "syndicate=3"
syndie = TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "Кикиридиты"
desc = "Криптографический чип доступа к адресам транзакций рассчетных средств воксов."
icon = 'modular_ss220/antagonists/icons/trader_machine.dmi'
icon_state = "vox_cash"
icon_state = "vox_key"
hitsound = "swing_hit"
force = 1
throwforce = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
. = ..()
generate_packs_list()

/obj/machinery/vox_shop/generate_packs_list()
/obj/machinery/vox_shop/proc/generate_packs_list()
packs_list = subtypesof(/datum/vox_pack)

for(var/pack_type in packs_list)
Expand Down
Loading

0 comments on commit 5f6ed26

Please sign in to comment.