mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
team shit
This commit is contained in:
@@ -7,6 +7,8 @@ var/global/list/antagonists = list()
|
||||
var/can_coexist_with_others = TRUE //Whether or not the person will be able to have more than one datum
|
||||
var/list/typecache_datum_blacklist = list() //List of datums this type can't coexist with
|
||||
var/delete_on_mind_deletion = TRUE
|
||||
var/antag_role //the antag type
|
||||
var/replace_banned = TRUE //Should replace jobbaned player with ghosts if granted.
|
||||
|
||||
/datum/antagonist/New(datum/mind/new_owner)
|
||||
antagonists += src
|
||||
@@ -23,9 +25,10 @@ var/global/list/antagonists = list()
|
||||
|
||||
/datum/antagonist/proc/can_be_owned(datum/mind/new_owner)
|
||||
. = TRUE
|
||||
if(owner.has_antag_datum(type))
|
||||
var/datum/mind/tested = new_owner || owner
|
||||
if(tested.has_antag_datum(type))
|
||||
return FALSE
|
||||
for(var/i in owner.antag_datums)
|
||||
for(var/i in tested.antag_datums)
|
||||
var/datum/antagonist/A = i
|
||||
if(is_type_in_typecache(src, A.typecache_datum_blacklist))
|
||||
return FALSE
|
||||
@@ -42,12 +45,35 @@ var/global/list/antagonists = list()
|
||||
/datum/antagonist/proc/remove_innate_effects(mob/living/mob_override)
|
||||
return
|
||||
|
||||
//Assign default team and creates one for one of a kind team antagonists
|
||||
/datum/antagonist/proc/create_team(datum/objective_team/team)
|
||||
return
|
||||
|
||||
//Proc called when the datum is given to a mind.
|
||||
/datum/antagonist/proc/on_gain()
|
||||
if(owner && owner.current)
|
||||
if(!silent)
|
||||
greet()
|
||||
apply_innate_effects()
|
||||
if(is_banned(owner.current) && replace_banned)
|
||||
replace_banned_player()
|
||||
|
||||
/datum/antagonist/proc/is_banned(mob/M)
|
||||
if(!M)
|
||||
return FALSE
|
||||
. = (jobban_isbanned(M,"Syndicate") || (antag_role && jobban_isbanned(M,antag_role)))
|
||||
|
||||
/datum/antagonist/proc/replace_banned_player()
|
||||
set waitfor = FALSE
|
||||
|
||||
var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a [name]?", "[name]", null, antag_role, 0, 100)
|
||||
var/mob/dead/observer/theghost = null
|
||||
if(candidates.len)
|
||||
theghost = pick(candidates)
|
||||
to_chat(owner, "Your mob has been taken over by a ghost! Appeal your role ban if you want to avoid this in the future!")
|
||||
message_admins("[key_name_admin(theghost)] has taken control of ([key_name_admin(owner.current)]) to replace a jobbaned player.")
|
||||
owner.current.ghostize(0)
|
||||
owner.current.key = theghost.key
|
||||
|
||||
/datum/antagonist/proc/on_removal()
|
||||
remove_innate_effects()
|
||||
@@ -55,10 +81,17 @@ var/global/list/antagonists = list()
|
||||
LAZYREMOVE(owner.antag_datums, src)
|
||||
if(!silent && owner.current)
|
||||
farewell()
|
||||
var/datum/objective_team/team = get_team()
|
||||
if(team)
|
||||
team.remove_member(owner)
|
||||
qdel(src)
|
||||
|
||||
/datum/antagonist/proc/greet()
|
||||
return
|
||||
|
||||
//Returns the team antagonist belongs to if any.
|
||||
/datum/antagonist/proc/get_team()
|
||||
return
|
||||
|
||||
/datum/antagonist/proc/farewell()
|
||||
return
|
||||
+14
-3
@@ -73,15 +73,26 @@
|
||||
var/brigged_since = -1
|
||||
var/suicided = FALSE
|
||||
|
||||
New(var/key)
|
||||
src.key = key
|
||||
|
||||
//put this here for easier tracking ingame
|
||||
var/datum/money_account/initial_account
|
||||
|
||||
//zealot_master is a reference to the mob that converted them into a zealot (for ease of investigation and such)
|
||||
var/mob/living/carbon/human/zealot_master = null
|
||||
|
||||
/datum/mind/New(var/key)
|
||||
src.key = key
|
||||
|
||||
|
||||
/datum/mind/Destroy()
|
||||
ticker.minds -= src
|
||||
if(islist(antag_datums))
|
||||
for(var/i in antag_datums)
|
||||
var/datum/antagonist/antag_datum = i
|
||||
if(antag_datum.delete_on_mind_deletion)
|
||||
qdel(i)
|
||||
antag_datums = null
|
||||
return ..()
|
||||
|
||||
/datum/mind/proc/transfer_to(mob/living/new_character)
|
||||
var/datum/atom_hud/antag/hud_to_transfer = antag_hud //we need this because leave_hud() will clear this list
|
||||
var/mob/living/old_current = current
|
||||
|
||||
Reference in New Issue
Block a user