This commit is contained in:
DeityLink
2021-06-21 20:29:46 +02:00
committed by GitHub
parent dba1ca7b0e
commit 3df6ca22e6
8 changed files with 157 additions and 4 deletions

View File

@@ -18,6 +18,7 @@
#define BLOBCONGLOMERATE "blob conglomerate"
#define CLOCKWORK "clockwork"
#define PLAGUEMICE "plague mice invasion"
#define SPIDERINFESTATION "spider infestation"
#define SPIDERCLAN "spider clan"
#define XENOMORPH_HIVE "alien hivemind"
//-------
@@ -68,6 +69,7 @@
#define CATBEAST "loose catbeast"
#define RAMBLER "soul rambler"
#define PLAGUEMOUSE "plague mouse"
#define GIANTSPIDER "giant spider"
#define STREAMER "streamer"
#define XENOMORPH "alien"
#define PRISONER "prisoner"

View File

@@ -649,6 +649,40 @@
new_role.Greet(GREET_DEFAULT)
new_role.AnnounceObjectives()
//////////////////////////////////////////////
// //
// SPIDER INFESTATION ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //
//////////////////////////////////////////////
/datum/dynamic_ruleset/midround/from_ghosts/faction_based/spider_infestation
name = "Spider Infestation"
role_category = /datum/role/giant_spider
//no enemy jobs, it's just a bunch of spiders
//might change later if they actually happen to stomp the crew but that seems pretty unlikely
required_candidates = 1
max_candidates = 12 // max amount of spiderlings spawned by a spider infestation random event
weight = BASE_RULESET_WEIGHT
cost = 25
requirements = list(90,80,60,40,30,20,10,10,10,10)
high_population_requirement = 50
flags = MINOR_RULESET
my_fac = /datum/faction/spider_infestation
logo = "spider-logo"
/datum/dynamic_ruleset/midround/from_ghosts/faction_based/spider_infestation/generate_ruleset_body(var/mob/applicant)
var/datum/faction/spider_infestation/active_fac = find_active_faction_by_type(my_fac)
if (!active_fac.invasion)
active_fac.SetupSpawn()
var/mob/living/simple_animal/hostile/giant_spider/spiderling/new_spider = new (active_fac.invasion)
new_spider.key = applicant.key
return new_spider
/datum/dynamic_ruleset/midround/from_ghosts/faction_based/spider_infestation/setup_role(var/datum/role/new_role)
my_fac.HandleRecruitedRole(new_role)
new_role.Greet(GREET_DEFAULT)
new_role.AnnounceObjectives()
//////////////////////////////////////////////
// //
// XENOMORPHS ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -697,10 +731,6 @@
/datum/dynamic_ruleset/midround/from_ghosts/faction_based/xenomorph/setup_role(var/datum/role/new_role)
my_fac.HandleRecruitedRole(new_role)
/datum/dynamic_ruleset/midround/from_ghosts/faction_based/xenomorph/execute()
..()
//////////////////////////////////////////////
// //
// Prisoner ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,81 @@
/datum/faction/spider_infestation
name = SPIDERINFESTATION
ID = SPIDERINFESTATION
logo_state = "spider-logo"
hud_icons = list("spider-logo")
initroletype = /datum/role/giant_spider
initial_role = GIANTSPIDER
roletype = /datum/role/giant_spider
late_role = GIANTSPIDER
var/turf/invasion // where the player controlled spiders spawn
var/list/vents = list() // for additional NPC spiders
var/extra_spiders = 12
/datum/faction/spider_infestation/New()
..()
forgeObjectives()
/datum/faction/spider_infestation/OnPostSetup()
if (!invasion)
SetupSpawn()
if (invasion)
for(var/datum/role/giant_spider/M in members)
var/datum/mind/spider_mind = M.antag
spider_mind.current.forceMove(invasion)
extra_spiders--
ExtraSpawns()
spawn(rand(30 SECONDS, 60 SECONDS))//same delay and announcement as during the random event
command_alert(/datum/command_alert/xenomorphs)
//unlike random events, we'll have player spiders all spawn together so they can chat and coordinate a bit if at all
/datum/faction/spider_infestation/proc/SetupSpawn()
if (!invasion)
var/list/found_vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/v in atmos_machines)
if(!v.welded && v.z == STATION_Z && v.canSpawnMice==1) // No more spawning in atmos. Assuming the mappers did their jobs, anyway.
found_vents.Add(v)
if(found_vents.len)
while(found_vents.len > 0)
var/obj/machinery/atmospherics/unary/vent_pump/v = pick(found_vents)
found_vents -= v
for (var/mob/M in player_list)
if (isliving(M) && (get_dist(M,v) > 7))//trying to find just one vent that is far out of view of any player
invasion = v
return
var/spawn_area_type = pick(
/area/maintenance/incinerator,
/area/storage/nuke_storage,
/area/storage/tech,
)
var/area/spawn_area = locate(spawn_area_type)
var/list/turf/simulated/floor/floors = list()
for(var/turf/simulated/floor/F in spawn_area)
floors += F
if(!F.has_dense_content())
invasion = F
return
invasion = pick(floors)//or any floor really.
//we'll always spawn 12 spiderlings total, both player and NPC
/datum/faction/spider_infestation/proc/ExtraSpawns()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in atmos_machines)
if(temp_vent.loc.z == map.zMainStation && !temp_vent.welded && temp_vent.network)
if(temp_vent.network.normal_members.len > 50)
vents += temp_vent
while((extra_spiders > 0) && vents.len)
var/obj/vent = pick(vents)
new /mob/living/simple_animal/hostile/giant_spider/spiderling(vent.loc)
vents -= vent
extra_spiders--
/datum/faction/spider_infestation/forgeObjectives()
AppendObjective(/datum/objective/spider)

View File

@@ -0,0 +1,15 @@
/datum/objective/spider
name = "Spider."
explanation_text = "Terrorize the crew, and above all, break every light source you come across."
var/broken_lights = 0
/datum/objective/spider/extraInfo()
explanation_text += " ([broken_lights] lights broken by spiders in total.)"
/datum/objective/spider/IsFulfilled()
if (..())
return TRUE
if (broken_lights > 1)
return TRUE//it's more of a formality really
return FALSE

View File

@@ -0,0 +1,16 @@
/datum/role/giant_spider
name = GIANTSPIDER
id = GIANTSPIDER
special_role = GIANTSPIDER
required_pref = ROLE_MINOR
wikiroute = ROLE_MINOR
logo_state = "spider-logo"
greets = list(GREET_DEFAULT)
datum/role/giant_spider/Greet(var/greeting,var/custom)
if(!greeting)
return
var/icon/logo = icon('icons/logos.dmi', logo_state)
to_chat(antag.current, "<img src='data:image/png;base64,[icon2base64(logo)]' style='position: relative; top: 10;'/> <span class='warning'><B>You are a spiderling!</B><BR>Hide until you can evolve into a giant spider and terrorize the crew!</span>")

View File

@@ -473,6 +473,12 @@ var/global/list/obj/machinery/light/alllights = list()
M.do_attack_animation(src, M)
for(var/mob/O in viewers(src))
O.show_message("<span class='attack'>[M.name] smashed the light!</span>", 1, "You hear a tinkle of breaking glass", 2)
if (isspider(M))
var/datum/faction/spider_infestation/infestation = find_active_faction_by_type(/datum/faction/spider_infestation)
if (infestation)
var/datum/objective/spider/S = locate() in infestation.objective_holder.objectives
if (S)
S.broken_lights++
broken()
return
// attack with hand - remove tube/bulb

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -352,6 +352,7 @@
#include "code\datums\gamemode\factions\malf.dm"
#include "code\datums\gamemode\factions\plague_mice.dm"
#include "code\datums\gamemode\factions\spider_clan.dm"
#include "code\datums\gamemode\factions\spider_infestation.dm"
#include "code\datums\gamemode\factions\vampire_faction.dm"
#include "code\datums\gamemode\factions\vox_shoal.dm"
#include "code\datums\gamemode\factions\wizard.dm"
@@ -411,6 +412,7 @@
#include "code\datums\gamemode\objectives\sample.dm"
#include "code\datums\gamemode\objectives\silence.dm"
#include "code\datums\gamemode\objectives\spesstv.dm"
#include "code\datums\gamemode\objectives\spider.dm"
#include "code\datums\gamemode\objectives\spray_blood.dm"
#include "code\datums\gamemode\objectives\steal_priority_items.dm"
#include "code\datums\gamemode\objectives\summon_narsie.dm"
@@ -450,6 +452,7 @@
#include "code\datums\gamemode\role\changeling.dm"
#include "code\datums\gamemode\role\clockwork.dm"
#include "code\datums\gamemode\role\cultist.dm"
#include "code\datums\gamemode\role\giant_spider.dm"
#include "code\datums\gamemode\role\grinch.dm"
#include "code\datums\gamemode\role\legacy_cultist.dm"
#include "code\datums\gamemode\role\madmonkey.dm"