mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Port of RemieRichard's infinite antag system
This is just the first chunk, of fixing around the be_special flag stuff It will probably break everything as-is
This commit is contained in:
@@ -33,7 +33,7 @@ client/proc/one_click_antag()
|
||||
var/datum/mind/themind = null
|
||||
|
||||
for(var/mob/living/silicon/ai/ai in player_list)
|
||||
if(ai.client && ai.client.prefs.be_special & BE_MALF)
|
||||
if(ai.client && (ROLE_MALF in ai.client.prefs.be_special))
|
||||
AIs += ai
|
||||
|
||||
if(AIs.len)
|
||||
@@ -57,8 +57,8 @@ client/proc/one_click_antag()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
if(applicant.client.prefs.be_special & BE_TRAITOR)
|
||||
if(player_old_enough_antag(applicant.client,BE_TRAITOR))
|
||||
if(ROLE_TRAITOR in applicant.client.prefs.be_special)
|
||||
if(player_old_enough_antag(applicant.client,ROLE_TRAITOR))
|
||||
if(!applicant.stat)
|
||||
if(applicant.mind)
|
||||
if (!applicant.mind.special_role)
|
||||
@@ -91,8 +91,8 @@ client/proc/one_click_antag()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
if(applicant.client.prefs.be_special & BE_CHANGELING)
|
||||
if(player_old_enough_antag(applicant.client,BE_CHANGELING))
|
||||
if(ROLE_CHANGELING in applicant.client.prefs.be_special)
|
||||
if(player_old_enough_antag(applicant.client,ROLE_CHANGELING))
|
||||
if(!applicant.stat)
|
||||
if(applicant.mind)
|
||||
if (!applicant.mind.special_role)
|
||||
@@ -123,8 +123,8 @@ client/proc/one_click_antag()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
if(applicant.client.prefs.be_special & BE_REV)
|
||||
if(player_old_enough_antag(applicant.client,BE_REV))
|
||||
if(ROLE_REV in applicant.client.prefs.be_special)
|
||||
if(player_old_enough_antag(applicant.client,ROLE_REV))
|
||||
if(applicant.stat == CONSCIOUS)
|
||||
if(applicant.mind)
|
||||
if(!applicant.mind.special_role)
|
||||
@@ -150,9 +150,9 @@ client/proc/one_click_antag()
|
||||
var/time_passed = world.time
|
||||
|
||||
for(var/mob/G in respawnable_list)
|
||||
if(istype(G) && G.client && G.client.prefs.be_special & BE_WIZARD)
|
||||
if(istype(G) && G.client && (ROLE_WIZARD in G.client.prefs.be_special))
|
||||
if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate"))
|
||||
if(player_old_enough_antag(G.client,BE_WIZARD))
|
||||
if(player_old_enough_antag(G.client,ROLE_WIZARD))
|
||||
spawn(0)
|
||||
switch(G.timed_alert("Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","No",300,"Yes","No"))//alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
@@ -192,8 +192,8 @@ client/proc/one_click_antag()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
if(applicant.client.prefs.be_special & BE_CULTIST)
|
||||
if(player_old_enough_antag(applicant.client,BE_CULTIST))
|
||||
if(ROLE_CULTIST in applicant.client.prefs.be_special)
|
||||
if(player_old_enough_antag(applicant.client,ROLE_CULTIST))
|
||||
if(applicant.stat == CONSCIOUS)
|
||||
if(applicant.mind)
|
||||
if(!applicant.mind.special_role)
|
||||
@@ -224,9 +224,9 @@ client/proc/one_click_antag()
|
||||
var/time_passed = world.time
|
||||
|
||||
for(var/mob/G in respawnable_list)
|
||||
if(istype(G) && G.client && G.client.prefs.be_special & BE_OPERATIVE)
|
||||
if(istype(G) && G.client && (ROLE_OPERATIVE in G.client.prefs.be_special))
|
||||
if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate"))
|
||||
if(player_old_enough_antag(G.client,BE_OPERATIVE))
|
||||
if(player_old_enough_antag(G.client,ROLE_OPERATIVE))
|
||||
spawn(0)
|
||||
switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No"))
|
||||
if("Yes")
|
||||
@@ -442,8 +442,8 @@ client/proc/one_click_antag()
|
||||
|
||||
//Generates a list of candidates from active ghosts.
|
||||
for(var/mob/G in respawnable_list)
|
||||
if(istype(G) && G.client && G.client.prefs.be_special & BE_RAIDER)
|
||||
if(player_old_enough_antag(G.client,BE_RAIDER))
|
||||
if(istype(G) && G.client && (ROLE_RAIDER in G.client.prefs.be_special))
|
||||
if(player_old_enough_antag(G.client,ROLE_RAIDER))
|
||||
if(!jobban_isbanned(G, "raider") && !jobban_isbanned(G, "Syndicate"))
|
||||
spawn(0)
|
||||
switch(alert(G,"Do you wish to be considered for a vox raiding party arriving on the station?","Please answer in 30 seconds!","Yes","No"))
|
||||
@@ -543,8 +543,8 @@ client/proc/one_click_antag()
|
||||
var/mob/living/carbon/human/H = null
|
||||
|
||||
for(var/mob/living/carbon/human/applicant in player_list)
|
||||
if(applicant.client.prefs.be_special & BE_VAMPIRE)
|
||||
if(player_old_enough_antag(applicant.client,BE_VAMPIRE))
|
||||
if(ROLE_VAMPIRE in applicant.client.prefs.be_special)
|
||||
if(player_old_enough_antag(applicant.client,ROLE_VAMPIRE))
|
||||
if(!applicant.stat)
|
||||
if(applicant.mind)
|
||||
if (!applicant.mind.special_role)
|
||||
|
||||
@@ -444,7 +444,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
var/list/candidates = list()
|
||||
for(var/mob/M in player_list)
|
||||
if(M.stat != DEAD) continue //we are not dead!
|
||||
if(!M.client.prefs.be_special & BE_ALIEN) continue //we don't want to be an alium
|
||||
if(!(ROLE_ALIEN in M.client.prefs.be_special)) continue //we don't want to be an alium
|
||||
if(jobban_isbanned(M, "alien") || jobban_isbanned(M, "Syndicate")) continue //we are jobbanned
|
||||
if(M.client.is_afk()) continue //we are afk
|
||||
if(M.mind && M.mind.current && M.mind.current.stat != DEAD) continue //we have a live body we are tied to
|
||||
|
||||
@@ -2,80 +2,4 @@
|
||||
var/list/currently_querying // Used to avoid asking the same ghost repeatedly.
|
||||
|
||||
// The following procs are used to grab players for mobs produced by a seed (mostly for dionaea).
|
||||
/datum/seed/proc/handle_living_product(var/mob/living/host)
|
||||
/*
|
||||
if(!host || !istype(host)) return
|
||||
|
||||
spawn(0)
|
||||
request_player(host)
|
||||
if(istype(host,/mob/living/simple_animal))
|
||||
return
|
||||
spawn(75)
|
||||
if(!host.ckey && !host.client)
|
||||
host.death() // This seems redundant, but a lot of mobs don't
|
||||
host.stat = DEAD // handle death() properly. Better safe than etc.
|
||||
host.visible_message("<span class='danger'>[host] is malformed and unable to survive. It expires pitifully, leaving behind some seeds.</span>")
|
||||
|
||||
var/total_yield = rand(1,3)
|
||||
for(var/j = 0;j<=total_yield;j++)
|
||||
var/obj/item/seeds/S = new(get_turf(host))
|
||||
S.seed_type = name
|
||||
S.update_seed()
|
||||
|
||||
/datum/seed/proc/request_player(var/mob/living/host)
|
||||
if(!host) return
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
if(jobban_isbanned(O, "Dionaea"))
|
||||
continue
|
||||
if(O.client)
|
||||
if(O.client.prefs.be_special & BE_PLANT && !(O.client in currently_querying))
|
||||
currently_querying |= O.client
|
||||
question(O.client,host)
|
||||
|
||||
/datum/seed/proc/question(var/client/C,var/mob/living/host)
|
||||
spawn(0)
|
||||
|
||||
if(!C || !host || !(C.mob && istype(C.mob,/mob/dead))) return // We don't want to spam them repeatedly if they're already in a mob.
|
||||
|
||||
var/response = alert(C, "Someone is harvesting [display_name]. Would you like to play as one?", "Sentient plant harvest", "Yes", "No", "Never for this round.")
|
||||
|
||||
if(!C || !host || !(C.mob && istype(C.mob,/mob/dead))) return // ...or accidentally accept an invalid argument for transfer.
|
||||
|
||||
if(response == "Yes")
|
||||
transfer_personality(C,host)
|
||||
else if (response == "Never for this round")
|
||||
C.prefs.be_special ^= BE_PLANT
|
||||
|
||||
currently_querying -= C
|
||||
|
||||
/datum/seed/proc/transfer_personality(var/client/player,var/mob/living/host)
|
||||
|
||||
//Something is wrong, abort.
|
||||
if(!player || !host) return
|
||||
|
||||
//Host already has a controller, pike off slowpoke.
|
||||
if(host.client && host.ckey) return
|
||||
|
||||
//Transfer them over.
|
||||
host.ckey = player.ckey
|
||||
if(player.mob && player.mob.mind)
|
||||
player.mob.mind.transfer_to(host)
|
||||
|
||||
if(host.dna) host.dna.real_name = host.real_name
|
||||
|
||||
// Update mode specific HUD icons.
|
||||
callHook("harvest_podman", list(host))
|
||||
|
||||
host << "\green <B>You awaken slowly, stirring into sluggish motion as the air caresses you.</B>"
|
||||
|
||||
// This is a hack, replace with some kind of species blurb proc.
|
||||
if(istype(host,/mob/living/simple_animal/diona))
|
||||
host << "<B>You are [host], one of a race of drifting interstellar plantlike creatures that sometimes share their seeds with human traders.</B>"
|
||||
host << "<B>Too much darkness will send you into shock and starve you, but light will help you heal.</B>"
|
||||
|
||||
var/newname = input(host,"Enter a name, or leave blank for the default name.", "Name change","") as text
|
||||
newname = sanitize(newname)
|
||||
if (newname != "")
|
||||
host.real_name = newname
|
||||
host.name = host.real_name
|
||||
*/
|
||||
/datum/seed/proc/handle_living_product(var/mob/living/host)
|
||||
@@ -348,15 +348,15 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
|
||||
proc/requestRecruits(var/obj/item/device/paicard/P)
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
if(O.client && O.client.prefs.be_special & BE_PAI)
|
||||
if(player_old_enough_antag(O.client,BE_PAI))
|
||||
if(O.client && (ROLE_PAI in O.client.prefs.be_special))
|
||||
if(player_old_enough_antag(O.client,ROLE_PAI))
|
||||
if(check_recruit(O))
|
||||
O << "\blue <b>A pAI card is looking for personalities. (<a href='?src=\ref[O];jump=\ref[P]'>Teleport</a> | <a href='?src=\ref[src];signup=\ref[O]'>Sign Up</a>)</b>"
|
||||
//question(O.client)
|
||||
proc/check_recruit(var/mob/dead/observer/O)
|
||||
if(jobban_isbanned(O, "pAI") || jobban_isbanned(O,"nonhumandept"))
|
||||
return 0
|
||||
if(!player_old_enough_antag(O.client,BE_PAI))
|
||||
if(!player_old_enough_antag(O.client,ROLE_PAI))
|
||||
return 0
|
||||
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
|
||||
return 0
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
if(jobban_isbanned(O,"nonhumandept") || jobban_isbanned(O,"Drone"))
|
||||
continue
|
||||
if(O.client)
|
||||
if(O.client.prefs.be_special & BE_PAI)
|
||||
if(ROLE_PAI in O.client.prefs.be_special)
|
||||
question(O.client,O)
|
||||
|
||||
/mob/living/silicon/robot/drone/proc/question(var/client/C,var/mob/M)
|
||||
|
||||
@@ -462,7 +462,7 @@ mob/living/simple_animal/borer/proc/request_player()
|
||||
if(jobban_isbanned(O, "Syndicate"))
|
||||
continue
|
||||
if(O.client)
|
||||
if(O.client.prefs.be_special & BE_ALIEN && !jobban_isbanned(O, "alien"))
|
||||
if((BE_ALIEN in O.client.prefs.be_special) && !jobban_isbanned(O, "alien"))
|
||||
question(O.client)
|
||||
|
||||
mob/living/simple_animal/borer/proc/question(var/client/C)
|
||||
|
||||
Reference in New Issue
Block a user