combines current progress on antag datums

This commit is contained in:
MadmanMartian
2017-10-21 23:16:13 +01:00
committed by Sood
parent 108a5f70c8
commit 5b31b42581
8 changed files with 142 additions and 30 deletions

View File

@@ -1,3 +1,3 @@
/datum/gamemode/cult
name = "Cult"
factions_allowed = list(datum/faction/cult)
factions_allowed = list(/datum/faction/cult)

View File

@@ -28,6 +28,10 @@
objective_holder = new
forgeObjectives()
//Initialization proc, checks if the faction can be made given the current amount of players and/or other possibilites
/datum/faction/proc/can_setup()
return TRUE
/datum/faction/proc/forgeObjectives()
@@ -41,16 +45,24 @@
ASSERT(O)
objective_holder.AddObjective(O)
/datum/faction/proc/checkAllObjectives()
for(var/datum/objective/O in objective_holder.objectives)
O.Isfullfilled()
/datum/faction/proc/CheckAllObjectives(var/individuals = FALSE)
var/dat
dat += GetObjectivesMenuHeader()
dat += {"<BR><FONT size = 2><B>Faction Objectives</B></FONT>"}
for(var/datum/objective/O in objective_holder.GetObjectives())
dat += {"<BR>[O.explanation_text]<BR>[O.IsFulfilled() ? "Success" : "Failed"]"}
/*if(individuals) NO ROLE DATUMS YET
//for(var/datum/role/R in members)
Get their character description, and their individual objectives*/
return dat
/datum/faction/proc/GetScoreboard()
var/list/score_results = list()
for(var/datum/role/R in members)
/*for(var/datum/role/R in members) NO ROLE DATUMS YET
var/results = R.GetScoreboard()
if(results)
score_results.Add(results)
score_results.Add(results)*/
return score_results
@@ -67,6 +79,15 @@
var/header = {"<BR><img src='data:image/png;base64,[icon2base64(logo)]'> <FONT size = 2><B>Syndicate</B></FONT> <img src='data:image/png;base64,[icon2base64(logo)]'>"}
return header
/datum/faction/syndicate/traitor
name = "Traitors to NT"
desc = "Operatives of the syndicate, implanted into the crew in one way or another."
/datum/faction/syndicate/nuke_op
name = "Syndicate nuclear operatives"
desc = "The culmination of succesful NT traitors, who have managed to steal a nuclear device.\
Load up, grab the nuke, don't forget where you've parked, find the nuclear auth disk, and give them hell."
/datum/faction/changeling
name = "Changeling Hivemind"
desc = "An almost parasitic, shapeshifting entity that assumes the identity of its victims. Commonly used as smart bioweapons by the syndicate,\
@@ -99,3 +120,23 @@
var/icon/logo = icon('icons/mob/mob.dmi', "cult-logo")
var/header = {"<BR><img src='data:image/png;base64,[icon2base64(logo)]'> <FONT size = 2><B>Cult of Nar-Sie</B></FONT> <img src='data:image/png;base64,[icon2base64(logo)]'>"}
return header
/datum/faction/vampire
name = "Space Vampires"
desc = "Beings cursed to wander the galaxy to satiate their lust for blood, \
usually pointed towards NT station by the syndicate in exchange for causing chaos and completing objectives for them.\
Vampirism is still not fully understood, but those afflicted can quickly become a force to be reckoned with if allowed to indulge."
/datum/faction/vampire/GetObjectivesMenuHeader()
var/icon/logo = icon('icons/mob/mob.dmi', "vampire-logo")
var/header = {"<BR><img src='data:image/png;base64,[icon2base64(logo)]'> <FONT size = 2><B>Vampiric wanderers</B></FONT> <img src='data:image/png;base64,[icon2base64(logo)]'>"}
return header
/datum/faction/revolution
name = "Revolutionaries"
desc = "Viva!"
/datum/faction/revolution/GetObjectivesMenuHeader()
var/icon/logo = icon('icons/mob/mob.dmi', "rev-logo")
var/header = {"<BR><img src='data:image/png;base64,[icon2base64(logo)]'> <FONT size = 2><B>Revolutionaries</B></FONT> <img src='data:image/png;base64,[icon2base64(logo)]'>"}
return header

View File

@@ -1,34 +1,65 @@
/*
Gamemode datums
Used for co-ordinating factions in a round, what factions should be in operation, etc.
@name: String: The name of the gamemode, e.g. Changelings
@factions: List(reference): What factions are currently in operation in the gamemode
@factions_allowed: List(object): what factions will the gamemode start with, or attempt to start with
@minimum_player_count: Integer: Minimum required players to start the gamemode
@admin_override: Overrides certain checks such as the one above to force-start a gamemode
*/
/datum/gamemode
name = "Gamemode Parent"
var/name = "Gamemode Parent"
var/list/factions = list()
var/list/factions_allowed = list()
var/minimum_player_count
var/admin_override //Overrides checks such as minimum_player_count to
/datum/gamemode/New()
Setup()
//For when you need to set factions and factions_allowed not on compile
/datum/gamemode/proc/SetupFactions()
/datum/gamemode/proc/Setup()
if(minimum_player_count < get_player_count())
TearDown()
SetupFactions()
CreateFactions()
return
/datum/gamemode/proc/CreateFactions()
var/pc = get_player_count() //right proc?
var/fnum = 1
switch(pc)
if() //Number of factions needs to depend on player count for most modes
fnum =
for(var/i = 1 to fnum)
var/datum/faction/Fac = pick(factions_allowed)
new Fac
for(var/datum/faction/Fac in factions_allowed)
new Fac
if(Fac.can_setup(pc))
factions += Fac
factions_allowed -= Fac
else
message_admins("Unable to start [Fac.name]")
qdel(Fac)
for(var/datum/faction/F in factions)
F.onPostSetup()
PopulateFactions(pc)
PopulateFactions()
/datum/gamemode/proc/PopulateFactions(var/playercount)
if(!playercount)
playercount = get_player_count()
//probably use a var for antags to make per player
/*
Get list of available players
Get list of active factions
Loop through the players to see if they're available for certain factions
Not available if they
don't have their preferences set accordingly
already in another faction
*/
/datum/gamemode/proc/PopulateFactions()
var/list/available_players = get_ready_players()
for(var/datum/faction/F in factions)
for(var/mob/new_player/P in available_players)
if(!P.client /*|| Other bullshit*/)
return
//TODO PREFERENCE FUCKERY AND ROLE CHECKING -- NO ROLE DATUMS AS OF THIS TIME
/datum/gamemode/proc/CheckObjectives(var/individuals = FALSE)
var/dat = ""
@@ -38,9 +69,28 @@
dat += "\n\n"
return dat
/datum/gamemode/proc/TearDown()
//No idea what this is supposed to do
/datum/gamemode/proc/GetScoreboard()
var/dat =""
for(var/datum/faction/F in factions)
dat += F.GetScoreboard()
dat += "\n\n"
return dat
return dat
/datum/gamemode/proc/get_player_count()
var/players = 0
for(var/mob/new_player/P in player_list)
if(P.client && P.ready)
players++
return players
/datum/gamemode/proc/get_ready_players()
var/list/players = list()
for(var/mob/new_player/P in player_list)
if(P.client && P.ready)
players.Add(P)
return players

View File

@@ -1,13 +1,24 @@
/datum/gamemode/mixed
name = "Mixed"
factions_allowed = typesof(/datum/faction) - /datum/faction
/datum/gamemode/mixed/SetupFactions()
factions_allowed = list(typesof(/datum/faction) - /datum/faction)
/datum/gamemode/mixed/traitorchan
name = "Traitorchan"
factions_allowed = typesof(/datum/faction/traitor) + /datum/faction/changeling
/datum/gamemode/mixed/traitorchan/SetupFactions()
factions_allowed = list(typesof(/datum/faction/syndicate/traitor) + /datum/faction/changeling)
/datum/gamemode/mixed/simple
name = "Simple Mixed"
factions_allowed = typesof(/datum/faction/traitor) + /datum/faction/vampire + /datum/faction/changeling
//would the easiest way to handle these be to just create the other gamemodes and let their code run, as opposed to adding their specific terms for faction creation again here?
/datum/gamemode/mixed/simple/SetupFactions()
factions_allowed = list(typesof(/datum/faction/syndicate/traitor) + /datum/faction/vampire + /datum/faction/changeling)
//would the easiest way to handle these be to just create the other gamemodes and let their code run, as opposed to adding their specific terms for faction creation again here?

View File

@@ -1,3 +1,3 @@
/datum/gamemode/nuke
name = "Nuclear Emergency"
factions_allowed = list(/datum/faction/nuke)
factions_allowed = list(/datum/faction/syndicate/nuke_op)

View File

@@ -14,3 +14,10 @@
/datum/objective_holder
var/list/datum/objective/objectives = list()
/datum/objective_holder/proc/AddObjective(var/datum/objective/O)
ASSERT(!objectives.Find(O))
objectives.Add(O)
/datum/objective_holder/proc/GetObjectives()
return objectives

View File

@@ -1,3 +1,3 @@
/datum/faction/revolution
/datum/gamemode/revolution
name = "Revolution"
factions_allowed = list(datum/faction/revolution)
factions_allowed = list(/datum/faction/revolution)

View File

@@ -1,8 +1,11 @@
/datum/gamemode/traitor
name = "Traitor"
factions_allowed = list(/datum/faction/traitor)
factions_allowed = list(/datum/faction/syndicate/traitor)
//are all traitors part of one faction?
/datum/gamemode/traitor/da
name = "Double Agent"
factions_allowed = typesof(/datum/faction/traitor) - /datum/faction/traitor
/datum/gamemode/traitor/da/SetupFactions()
factions_allowed = typesof(/datum/faction/syndicate/traitor) - /datum/faction/syndicate/traitor