Skip to content

Commit

Permalink
Merge pull request Baystation12#34719 from SierraKomodo/THE-LEGION-CO…
Browse files Browse the repository at this point in the history
…MMETH

Add legionified hivebots and beacon
  • Loading branch information
SierraKomodo authored Jul 21, 2024
2 parents d01577d + ea318de commit 2b338fe
Show file tree
Hide file tree
Showing 15 changed files with 561 additions and 0 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3321,5 +3321,6 @@
#include "interface\skin.dmf"
#include "maps\_map_include.dm"
#include "maps\_maps.dm"
#include "packs\legion\_pack.dm"
#include "~code\global_init.dm"
// END_INCLUDE
2 changes: 2 additions & 0 deletions code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@

#define SPAN_OCCULT(X) SPAN_CLASS("cult", "[X]")

#define SPAN_LEGION(X) SPAN_CLASS("legion", "[X]")

#define SPAN_MFAUNA(X) SPAN_CLASS("mfauna", "[X]")

#define SPAN_SUBTLE(X) SPAN_CLASS("subtle", "[X]")
Expand Down
2 changes: 2 additions & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var/global/list/admin_verbs_admin = list(
/client/proc/cmd_admin_visible_narrate,
/client/proc/cmd_admin_audible_narrate,
/client/proc/cmd_admin_local_narrate,
/client/proc/cmd_admin_legion_narrate,
/client/proc/cmd_admin_world_narrate, //sends text to all players with no padding,
/client/proc/cmd_admin_create_centcom_report,
/client/proc/check_ai_laws, //shows AI and borg laws,
Expand Down Expand Up @@ -243,6 +244,7 @@ var/global/list/admin_verbs_hideable = list(
/client/proc/cmd_admin_visible_narrate,
/client/proc/cmd_admin_audible_narrate,
/client/proc/cmd_admin_local_narrate,
/client/proc/cmd_admin_legion_narrate,
/client/proc/cmd_admin_world_narrate,
/client/proc/play_local_sound,
/client/proc/play_sound,
Expand Down
2 changes: 2 additions & 0 deletions code/modules/admin/verbs/randomverbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"warning",
"danger",
"occult",
"legion",
"unsafe"
)
if (!style)
Expand Down Expand Up @@ -166,6 +167,7 @@
if ("warning") result = SPAN_WARNING(result)
if ("danger") result = SPAN_DANGER(result)
if ("occult") result = SPAN_OCCULT(result)
if ("legion") result = SPAN_LEGION(result)
switch (size)
if ("small") result = FONT_SMALL(result)
if ("large") result = FONT_LARGE(result)
Expand Down
1 change: 1 addition & 0 deletions code/modules/goonchat/browserassets/css/browserOutput.css
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ h1.alert, h2.alert {color: #a4bad6;}
.notice {color: #6685f5;}
.alium {color: #00ff00;}
.cult {color: #aa1c1c;}
.legion {color: #e09000; font-weight: bold; font-family: 'Courier New', Courier, monospace}

/* Languages */
.alien {color: #855d85;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ h1.alert, h2.alert {color: #000080;}
.notice {color: #000099;}
.alium {color: #00ff00;}
.cult {color: #800080; font-weight: bold; font-style: italic;}
.legion {color: #e09000; font-weight: bold; font-family: 'Courier New', Courier, monospace}

/* Languages */
.alien {color: #855d85;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ h1.alert, h2.alert {color: #000080;}
.notice {color: #000099;}
.alium {color: #00ff00;}
.cult {color: #800080; font-weight: bold; font-style: italic;}
.legion {color: #e09000; font-weight: bold; font-family: 'Courier New', Courier, monospace}


/* Languages */
Expand Down
1 change: 1 addition & 0 deletions code/stylesheet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ h1.alert, h2.alert {color: #000080;}
.cultannounce {color: #800080; font-style: italic; font-size: 175%;}
.mfauna {color: #884422; font-weight: bold; font-size: 125%;}
.antagdesc {color: #ff0033; font-size: 125%}
.legion {color: #e09000; font-weight: bold; font-family: 'Courier New', Courier, monospace}

.reflex_shoot {color: #000099; font-style: italic;}

Expand Down
4 changes: 4 additions & 0 deletions packs/legion/_pack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "hivebot.dm"
#include "mob.dm"
#include "structure.dm"
#include "legion_narrate.dm"
117 changes: 117 additions & 0 deletions packs/legion/hivebot.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// Hivebots renamed as legion scouts.

/// Boolean. Whether or not this hivebot has been integrated by the legion.
/mob/living/simple_animal/hostile/hivebot/var/is_legion = FALSE

/// The legion beacon this mob is linked to and spawned from.
/mob/living/simple_animal/hostile/hivebot/var/obj/structure/legion/beacon/linked_beacon = null

/// Upgrades the hivebot into a legion scout.
/mob/living/simple_animal/hostile/hivebot/proc/legionify(obj/structure/legion/beacon/beacon)
if (is_legion)
return
SetName("legion scout")
is_legion = TRUE
desc += " <span class='warning'>This one seems smarter and faster than usual...</span>"
faction = "legion"
speed = max(speed - 1, 1)
base_attack_cooldown = max(base_attack_cooldown - 1 SECOND, 1 SECOND)
can_escape = TRUE
melee_attack_delay = max(melee_attack_delay - 2, 0)
if (beacon)
linked_beacon = beacon


/mob/living/simple_animal/hostile/hivebot/Destroy()
if (linked_beacon)
linked_beacon.linked_mobs -= src
linked_beacon = null

. = ..()


/mob/living/simple_animal/hostile/hivebot/death()
if (!is_legion || !rand(0, 1))
..()
return

switch(rand(1, 2))
if (1) // Normal brain
var/obj/item/organ/internal/brain/brain = new(loc)
brain.SetName("[name]'s [initial(brain.name)]")
brain.die()

if (2) // Positronic
var/obj/item/organ/internal/posibrain/posibrain = new(loc)
posibrain.SetName("[name]'s [initial(posibrain.name)]")
posibrain.die()

..()


// Legion hivebot spawners
/obj/spawner/legion/hivebot
abstract_type = /obj/spawner/legion/hivebot
/// Type path. Base hivebot to spawn and upgrade.
var/mob/living/simple_animal/hostile/hivebot/base_hivebot


/obj/spawner/legion/hivebot/Initialize(mapload, ...)
. = ..()
base_hivebot = new base_hivebot(loc)
base_hivebot.legionify()
return INITIALIZE_HINT_QDEL


/obj/spawner/legion/hivebot/melee
base_hivebot = /mob/living/simple_animal/hostile/hivebot

/obj/spawner/legion/hivebot/melee_fast
base_hivebot = /mob/living/simple_animal/hostile/hivebot/rapid

/obj/spawner/legion/hivebot/melee_strong
base_hivebot = /mob/living/simple_animal/hostile/hivebot/strong

/obj/spawner/legion/hivebot/ranged_pistol
base_hivebot = /mob/living/simple_animal/hostile/hivebot/ranged_damage/basic

/obj/spawner/legion/hivebot/ranged_rifle
base_hivebot = /mob/living/simple_animal/hostile/hivebot/ranged_damage/rapid

/obj/spawner/legion/hivebot/ranged_laser
base_hivebot = /mob/living/simple_animal/hostile/hivebot/ranged_damage/laser

/obj/spawner/legion/hivebot/ranged_strong
base_hivebot = /mob/living/simple_animal/hostile/hivebot/ranged_damage/strong

/obj/spawner/legion/hivebot/ranged_fire
base_hivebot = /mob/living/simple_animal/hostile/hivebot/ranged_damage/dot


// Random legion hivebot spawner
/obj/random/legion/hivebot
abstract_type = /obj/random/legion/hivebot
icon = 'packs/legion/hivebot.dmi'
icon_state = "spawner"


/obj/random/legion/hivebot/any/spawn_choices()
return subtypesof(/obj/spawner/legion/hivebot)


/obj/random/legion/hivebot/melee/spawn_choices()
return list(
/obj/spawner/legion/hivebot/melee,
/obj/spawner/legion/hivebot/melee_fast,
/obj/spawner/legion/hivebot/melee_strong,
)


/obj/random/legion/hivebot/ranged/spawn_choices()
return list(
/obj/spawner/legion/hivebot/ranged_pistol,
/obj/spawner/legion/hivebot/ranged_rifle,
/obj/spawner/legion/hivebot/ranged_laser,
/obj/spawner/legion/hivebot/ranged_strong,
/obj/spawner/legion/hivebot/ranged_fire,
)
Binary file added packs/legion/hivebot.dmi
Binary file not shown.
Binary file added packs/legion/legion.dmi
Binary file not shown.
108 changes: 108 additions & 0 deletions packs/legion/legion_narrate.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
GLOBAL_LIST_INIT(legion_narrations, list(\
"A cacaphony of voices suddenly invades your mind. You can't make anything out.",\
"The voices. There's so many voices in your head. They're all crying out in endless agony.",\
"You hear a thousand voices all at once, each trying to scream over the rest. The sound drowns itself out.",\
"A tidal force of voices shakes your very being, each one shifting in volume and pitch to such degree that it's nothing but an overbearing white noise.",\
"A wave of voices coalesce and your ears ring as if struck by a hammer.",\
"A flood of voices crash against your head with their pleas, their cries and their dying breathes in never-ending throes of noise, sometimes they blend together into nothingness-- and then they come back, stronger and more desperate.",\
"A turgid symphony assaults your mind. Fleshy primordial noises are all you can make out. This place is where one abandons their dreams."\
))


GLOBAL_LIST_INIT(legion_last_words_generic, list(\
"I don't want to die!",\
"No, get away!",\
"I give up. Just do it already.",\
"I'm so scared..."\
))


GLOBAL_LIST_EMPTY(legion_last_words_player)


/**
* Adds a player's last words to the legion's pool. `origin` can be a living mob, a mind datum, or a brain.
*/
/proc/legion_add_voice(datum/origin)
var/origin_name
var/message

if (is_type_in_list(origin, list(/obj/item/organ/internal/brain, /obj/item/organ/internal/posibrain)))
var/obj/item/organ/internal/brain/brain = origin
if (!brain.brainmob?.mind)
return
origin = brain.brainmob.mind

if (isliving(origin))
var/mob/living/living = origin
if (!living.mind)
return
origin = living.mind

if (istype(origin, /datum/mind))
var/datum/mind/mind = origin
if (!mind.last_words)
return
origin_name = mind.name
message = mind.last_words

if (!origin_name || !message)
return

GLOB.legion_last_words_player[origin_name] = message
log_debug("Added [origin_name]'s last words of '[message]' to the legion message pool.")


/**
* Displays a randomly chosen legion message to synthetic mobs in z-levels connected to the given level(s)
*/
/proc/show_legion_messages(list/z_levels = list())
if (!islist(z_levels))
z_levels = list(z_levels)
if (!length(z_levels))
return

var/list/connected_z_levels = list()
for (var/z_level in z_levels)
if (z_level in connected_z_levels)
continue
connected_z_levels |= GetConnectedZlevels(z_level)

var/message
// Choose a message to display
if (rand(0, 100) <= 20)
if (!length(GLOB.legion_last_words_player) || rand(0, 1))
message = "A voice rises above the chorus, \"[pick(GLOB.legion_last_words_generic)]\""
else
var/message_origin = pick(GLOB.legion_last_words_player)
var/message_contents = GLOB.legion_last_words_player[message_origin]
message = "[message_origin]'s voice rises above the chorus, \"[message_contents]\""
else
message = pick(GLOB.legion_narrations)

var/count = 0
for (var/mob/player in GLOB.player_list)
if (!(get_z(player) in connected_z_levels))
continue
if (!player.isSynthetic() && !isobserver(player))
continue
to_chat(player, SPAN_LEGION(message))
count++

log_debug("Displayed legion message to [count] mob\s across [length(connected_z_levels)] z-level\s.")


/client/proc/cmd_admin_legion_narrate()
set category = "Special Verbs"
set name = "Legion Narrate"
set desc = "Manually triggers a legion narration on specific z-levels."

if(!check_rights(R_ADMIN))
return

var/z_level = input(usr, "Which z-level? Your own z-level is entered by default.", "Legion Narrate", get_z(usr)) as null | num
if (!z_level)
return

show_legion_messages(z_level)
log_and_message_staff(" - Manual Legion Narrate to z-levels connected to [z_level].")
54 changes: 54 additions & 0 deletions packs/legion/mob.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/mob/living/simple_animal/hostile/legion
name = "legion"
desc = "A primitive in appearance hovering robot, with some menacing looking blades jutting out from it. It bears no manufacturer markings of any kind. You feel some form of malicious intelligence behind its shell..."
icon = 'packs/legion/legion.dmi'
icon_state = "hivebot"
maxHealth = 15
bleed_colour = SYNTH_BLOOD_COLOUR
faction = "legion"

/// The legion beacon this mob is linked to and spawned from.
var/obj/structure/legion/beacon/linked_beacon = null


/mob/living/simple_animal/hostile/legion/Initialize(mapload, obj/structure/legion/beacon/spawner)
. = ..()

if (spawner)
linked_beacon = spawner

if (!mapload)
new /obj/explosion(loc)
playsound(src, 'sound/effects/EMPulse.ogg', 25, TRUE)
if (linked_beacon)
visible_message(SPAN_WARNING("\The [linked_beacon] warps \a [src] in!"))
else
visible_message(SPAN_WARNING("\A [src] warps in!"))


/mob/living/simple_animal/hostile/legion/Destroy()
if (linked_beacon)
linked_beacon.linked_mobs -= src
linked_beacon = null

return ..()


/mob/living/simple_animal/hostile/legion/get_bullet_impact_effect_type(def_zone)
return BULLET_IMPACT_METAL


/mob/living/simple_animal/hostile/legion/death(gibbed, deathmessage, show_dead_message)
..(FALSE, "blows apart!")
var/turf/turf = get_turf(src)
new /obj/gibspawner/robot(turf)
explosion(loc, 2, EX_ACT_LIGHT)
qdel_self()


/mob/living/simple_animal/hostile/legion/Process_Spacemove(allow_movement)
return !is_physically_disabled()


/mob/living/simple_animal/hostile/legion/AirflowCanMove(n)
return FALSE
Loading

0 comments on commit 2b338fe

Please sign in to comment.