mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Co-authored-by: Mothblocks <35135081+Jared-Fogle@users.noreply.github.com> Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Jared-Fogle@users.noreply.github.com>
This commit is contained in:
co-authored by
Mothblocks
tralezab
parent
286bbfafc5
commit
ede6b32def
@@ -23,6 +23,8 @@
|
||||
#define COMPONENT_GLOB_BLOCK_CINEMATIC (1<<0)
|
||||
/// ingame button pressed (/obj/machinery/button/button)
|
||||
#define COMSIG_GLOB_BUTTON_PRESSED "!button_pressed"
|
||||
/// crewmember joined the game (mob/living, rank)
|
||||
#define COMSIG_GLOB_CREWMEMBER_JOINED "!crewmember_joined"
|
||||
|
||||
/// signals from globally accessible objects
|
||||
|
||||
|
||||
@@ -1,5 +1,72 @@
|
||||
/datum/team/nation
|
||||
name = "Nation"
|
||||
member_name = "separatist"
|
||||
///a list of ranks that can join this nation.
|
||||
var/list/potential_recruits
|
||||
///checked by the department revolt event to prevent trying to make a nation that is already independent... double independent.
|
||||
var/nation_department
|
||||
var/dangerous_nation = TRUE
|
||||
|
||||
/datum/team/nation/New(starting_members, _potential_recruits, _nation_department)
|
||||
. = ..()
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED, .proc/new_possible_separatist)
|
||||
potential_recruits = _potential_recruits
|
||||
nation_department = _nation_department
|
||||
|
||||
/datum/team/nation/Destroy(force, ...)
|
||||
UnregisterSignal(SSdcs, COMSIG_GLOB_CREWMEMBER_JOINED)
|
||||
. = ..()
|
||||
|
||||
/**
|
||||
* Signal for adding new crewmembers (players joining the game) to the revolution.
|
||||
*
|
||||
* Arguments:
|
||||
* source: global signal, so this is SSdcs.
|
||||
* crewmember: new onboarding crewmember.
|
||||
* rank: new crewmember's rank.
|
||||
*/
|
||||
/datum/team/nation/proc/new_possible_separatist(datum/source, mob/living/crewmember, rank)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(rank in potential_recruits)
|
||||
//surely we can trust the player who just joined the game to have a mind.
|
||||
crewmember.mind.add_antag_datum(/datum/antagonist/separatist,src)
|
||||
|
||||
/**
|
||||
* Called by department revolt event to give the team some objectives.
|
||||
*
|
||||
* Arguments:
|
||||
* dangerous_nation: whether this nation will get objectives that are very very bloodthirsty, like killing other departments.
|
||||
* target_nation: string of the nation they need to destroy/befriend
|
||||
*/
|
||||
/datum/team/nation/proc/generate_nation_objectives(are_we_hostile = TRUE, datum/team/nation/target_nation)
|
||||
dangerous_nation = are_we_hostile
|
||||
if(dangerous_nation && target_nation)
|
||||
var/datum/objective/destroy = new /datum/objective/destroy_nation(null, target_nation)
|
||||
destroy.team = src
|
||||
objectives += destroy
|
||||
target_nation.war_declared(src) //they need to possibly get an objective back
|
||||
var/datum/objective/fluff = new /datum/objective/separatist_fluff(null, name)
|
||||
fluff.team = src
|
||||
objectives += fluff
|
||||
update_all_member_objectives()
|
||||
|
||||
/datum/team/nation/proc/war_declared(datum/team/nation/attacking_nation)
|
||||
if(!dangerous_nation) //peaceful nations do not wish to strike back
|
||||
return
|
||||
//otherwise, lets add an objective to strike them back
|
||||
var/datum/objective/destroy = new /datum/objective/destroy_nation(null, attacking_nation)
|
||||
destroy.team = src
|
||||
objectives += destroy
|
||||
update_all_member_objectives("<span class='danger'>The nation of [attacking_nation] has declared the intent to conquer [src]! You have new objectives.</span>")
|
||||
|
||||
/datum/team/nation/proc/update_all_member_objectives(message)
|
||||
for(var/datum/mind/member in members)
|
||||
var/datum/antagonist/separatist/needs_objectives = member.has_antag_datum(/datum/antagonist/separatist)
|
||||
needs_objectives.objectives |= objectives
|
||||
if(message)
|
||||
to_chat(member.current, message)
|
||||
needs_objectives.owner.announce_objectives()
|
||||
|
||||
/datum/antagonist/separatist
|
||||
name = "Separatists"
|
||||
@@ -7,6 +74,20 @@
|
||||
show_name_in_check_antagonists = TRUE
|
||||
var/datum/team/nation/nation
|
||||
|
||||
/datum/antagonist/separatist/on_gain()
|
||||
create_objectives()
|
||||
. = ..()
|
||||
|
||||
/datum/antagonist/separatist/on_removal()
|
||||
remove_objectives()
|
||||
. = ..()
|
||||
|
||||
/datum/antagonist/separatist/proc/create_objectives()
|
||||
objectives |= nation.objectives
|
||||
|
||||
/datum/antagonist/separatist/proc/remove_objectives()
|
||||
objectives -= nation.objectives
|
||||
|
||||
/datum/antagonist/separatist/create_team(datum/team/nation/new_team)
|
||||
if(!new_team)
|
||||
return
|
||||
@@ -16,4 +97,56 @@
|
||||
return nation
|
||||
|
||||
/datum/antagonist/separatist/greet()
|
||||
to_chat(owner, "<B>You are a separatist! [nation.name] forever! Protect the sovereignty of your newfound land with your comrades in arms!</B>")
|
||||
to_chat(owner, "<span class='boldannounce'>You are a separatist for an independent [nation.nation_department]! [nation.name] forever! Protect the sovereignty of your newfound land with your comrades (fellow department members) in arms!</span>")
|
||||
owner.announce_objectives()
|
||||
|
||||
//objectives
|
||||
/datum/objective/destroy_nation
|
||||
name = "nation destruction"
|
||||
explanation_text = "Make sure no member of the enemy nation escapes alive!"
|
||||
team_explanation_text = "Make sure no member of the enemy nation escapes alive!"
|
||||
var/datum/team/nation/target_team
|
||||
|
||||
/datum/objective/destroy_nation/update_explanation_text()
|
||||
. = ..()
|
||||
if(target_team)
|
||||
explanation_text = "Make sure no member of [target_team] ([target_team.nation_department]) nation escapes alive!"
|
||||
else
|
||||
explanation_text = "Free Objective"
|
||||
|
||||
/datum/objective/destroy_nation/New(text, target_department)
|
||||
. = ..()
|
||||
target_team = target_department
|
||||
update_explanation_text()
|
||||
|
||||
/datum/objective/destroy_nation/check_completion()
|
||||
if(!target_team)
|
||||
return TRUE
|
||||
|
||||
for(var/datum/antagonist/separatist/separatist_datum in GLOB.antagonists)
|
||||
if(separatist_datum.nation.nation_department != target_team.nation_department) //a separatist, but not one part of the department we need to destroy
|
||||
continue
|
||||
var/datum/mind/target = separatist_datum.owner
|
||||
if(target && considered_alive(target) && (target.current.onCentCom() || target.current.onSyndieBase()))
|
||||
return FALSE //at least one member got away
|
||||
return TRUE
|
||||
|
||||
/datum/objective/separatist_fluff
|
||||
|
||||
/datum/objective/separatist_fluff/New(text, nation_name)
|
||||
var/list/explanationTexts = list(
|
||||
"The rest of the station must be taxed for their use of [nation_name]'s services.", \
|
||||
"Make statues everywhere of your glorious leader of [nation_name]. If you have nobody, crown one amongst yourselves!", \
|
||||
"[nation_name] must be absolutely blinged out.", \
|
||||
"Damage as much of the station as you can, keep it in disrepair. [nation_name] must be the untouched paragon!", \
|
||||
"Heavily reinforce [nation_name] against the dangers of the outside world.", \
|
||||
"Make sure [nation_name] is fully off the grid, not requiring power or any other services from other departments!", \
|
||||
"Use a misaligned teleporter to make you and your fellow citizens of [nation_name] flypeople. Bring toxin medication!", \
|
||||
"Save the station when it needs you most. [nation_name] will be remembered as the protectors.", \
|
||||
"Arm up. The citizens of [nation_name] have a right to bear arms.",
|
||||
)
|
||||
explanation_text = pick(explanationTexts)
|
||||
..()
|
||||
|
||||
/datum/objective/separatist_fluff/check_completion()
|
||||
return TRUE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//this datum is used by the events controller to dictate how it selects events
|
||||
//this singleton datum is used by the events controller to dictate how it selects events
|
||||
/datum/round_event_control
|
||||
var/name //The human-readable name of the event
|
||||
var/typepath //The typepath of the event datum /datum/round_event
|
||||
|
||||
@@ -1,56 +1,116 @@
|
||||
/datum/round_event_control/wizard/deprevolt //stationwide!
|
||||
name = "Departmental Uprising"
|
||||
weight = 0 //An order that requires order in a round of chaos was maybe not the best idea. Requiescat in pace departmental uprising August 2014 - March 2015
|
||||
weight = 0 //An order that requires order in a round of chaos was maybe not the best idea. Requiescat in pace departmental uprising August 2014 - March 2015 //hello motherfucker i fixed your shit in 2021
|
||||
typepath = /datum/round_event/wizard/deprevolt
|
||||
max_occurrences = 1
|
||||
earliest_start = 0 MINUTES
|
||||
|
||||
var/picked_department
|
||||
var/announce = FALSE
|
||||
var/dangerous_nation = TRUE
|
||||
|
||||
/datum/round_event_control/wizard/deprevolt/admin_setup()
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
var/list/options = list("Random", "Uprising of Assistants", "Medical", "Engineering", "Science", "Supply", "Service", "Security")
|
||||
picked_department = input(usr,"Which department should revolt?","Select a department") as null|anything in options
|
||||
|
||||
var/announce_question = alert(usr, "Announce This New Independent State?", "Secession", "Announce", "No Announcement")
|
||||
if(announce_question == "Announce")
|
||||
announce = TRUE
|
||||
|
||||
var/dangerous_question = alert(usr, "Dangerous Nation? This means they will fight other nations.", "Conquest", "Yes", "No")
|
||||
if(dangerous_question == "No")
|
||||
dangerous_nation = FALSE
|
||||
|
||||
//this is down here to allow the random system to pick a department whilst considering other independent departments
|
||||
if(!picked_department || picked_department == "Random")
|
||||
picked_department = null
|
||||
return
|
||||
|
||||
/datum/round_event/wizard/deprevolt/start()
|
||||
|
||||
var/list/tidecolor
|
||||
var/list/jobs_to_revolt = list()
|
||||
var/nation_name
|
||||
var/list/citizens = list()
|
||||
var/datum/round_event_control/wizard/deprevolt/event_control = control
|
||||
|
||||
tidecolor = pick("grey", "white", "yellow", "purple", "brown", "whatevercolorrepresentstheservicepeople")
|
||||
switch(tidecolor)
|
||||
if("grey") //God help you
|
||||
var/list/independent_departments = list() ///departments that are already independent, these will be disallowed to be randomly picked
|
||||
var/list/cannot_pick = list() ///departments that are already independent, these will be disallowed to be randomly picked
|
||||
for(var/datum/antagonist/separatist/separatist_datum in GLOB.antagonists)
|
||||
if(!separatist_datum.nation)
|
||||
continue
|
||||
independent_departments |= separatist_datum.nation
|
||||
cannot_pick |= separatist_datum.nation.nation_department
|
||||
|
||||
var/announcement = event_control.announce
|
||||
var/dangerous = event_control.dangerous_nation
|
||||
var/department
|
||||
if(event_control.picked_department)
|
||||
department = event_control.picked_department
|
||||
event_control.picked_department = null
|
||||
else
|
||||
department = pick(list("Uprising of Assistants", "Medical", "Engineering", "Science", "Supply", "Service", "Security") - cannot_pick)
|
||||
if(!department)
|
||||
message_admins("Department Revolt could not create a nation, as all the departments are independent! You have created nations, you madman!")
|
||||
var/list/jobs_to_revolt = list()
|
||||
var/nation_name
|
||||
var/list/citizens = list()
|
||||
|
||||
switch(department)
|
||||
if("Uprising of Assistants") //God help you
|
||||
jobs_to_revolt = list("Assistant")
|
||||
nation_name = pick("Assa", "Mainte", "Tunnel", "Gris", "Grey", "Liath", "Grigio", "Ass", "Assi")
|
||||
if("white")
|
||||
if("Medical")
|
||||
jobs_to_revolt = GLOB.medical_positions
|
||||
nation_name = pick("Mede", "Healtha", "Recova", "Chemi", "Viro", "Psych")
|
||||
if("yellow")
|
||||
if("Engineering")
|
||||
jobs_to_revolt = GLOB.engineering_positions
|
||||
nation_name = pick("Atomo", "Engino", "Power", "Teleco")
|
||||
if("purple")
|
||||
if("Science")
|
||||
jobs_to_revolt = GLOB.science_positions
|
||||
nation_name = pick("Sci", "Griffa", "Geneti", "Explosi", "Mecha", "Xeno")
|
||||
if("brown")
|
||||
nation_name = pick("Sci", "Griffa", "Geneti", "Explosi", "Mecha", "Xeno", "Nani", "Cyto")
|
||||
if("Supply")
|
||||
jobs_to_revolt = GLOB.supply_positions
|
||||
nation_name = pick("Cargo", "Guna", "Suppli", "Mule", "Crate", "Ore", "Mini", "Shaf")
|
||||
if("whatevercolorrepresentstheservicepeople") //the few, the proud, the technically aligned
|
||||
if("Service") //the few, the proud, the technically aligned
|
||||
jobs_to_revolt = GLOB.service_positions.Copy() - list("Assistant", "Prisoner")
|
||||
nation_name = pick("Honka", "Boozo", "Fatu", "Danka", "Mimi", "Libra", "Jani", "Religi")
|
||||
if("Security")
|
||||
jobs_to_revolt = GLOB.security_positions
|
||||
nation_name = pick("Securi", "Beepski", "Shitcuri", "Red", "Stunba", "Flashbango", "Flasha", "Stanfordi")
|
||||
|
||||
nation_name += pick("stan", "topia", "land", "nia", "ca", "tova", "dor", "ador", "tia", "sia", "ano", "tica", "tide", "cis", "marea", "co", "taoide", "slavia", "stotzka")
|
||||
if(department == "Uprising of Assistants")
|
||||
var/prefix = pick("roving clans", "barbaric tribes", "tides", "bandit kingdom", "tribal society", "marauder clans", "horde")
|
||||
nation_name = "The [prefix] of [nation_name]"
|
||||
|
||||
var/datum/team/nation/nation = new
|
||||
var/datum/team/nation/nation = new(null, jobs_to_revolt, department)
|
||||
nation.name = nation_name
|
||||
var/datum/team/department_target //dodges unfortunate runtime
|
||||
if(independent_departments.len)
|
||||
department_target = pick(independent_departments)
|
||||
nation.generate_nation_objectives(dangerous, department_target)
|
||||
|
||||
for(var/i in GLOB.human_list)
|
||||
var/mob/living/carbon/human/H = i
|
||||
if(H.mind)
|
||||
var/datum/mind/M = H.mind
|
||||
if(M.assigned_role && !(M.has_antag_datum(/datum/antagonist)))
|
||||
for(var/job in jobs_to_revolt)
|
||||
if(M.assigned_role == job)
|
||||
citizens += H
|
||||
M.add_antag_datum(/datum/antagonist/separatist,nation)
|
||||
H.log_message("Was made into a separatist, long live [nation_name]!", LOG_ATTACK, color="red")
|
||||
var/mob/living/carbon/human/possible_separatist = i
|
||||
if(!possible_separatist.mind)
|
||||
continue
|
||||
var/datum/mind/separatist_mind = possible_separatist.mind
|
||||
if(!separatist_mind.assigned_role)
|
||||
continue
|
||||
for(var/job in jobs_to_revolt)
|
||||
if(separatist_mind.assigned_role == job)
|
||||
citizens += possible_separatist
|
||||
separatist_mind.add_antag_datum(/datum/antagonist/separatist, nation, department)
|
||||
nation.add_member(separatist_mind)
|
||||
possible_separatist.log_message("Was made into a separatist, long live [nation_name]!", LOG_ATTACK, color="red")
|
||||
|
||||
if(citizens.len)
|
||||
var/message
|
||||
for(var/job in jobs_to_revolt)
|
||||
message += "[job],"
|
||||
message_admins("The nation of [nation_name] has been formed. Affected jobs are [message]")
|
||||
var/jobs_english_list = english_list(jobs_to_revolt)
|
||||
message_admins("The nation of [nation_name] has been formed. Affected jobs are [jobs_english_list]. Any new crewmembers with these jobs will join the secession.")
|
||||
if(announcement)
|
||||
var/announce_text = "The new independent state of [nation_name] has formed from the ashes of the [department] department!"
|
||||
if(department == "Uprising of Assistants") //the text didn't really work otherwise
|
||||
announce_text = "The assistants of the station have risen to form the new independent state of [nation_name]!"
|
||||
priority_announce(announce_text, "Secession from [GLOB.station_name]")
|
||||
else
|
||||
message_admins("The nation of [nation_name] did not have enough potential members to be created.")
|
||||
qdel(nation)
|
||||
|
||||
@@ -371,6 +371,8 @@
|
||||
if(GLOB.curse_of_madness_triggered)
|
||||
give_madness(humanc, GLOB.curse_of_madness_triggered)
|
||||
|
||||
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CREWMEMBER_JOINED, humanc, rank)
|
||||
|
||||
GLOB.joined_player_list += character.ckey
|
||||
|
||||
if(CONFIG_GET(flag/allow_latejoin_antagonists) && humanc) //Borgs aren't allowed to be antags. Will need to be tweaked if we get true latejoin ais.
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user