forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Baystation12#34719 from SierraKomodo/THE-LEGION-CO…
…MMETH Add legionified hivebots and beacon
- Loading branch information
Showing
15 changed files
with
561 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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].") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.