Skip to content

Commit

Permalink
Merge pull request #31 from Realtimeslayer/ghostroleborer
Browse files Browse the repository at this point in the history
ghostrole borer part 1
  • Loading branch information
SynthTwo authored Aug 9, 2024
2 parents 6387067 + e10d05a commit 8c75ecd
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 67 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/role_preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#define ROLE_SPIDER "Spider"
#define ROLE_WIZARD_MIDROUND "Wizard (Midround)"
//NOVA EDIT ADDITION START
#define ROLE_BORER "Borer"
#define ROLE_BORER "Cortical Borer"
#define ROLE_DRIFTING_CONTRACTOR "Drifting Contractor"
#define ROLE_LONE_INFILTRATOR "Lone Infiltrator"
#define ROLE_MUTANT "Mutated Abomination"
Expand Down
74 changes: 74 additions & 0 deletions code/modules/events/ghost_role/cortical_borer.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/datum/round_event_control/cortical_borer
name = "Cortical Borer Infestation"
typepath = /datum/round_event/ghost_role/cortical_borer
weight = 3
min_players = 10
max_occurrences = 1 //should only ever happen once
dynamic_should_hijack = FALSE
category = EVENT_CATEGORY_ENTITIES
description = "A cortical borer has appeared on station. It will also attempt to produce eggs, and will attempt to gather willing hosts and learn chemicals through the blood."

/datum/round_event/ghost_role/cortical_borer
role_name = "Cortical Borer"
minimum_required = 1
announce_when = 10

/datum/round_event/ghost_role/cortical_borer/announce(fake)
priority_announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", ANNOUNCER_ALIENS)

/*
/datum/round_event/ghost_role/cortical_borer/start()
var/list/mob/dead/observer/candidates = SSpolling.poll_ghost_candidates(role = ROLE_BORER,check_jobban = FALSE,alert_pic = /obj/item/borer_egg,role_name_text = "cortical borer",amount_to_pick = 1)
if(isnull(candidates))
return NOT_ENOUGH_PLAYERS
/* disabling vent spawns in favor of maintenance spawns, can be changed later
var/list/vents = list()
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics/components/unary/vent_pump))
if(QDELETED(temp_vent))
continue
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
var/datum/pipeline/temp_vent_parent = temp_vent.parents[1]
if(!temp_vent_parent)
continue // No parent vent
// Stops Cortical Borers getting stuck in small networks.
// See: Security, Virology
if(length(temp_vent_parent.other_atmos_machines) > 20)
vents += temp_vent
if(!length(vents))
return MAP_ERROR
*/
world << "Subsystem 'polling' should be initialized for Cortical Borer Ghost Role"
var/borer_spawn = find_maintenance_spawn()
if(isnull(borer_spawn))
return MAP_ERROR
//var/living_number = max(length(GLOB.player_list) / POP_PER_BORER, 1)
var/choosing_number = min(length(candidates))
for(var/repeating_code in 1 to choosing_number)
var/mob/dead/observer/new_borer = pick(candidates)
candidates -= new_borer
//var/turf/vent_turf = get_turf(pick(vents))
var/mob/living/basic/cortical_borer/spawned_cb = new(borer_spawn)
spawned_cb.ckey = new_borer.ckey
spawned_cb.mind.add_antag_datum(/datum/antagonist/cortical_borer)
to_chat(spawned_cb, span_warning("You are a cortical borer! You can fear someone to make them stop moving, but make sure to inhabit them! You only grow/heal/talk when inside a host!"))
for(var/mob/dead_mob in GLOB.dead_mob_list)
to_chat(dead_mob, span_notice("The cortical borer has been selected, you are able to orbit them! Remember, they can reproduce!"))
return SUCCESSFUL_SPAWN
*/

//trying this to see if it works

/datum/round_event/ghost_role/cortical_borer/spawn_role()
var/mob/chosen_one = SSpolling.poll_ghost_candidates(role = ROLE_BORER,question = "Do you want to play as a Cortical Borer?", alert_pic = /obj/item/borer_egg, role_name_text = "cortical borer", amount_to_pick = 1)
if(isnull(chosen_one))
return NOT_ENOUGH_PLAYERS
var/spawn_location = find_maintenance_spawn()
if(isnull(spawn_location))
return MAP_ERROR
var/mob/living/basic/cortical_borer/spawned_cb = new(spawn_location)
spawned_cb.key = chosen_one.key
spawned_cb.mind.add_antag_datum(/datum/antagonist/cortical_borer)
spawned_cb.log_message("was spawned as a Cortical Borer by an event.", LOG_GAME)
to_chat(spawned_cb, span_warning("You are a cortical borer! You can fear someone to make them stop moving, but make sure to inhabit them! You only grow/heal/talk when inside a host!"))
spawned_mobs += spawned_cb
return SUCCESSFUL_SPAWN
3 changes: 3 additions & 0 deletions code/modules/jobs/job_types/spawner/cortical_borer.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/datum/job/cortical_borer
title = ROLE_BORER
policy_index = ROLE_BORER
4 changes: 4 additions & 0 deletions config/dynamic.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@

"Paradox Clone": {
"weight": 0
},

"Cortical Borer": {
"weight": 0
}
},

Expand Down
2 changes: 1 addition & 1 deletion modular_nova/modules/cortical_borer/code/cortical_borer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ GLOBAL_LIST_EMPTY(cortical_borers)
volume = 100

/mob/living/basic/cortical_borer
name = "cortical borer"
name = "Cortical Borer"
desc = "A slimy creature that is known to go into the ear canal of unsuspecting victims."
icon = 'modular_nova/modules/cortical_borer/icons/animal.dmi'
icon_state = "brainslug"
Expand Down
67 changes: 2 additions & 65 deletions modular_nova/modules/cortical_borer/code/cortical_borer_antag.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define POP_PER_BORER 30

/proc/printborer(datum/mind/borer)
var/list/text = list()
Expand Down Expand Up @@ -35,6 +34,7 @@
show_in_antagpanel = TRUE
roundend_category = "cortical borers"
antagpanel_category = "Cortical Borers"
preview_outfit = /mob/living/basic/cortical_borer/
prevent_roundtype_conversion = FALSE
show_to_ghosts = TRUE
/// The team of borers
Expand Down Expand Up @@ -91,75 +91,14 @@
parts += span_redtext("Borers were unable to learn enough chemicals through the blood!")
return "<div class='panel redborder'>[parts.Join("<br>")]</div>"

/datum/round_event_control/cortical_borer
name = "Cortical Borer Infestation"
typepath = /datum/round_event/ghost_role/cortical_borer
weight = 10
min_players = 999
max_occurrences = 1 //should only ever happen once
dynamic_should_hijack = TRUE
category = EVENT_CATEGORY_ENTITIES
description = "A cortical borer has appeared on station. It will also attempt to produce eggs, and will attempt to gather willing hosts and learn chemicals through the blood."

/datum/round_event/ghost_role/cortical_borer
announce_when = 400

/datum/round_event/ghost_role/cortical_borer/setup()
announce_when = rand(announce_when, announce_when + 50)

/datum/round_event/ghost_role/cortical_borer/announce(fake)
priority_announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", ANNOUNCER_ALIENS)

/datum/round_event/ghost_role/cortical_borer/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/atmospherics/components/unary/vent_pump))
if(QDELETED(temp_vent))
continue
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
var/datum/pipeline/temp_vent_parent = temp_vent.parents[1]
if(!temp_vent_parent)
continue // No parent vent
// Stops Cortical Borers getting stuck in small networks.
// See: Security, Virology
if(length(temp_vent_parent.other_atmos_machines) > 20)
vents += temp_vent
if(!length(vents))
return MAP_ERROR
var/list/mob/dead/observer/candidates = SSpolling.poll_ghost_candidates(
"Do you want to spawn as a cortical borer?",
role = ROLE_PAI,
check_jobban = FALSE,
poll_time = 10 SECONDS,
ignore_category = POLL_IGNORE_CORTICAL_BORER,
alert_pic = /obj/item/borer_egg,
role_name_text = "cortical borer",
)
if(!length(candidates))
return NOT_ENOUGH_PLAYERS
var/living_number = max(length(GLOB.player_list) / POP_PER_BORER, 1)
var/choosing_number = min(length(candidates), living_number)
for(var/repeating_code in 1 to choosing_number)
var/mob/dead/observer/new_borer = pick(candidates)
candidates -= new_borer
var/turf/vent_turf = get_turf(pick(vents))
var/mob/living/basic/cortical_borer/spawned_cb = new /mob/living/basic/cortical_borer(vent_turf)
spawned_cb.ckey = new_borer.ckey
spawned_cb.mind.add_antag_datum(/datum/antagonist/cortical_borer)
to_chat(spawned_cb, span_warning("You are a cortical borer! You can fear someone to make them stop moving, but make sure to inhabit them! You only grow/heal/talk when inside a host!"))
for(var/mob/dead_mob in GLOB.dead_mob_list)
to_chat(dead_mob, span_notice("The cortical borers have been selected, you are able to orbit them! Remember, they can reproduce!"))

/datum/dynamic_ruleset/midround/from_ghosts/cortical_borer
name = "Cortical Borer Infestation"
antag_datum = /datum/antagonist/cortical_borer
midround_ruleset_style = MIDROUND_RULESET_STYLE_LIGHT
antag_flag = ROLE_BORER
enemy_roles = list(
JOB_CAPTAIN,
JOB_DETECTIVE,
JOB_HEAD_OF_SECURITY,
JOB_SECURITY_OFFICER,
)
enemy_roles = list()
required_enemies = list(2,2,1,1,1,1,1,0,0,0)
required_candidates = 1
weight = 3
Expand Down Expand Up @@ -193,5 +132,3 @@
message_admins("[ADMIN_LOOKUPFLW(new_borer)] has been made into a borer by the midround ruleset.")
log_game("DYNAMIC: [key_name(new_borer)] was spawned as a borer by the midround ruleset.")
return new_borer

#undef POP_PER_BORER
5 changes: 5 additions & 0 deletions modular_nova/modules/oneclickantag/code/oneclickantag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ If anyone can figure out how to get Obsessed to work I would be very appreciativ
return TRUE
if(ROLE_ALIEN)
return TRUE
if(ROLE_BORER)
return TRUE
return FALSE

/datum/admins/proc/make_antag(antagtype, opt)
Expand Down Expand Up @@ -189,6 +191,9 @@ If anyone can figure out how to get Obsessed to work I would be very appreciativ
if(ROLE_SPACE_DRAGON)
new /datum/round_event/ghost_role/space_dragon()
return TRUE
if(ROLE_BORER)
new /datum/round_event/ghost_role/cortical_borer()
return TRUE
return FALSE

/datum/admins/proc/make_wizard()
Expand Down
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4146,6 +4146,7 @@
#include "code\modules\events\ghost_role\alien_infestation.dm"
#include "code\modules\events\ghost_role\blob.dm"
#include "code\modules\events\ghost_role\changeling_event.dm"
#include "code\modules\events\ghost_role\cortical_borer.dm"
#include "code\modules\events\ghost_role\fugitive_event.dm"
#include "code\modules\events\ghost_role\morph_event.dm"
#include "code\modules\events\ghost_role\nightmare.dm"
Expand Down Expand Up @@ -4484,6 +4485,7 @@
#include "code\modules\jobs\job_types\spawner\ash_walker.dm"
#include "code\modules\jobs\job_types\spawner\battlecruiser.dm"
#include "code\modules\jobs\job_types\spawner\beach_bum.dm"
#include "code\modules\jobs\job_types\spawner\cortical_borer.dm"
#include "code\modules\jobs\job_types\spawner\escaped_prisoner.dm"
#include "code\modules\jobs\job_types\spawner\exile.dm"
#include "code\modules\jobs\job_types\spawner\free_golem.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Antagonist, Category } from '../base';

const CorticalBorer: Antagonist = {
key: 'corticalborer',
name: 'Cortical Borer',
description: [
`
Become a sluglike creature with the ability to burrow into hosts and help them! ...Or hurt them.
`,
],
category: Category.Midround,
};

export default CorticalBorer;

0 comments on commit 8c75ecd

Please sign in to comment.