Removes SNPCs (#36016)

* he's dead, jim

* a few stragglers

* Restores the populate world-verb
This commit is contained in:
vuonojenmustaturska
2018-02-28 08:11:34 +02:00
committed by CitadelStationBot
parent 3a6d5f9512
commit afb1ab021b
9 changed files with 18 additions and 1911 deletions
-5
View File
@@ -157,11 +157,6 @@
#define FUZZY_CHANCE_HIGH 85
#define FUZZY_CHANCE_LOW 50
#define CHANCE_TALK 1
//Traitor type defines
#define SNPC_BRUTE 1
#define SNPC_STEALTH 2
#define SNPC_MARTYR 3
#define SNPC_PSYCHO 4
#define TK_MAXRANGE 15
@@ -29,7 +29,6 @@ SUBSYSTEM_DEF(idlenpcpool)
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/mob/living/simple_animal/SA = currentrun[currentrun.len]
--currentrun.len
+14 -128
View File
@@ -1,148 +1,34 @@
#define PROCESSING_SIMPLES 0
#define PROCESSING_NPCS 1
#define PROCESSING_DELEGATES 2
#define PROCESSING_ASSISTANTS 3
SUBSYSTEM_DEF(npcpool)
name = "NPC Pool"
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
priority = FIRE_PRIORITY_NPC
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/canBeUsed = list()
var/list/needsDelegate = list()
var/list/needsAssistant = list()
var/list/processing = list()
var/list/currentrun = list()
var/stage
/datum/controller/subsystem/npcpool/stat_entry()
..("NPCS:[processing.len]|D:[needsDelegate.len]|A:[needsAssistant.len]|U:[canBeUsed.len]")
/datum/controller/subsystem/npcpool/proc/stop_processing(mob/living/I)
processing -= I
currentrun -= I
needsDelegate -= I
canBeUsed -= I
needsAssistant -= I
var/list/activelist = GLOB.simple_animals[AI_ON]
..("NPCS:[activelist.len]")
/datum/controller/subsystem/npcpool/fire(resumed = FALSE)
//bot delegation and coordination systems
//General checklist/Tasks for delegating a task or coordinating it (for SNPCs)
// 1. Bot proximity to task target: if too far, delegate, if close, coordinate
// 2. Bot Health/status: check health with bots in local area, if their health is higher, delegate task to them, else coordinate
// 3. Process delegation: if a bot (or bots) has been delegated, assign them to the task.
// 4. Process coordination: if a bot(or bots) has been asked to coordinate, assign them to help.
// 5. Do all assignments: goes through the delegated/coordianted bots and assigns the right variables/tasks to them.
if (!resumed)
var/list/activelist = GLOB.simple_animals[AI_ON]
src.currentrun = activelist.Copy()
stage = PROCESSING_SIMPLES
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
if(stage == PROCESSING_SIMPLES)
while(currentrun.len)
var/mob/living/simple_animal/SA = currentrun[currentrun.len]
--currentrun.len
if(!SA.ckey)
if(SA.stat != DEAD)
SA.handle_automated_movement()
if(SA.stat != DEAD)
SA.handle_automated_action()
if(SA.stat != DEAD)
SA.handle_automated_speech()
if (MC_TICK_CHECK)
return
stage = PROCESSING_NPCS
currentrun = processing.Copy()
src.currentrun = currentrun
var/list/canBeUsed = src.canBeUsed
if(stage == PROCESSING_NPCS)
while(currentrun.len)
var/mob/living/carbon/human/interactive/thing = currentrun[currentrun.len]
--currentrun.len
thing.InteractiveProcess()
var/checkInRange = view(MAX_RANGE_FIND,thing)
if(thing.IsDeadOrIncap(FALSE) || !(locate(thing.TARGET) in checkInRange))
needsDelegate += thing
else if(thing.doing & FIGHTING)
needsAssistant += thing
else
canBeUsed += thing
if (MC_TICK_CHECK)
return
stage = PROCESSING_DELEGATES
currentrun = needsDelegate //localcache
src.currentrun = currentrun
if(stage == PROCESSING_DELEGATES)
while(currentrun.len && canBeUsed.len)
var/mob/living/carbon/human/interactive/check = currentrun[currentrun.len]
var/mob/living/carbon/human/interactive/candidate = canBeUsed[canBeUsed.len]
--currentrun.len
var/helpProb = 0
var/list/chfac = check.faction
var/list/canfac = candidate.faction
var/facCount = LAZYLEN(chfac) * LAZYLEN(canfac)
for(var/C in chfac)
if(C in canfac)
helpProb = min(100,helpProb + 25)
if(helpProb >= 100)
break
if(facCount == 1 && helpProb)
helpProb = 100
if(prob(helpProb) && candidate.takeDelegate(check))
--canBeUsed.len
candidate.eye_color = "red"
candidate.update_icons()
if(MC_TICK_CHECK)
return
stage = PROCESSING_ASSISTANTS
currentrun = needsAssistant //localcache
src.currentrun = currentrun
//no need for the stage check
while(currentrun.len && canBeUsed.len)
var/mob/living/carbon/human/interactive/check = currentrun[currentrun.len]
var/mob/living/carbon/human/interactive/candidate = canBeUsed[canBeUsed.len]
while(currentrun.len)
var/mob/living/simple_animal/SA = currentrun[currentrun.len]
--currentrun.len
var/helpProb = 0
var/list/chfac = check.faction
var/list/canfac = candidate.faction
var/facCount = LAZYLEN(chfac) * LAZYLEN(canfac)
for(var/C in chfac)
if(C in canfac)
helpProb = min(100,helpProb + 25)
if(helpProb >= 100)
break
if(facCount == 1 && helpProb)
helpProb = 100
if(prob(helpProb) && candidate.takeDelegate(check,FALSE))
--canBeUsed.len
candidate.eye_color = "yellow"
candidate.update_icons()
if(!currentrun.len || MC_TICK_CHECK) //don't change SS state if it isn't necessary
return
/datum/controller/subsystem/npcpool/Recover()
processing = SSnpcpool.processing
if(!SA.ckey)
if(SA.stat != DEAD)
SA.handle_automated_movement()
if(SA.stat != DEAD)
SA.handle_automated_action()
if(SA.stat != DEAD)
SA.handle_automated_speech()
if (MC_TICK_CHECK)
return
+3 -6
View File
@@ -65,8 +65,6 @@ GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin())
/client/proc/cmd_admin_check_player_exp, /* shows players by playtime */
/client/proc/toggle_antag_hud, /*toggle display of the admin antag hud*/
/client/proc/toggle_AI_interact, /*toggle admin ability to interact with machines as an AI*/
/client/proc/customiseSNPC, /* Customise any interactive crewmembers in the world */
/client/proc/resetSNPC, /* Resets any interactive crewmembers in the world */
/client/proc/open_shuttle_manipulator, /* Opens shuttle manipulator UI */
/client/proc/deadchat,
/client/proc/toggleprayers,
@@ -231,9 +229,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
/client/proc/toggle_nuke,
/client/proc/cmd_display_del_log,
/client/proc/toggle_antag_hud,
/client/proc/debug_huds,
/client/proc/customiseSNPC,
/client/proc/resetSNPC,
/client/proc/debug_huds
))
/client/proc/add_admin_verbs()
@@ -699,7 +695,8 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
while ((!tile || !istype(tile)) && --k > 0)
if (tile)
new/mob/living/carbon/human/interactive(tile)
var/mob/living/carbon/human/hooman = new(tile)
hooman.equipOutfit(pick(subtypesof(/datum/outfit)))
testing("Spawned test mob at [tile.x],[tile.y],[tile.z]")
while (!area && --j > 0)
@@ -261,15 +261,7 @@
if(InCritical())
msg += "[t_He] [t_is] barely conscious.\n"
if(getorgan(/obj/item/organ/brain))
if(istype(src, /mob/living/carbon/human/interactive))
var/mob/living/carbon/human/interactive/auto = src
if(auto.showexaminetext)
msg += "<span class='deadsay'>[t_He] appear[p_s()] to be some sort of sick automaton, [t_his] eyes are glazed over and [t_his] mouth is slightly agape.</span>\n"
if(auto.debugexamine)
var/dodebug = auto.doing2string(auto.doing)
var/interestdebug = auto.interest2string(auto.interest)
msg += "<span class='deadsay'>[t_He] [t_is] appears to be [interestdebug] and [dodebug].</span>\n"
else if(!key)
if(!key)
msg += "<span class='deadsay'>[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely.</span>\n"
else if(!client)
msg += "[t_He] [t_has] a blank, absent-minded stare and appears completely unresponsive to anything. [t_He] may snap out of it soon.\n"
File diff suppressed because it is too large Load Diff