Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
#define ADMIN_INDIVIDUALLOG(user) "(<a href='byond://?_src_=holder;[HrefToken(TRUE)];individuallog=[REF(user)]'>LOGS</a>)"
#define ADMIN_REPLY_MSGTERMINAL(src) "(<a href='byond://?_src_=holder;[HrefToken(TRUE)];CommsMsgReply=[REF(src)]'>REPLY</a>)"

#define ADMIN_APPROVEOBJECTIVE(user, message, antag_datum) "(<a href='?_src_=holder;[HrefToken(TRUE)];objectiveapprove=[REF(user)];objectivemessage=[message];objectiveteam=[REF(antag_datum)]'>APPROVE</a>)"
#define ADMIN_DENYOBJECTIVE(user, antag_datum) "(<a href='?_src_=holder;[HrefToken(TRUE)];objectivedeny=[REF(user)];objectiveteam=[REF(antag_datum)]'>DENY</a>)"

#define ADMIN_PUNISHMENT_LIGHTNING "Lightning bolt"
#define ADMIN_PUNISHMENT_BRAINDAMAGE "Brain damage"
#define ADMIN_PUNISHMENT_GIB "Gib"
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/lists/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ GLOBAL_LIST_EMPTY(money_piles)
GLOBAL_LIST_EMPTY(spent_bullet_casings) //list of all spent bullet casings

GLOBAL_LIST_EMPTY(lamppost) //list of all lampposts

GLOBAL_LIST_EMPTY(faction_item_spawners) //list of all faction item spawners
27 changes: 27 additions & 0 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2574,6 +2574,33 @@
usr.client.invisimin()

//fortuna addition end

// heremus addition start - faction objective shit
else if(href_list["objectiveapprove"])
if(!check_rights(R_ADMIN))
return

var/mob/M = locate(href_list["objectiveapprove"])
var/datum/antagonist/faction/antag_datum = locate(href_list["objectiveteam"])
to_chat(M, "<span class='green'>Your new objective for [antag_datum.faction_name] has been approved!</span>")
antag_datum.my_faction.set_additional_objective(href_list["objectivemessage"])

log_admin("[key_name(usr)] has accepted [key_name(M)]'s objective for [antag_datum.faction_name]")
message_admins("[key_name_admin(usr)] has accepted [key_name_admin(M)]'s objective for [antag_datum.faction_name]")

else if(href_list["objectivedeny"])
if(!check_rights(R_ADMIN))
return

var/mob/M = locate(href_list["objectivedeny"])
var/datum/antagonist/faction/antag_datum = locate(href_list["objectiveteam"])
to_chat(M, "<span class='red'>Your new objective for [antag_datum.faction_name] has been denied!</span>")

log_admin("[key_name(usr)] has denied [key_name(M)]'s objective for [antag_datum.faction_name]")
message_admins("[key_name_admin(usr)] has denied [key_name_admin(M)]'s objective for [antag_datum.faction_name]")
// heremus addition end


else if(href_list["create_object"])
if(!check_rights(R_SPAWN))
return
Expand Down
49 changes: 49 additions & 0 deletions code/modules/antagonists/faction/add_faction_objective.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/mob/living/proc/add_legion_objective()
set name = "Add Legion Objective"
set category = "IC"
add_faction_objective(/datum/antagonist/faction/legion, list("Legion Legate", "Legion Centurion", "Legion Veteran Decanus"))

/mob/living/proc/add_ncr_objective()
set name = "Add NCR Objective"
set category = "IC"
add_faction_objective(/datum/antagonist/faction/ncr, list("NCR Lieutenant","NCR Sergeant First Class","NCR Captain", "NCR Colonel"))


/mob/living/proc/add_faction_objective(antag_datum_type, list/whitelisted_jobs)
if(islist(mind.antag_datums))
var/datum/antagonist/faction/antag_datum = locate(antag_datum_type) in mind.antag_datums

// check to make sure the verb is being used by the right people
if(!mind)
return
if(!antag_datum)
to_chat(usr, "<span class='warning'>You aren't in a faction! You shouldn't have this verb, send a bug report!</span>")
return
var/whitelisted_job = FALSE
for(var/job_indx in whitelisted_jobs)
if(job == job_indx)
whitelisted_job = TRUE
break
if(!whitelisted_job)
to_chat(usr, "<span class='warning'>You aren't a commander of your faction!</span>")
return

// confirm objective overwrite
if(antag_datum.my_faction.additional_objective)
var/confirm = input("Making a new objective will overwrite the previously made additional objective. Are you \
sure you wish to continue?", "New Faction Objective") in list("Yes", "No")
if(confirm == "No")
return

// now make the new objective
var/new_objectives = input(usr, "Write a short summary of what you want \
as a additional objective for your faction. Make sure it doesn't contradict your faction's already \
existing objective if it exists!.", "New Faction Objective") as null|message
new_objectives = sanitize(new_objectives)
if(isnull(new_objectives))
return
to_chat(usr, "<span class='notice'>You've submitted a request for a new objective for [antag_datum.faction_name]. You'll be told whether it has been approved or denied soon.</span>")
message_admins("[ADMIN_LOOKUPFLW(usr)] wishes to set a new objective for [antag_datum.faction_name]. '[new_objectives]' \
<br>[ADMIN_APPROVEOBJECTIVE(src, new_objectives, antag_datum)] or [ADMIN_DENYOBJECTIVE(src, antag_datum)]?")
else
return
138 changes: 138 additions & 0 deletions code/modules/antagonists/faction/faction.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// yeah, this is just mostly stolen from tg families
// (like thats a bad thing, families is always fun as fuck)

/datum/antagonist/faction // base class for faction antag objectives
name = "Faction Member"
roundend_category = "faction"
antagpanel_category = "Faction"
show_in_antagpanel = FALSE //should only show subtypes
show_to_ghosts = TRUE
var/faction_name = "Faction"
/// The overarching family that the owner of this datum is a part of. Family teams are generic and imprinted upon by the per-person antagonist datums.
var/datum/team/faction/my_faction
/// The abbreviation of the family corresponding to this family member datum.
var/faction_id = "IDK"
/// Type of team to create when creating the gang in the first place. Used for renames.
var/faction_team_type = /datum/team/faction

/datum/antagonist/faction/create_team(team_given) // gets called whenever add_antag_datum() is called on a mind
if(team_given)
my_faction = team_given
return
// if theres no preexisting team given we see if one already exists
var/found_faction = FALSE
for(var/datum/team/faction/faction_team in get_all_teams(/datum/team/faction))
if(faction_team.name == faction_name)
my_faction = faction_team
found_faction = TRUE
break
// if not, we make a new one
if(!found_faction)
var/new_faction = new faction_team_type()
my_faction = new_faction
my_faction.name = faction_name
my_faction.faction_id = faction_id
my_faction.faction_datum = src
my_faction.current_objectives = SSfaction_objectives.current_objectives

/datum/antagonist/faction/get_team()
return my_faction

/datum/antagonist/faction/greet()
if(my_faction.current_objectives.faction_objectives[src.type] || my_faction.additional_objective)
to_chat(usr, "<span class='notice'><b>[faction_name] Objectives:</b></span>")
if(my_faction.current_objectives.faction_objectives[src.type])
to_chat(usr, "<span class='notice'>Main Objective: [my_faction.current_objectives.faction_objectives[src.type]]</span>")
if(my_faction.additional_objective)
to_chat(usr, "<span class='notice'>[my_faction.current_objectives.faction_objectives[src.type] ? "Additional " : ""]Objective: [my_faction.additional_objective]</span>")

/datum/team/faction
/// The abbreviation of this family.
var/faction_id = "IDK"
/// The specific, occupied family member antagonist datum that is used to reach the handler / check objectives, and from which the above properties (sans points) are inherited.
var/datum/antagonist/faction/faction_datum
/// The current faction objectives.
var/datum/faction_objectives/current_objectives
/// Additional objective added by players
var/additional_objective

/datum/team/faction/roundend_report()
var/list/report = list()
report += "<span class='header'>[name]:</span>"
if(current_objectives.everyone_objective)
report += "Objective: [current_objectives.everyone_objective]"
else
var/assigned_objective = current_objectives.faction_objectives[faction_datum.type]
if(assigned_objective || additional_objective)
if(assigned_objective)
report += "Main Objective: [assigned_objective]"
if(additional_objective)
report += "[assigned_objective ? "Additional " : ""]Objective: [additional_objective]"

else
report += "This faction had no objectives to complete." // factions can be set no objectives

return "<div class='panel redborder'>[report.Join("<br>")]</div>"

/datum/team/faction/proc/set_additional_objective(var/new_objective)
additional_objective = new_objective
for(var/datum/mind/faction_member in members)
to_chat(faction_member, "<span class='notice'>A new objective has been assigned: [additional_objective]</span>")

// here are the actual factions

/datum/team/faction/legion
faction_id = "LEG"

/datum/antagonist/faction/legion
show_in_antagpanel = TRUE
name = "Legionary"
roundend_category = "The Boreal Legion"
faction_name = "The Boreal Legion"
faction_id = "LEG"
faction_team_type = /datum/team/faction/legion

/datum/team/faction/ncr
faction_id = "NCR"

/datum/antagonist/faction/ncr
show_in_antagpanel = TRUE
name = "PRNC Soldier"
roundend_category = "The People's Republic of New California"
faction_name = "The Californian People's Liberation Force"
faction_id = "NCR"
faction_team_type = /datum/team/faction/ncr

/datum/team/faction/bos
faction_id = "BOS"

/datum/antagonist/faction/bos
show_in_antagpanel = TRUE
name = "Brotherhood of Steel Cultist"
roundend_category = "The Brotherhood of Steel"
faction_name = "Brotherhood of Steel"
faction_id = "BOS"
faction_team_type = /datum/team/faction/bos

// undecided on these
/datum/team/faction/tribal
faction_id = "TRIB"

/datum/antagonist/faction/tribal
show_in_antagpanel = TRUE
name = "Tribal"
roundend_category = "The tribals"
faction_name = "Tribals"
faction_id = "TRIB"
faction_team_type = /datum/team/faction/tribal

/datum/team/faction/bighorn
faction_id = "TOWN"

/datum/antagonist/faction/bighorn
show_in_antagpanel = TRUE
name = "Bighorn Citizen"
roundend_category = "Bighorn"
faction_name = "Bighorn"
faction_id = "TOWN"
faction_team_type = /datum/team/faction/bighorn
41 changes: 41 additions & 0 deletions code/modules/antagonists/faction/faction_item_spawner.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/obj/effect/spawner/faction_item
name = "faction objective item spawner"
var/spawn_on_turf = TRUE
var/associated_faction // antagonist datum type

/obj/effect/spawner/faction_item/Initialize()
. = ..()
GLOB.faction_item_spawners += src

/obj/effect/spawner/faction_item/Destroy()
GLOB.faction_item_spawners -= src
. = ..()

/obj/effect/spawner/faction_item/proc/spawn_item()
if(associated_faction && SSfaction_objectives.current_objectives)
var/datum/faction_objectives/current_objectives = SSfaction_objectives.current_objectives
if(current_objectives.faction_items[associated_faction])
var/atom/A = spawn_on_turf ? get_turf(src) : loc
var/item_to_spawn = current_objectives.faction_items[associated_faction]
new item_to_spawn(A)
return INITIALIZE_HINT_QDEL

/obj/effect/spawner/faction_item/legion
name = "legion objective item spawner"
associated_faction = /datum/antagonist/faction/legion

/obj/effect/spawner/faction_item/ncr
name = "NCR objective item spawner"
associated_faction = /datum/antagonist/faction/ncr

/obj/effect/spawner/faction_item/bos
name = "BOS objective item spawner"
associated_faction = /datum/antagonist/faction/bos

/obj/effect/spawner/faction_item/tribal
name = "tribal objective item spawner"
associated_faction = /datum/antagonist/faction/tribal

/obj/effect/spawner/faction_item/bighorn
name = "bighorn objective item spawner"
associated_faction = /datum/antagonist/faction/bighorn
29 changes: 29 additions & 0 deletions code/modules/antagonists/faction/faction_objectives.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/datum/faction_objectives
///The name of the theme.
var/name = "Faction Objective"
///All gangs in the theme, typepaths of gangs.
var/list/involved_factions = list()
///The objectives for the gangs. Associative list, type = "objective"
var/list/faction_objectives = list()
///Items given to the factions. Associative list, faction type = item type
var/list/faction_items = list()
///If this isn't null, everyone gets this objective.
var/list/everyone_objective = null
///Intel message sent to faction comms consoles.
var/intel_message = null

/datum/faction_objectives/test
name = "Test"
involved_factions = list(/datum/antagonist/faction/ncr, /datum/antagonist/faction/legion)
faction_objectives = list(

/datum/antagonist/faction/ncr = "Hello, NCR. Our numbers are going down. We need you to bring those numbers up. \
Collect protection money from the station's departments by any means necessary. \
If you need to 'encourage' people to pay up, do so. Get to these potential clients before the Mob does.",

/datum/antagonist/faction/legion = "Good afternoon, LEGION. The Boss sends his regards. He also sends a message. \
We need to collect what we're owed. The departments on this station all owe quite a lot of money to us. We intend to collect on our debts. \
Collect the debt owed by our clients from the departments on the station. \
Make sure to get to them before those damn mafiosos do."
)
intel_message = "IDFK what to put here"
29 changes: 29 additions & 0 deletions code/modules/antagonists/faction/faction_subsystem.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
///Forces the faction objectives via variable editing. Used for debugging.
GLOBAL_VAR(faction_objective_override)

SUBSYSTEM_DEF(faction_objectives)
name = "Faction Objectives"
flags = SS_NO_FIRE
var/datum/faction_objectives/current_objectives

/datum/controller/subsystem/faction_objectives/Initialize(start_timeofday)
// set objectives
if(!GLOB.faction_objective_override)
var/objectives_to_use = pick(subtypesof(/datum/faction_objectives))
current_objectives = new objectives_to_use
else
current_objectives = new GLOB.faction_objective_override

// spawn items for faction objectives
for(var/obj/effect/spawner/faction_item/faction_item_spawner in GLOB.faction_item_spawners)
faction_item_spawner.spawn_item()

// send intel message to all message terminals
if(current_objectives.intel_message)
for(var/obj/machinery/msgterminal/i_hate_the_fbi_and_i_hate_the_cia in GLOB.allTerminals)
i_hate_the_fbi_and_i_hate_the_cia.createmessage("A little birdie", "INTEL REPORT", current_objectives.intel_message, 2) // 2 = high message priority
return ..()

/datum/controller/subsystem/faction_objectives/stat_entry(msg)
msg = "Current Faction Objectives: [current_objectives.name]"
return ..()
18 changes: 18 additions & 0 deletions code/modules/antagonists/faction/view_faction_objective.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/mob/living/proc/view_faction_objective()
set name = "View Faction Objective"
set category = "IC"

if(islist(mind.antag_datums))
for(var/antag_datum_type in subtypesof(/datum/antagonist/faction))
if(locate(antag_datum_type) in mind.antag_datums)
var/datum/antagonist/faction/antag_datum = locate(antag_datum_type) in mind.antag_datums
to_chat(usr, "<span class='notice'><b>[antag_datum.faction_name] Objectives:</b></span>")
var/assigned_objective = antag_datum.my_faction.current_objectives.faction_objectives[antag_datum_type]
var/additional_objective = antag_datum.my_faction.additional_objective
if(assigned_objective || additional_objective)
if(assigned_objective)
to_chat(usr, "<span class='notice'>Main Objective: [assigned_objective]</span>")
if(additional_objective)
to_chat(usr, "<span class='notice'>[assigned_objective ? "Additional " : ""]Objective: [additional_objective]</span>")
else
to_chat(usr, "<span class='notice'>No objectives to complete</span>")
5 changes: 5 additions & 0 deletions code/modules/jobs/job_types/bighorn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Will probably start phasing more of this to actual custom access as we go.
exp_type = EXP_TYPE_BIGHORN
faction = FACTION_BIGHORN

/datum/job/bighorn/after_spawn(mob/living/spawner, mob/client_holder, latejoin = FALSE)
. = ..()
spawner.mind.add_antag_datum(/datum/antagonist/faction/bighorn)
add_verb(spawner,/mob/living/proc/view_faction_objective)

/*
Mayor
*/
Expand Down
7 changes: 6 additions & 1 deletion code/modules/jobs/job_types/bos.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ Main doors: ACCESS_CAPTAIN 20
outfit = /datum/outfit/job/bos/
exp_type = EXP_TYPE_BROTHERHOOD

objectivesList = list("Leadership recommends the following goal for this week: Establish an outpost at the radio tower","Leadership recommends the following goal for this week: Acquire blueprints for research and preservation", "Leadership recommends the following goal for this week: Acquire or confiscate dangerous tech by any means necessary.")
//objectivesList = list("Leadership recommends the following goal for this week: Establish an outpost at the radio tower","Leadership recommends the following goal for this week: Acquire blueprints for research and preservation", "Leadership recommends the following goal for this week: Acquire or confiscate dangerous tech by any means necessary.")

/datum/job/bos/after_spawn(mob/living/spawner, mob/client_holder, latejoin = FALSE)
. = ..()
spawner.mind.add_antag_datum(/datum/antagonist/faction/bos)
add_verb(spawner,/mob/living/proc/view_faction_objective)

/datum/outfit/job/bos
name = "bosdatums"
Expand Down
Loading
Loading