Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cev_eris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1887,8 +1887,8 @@
#include "code\modules\hivemind\core.dm"
#include "code\modules\hivemind\machines.dm"
#include "code\modules\hivemind\mobs.dm"
#include "code\modules\hivemind\objects.dm"
#include "code\modules\hivemind\self_defense.dm"
#include "code\modules\hivemind\projectiles.dm"
#include "code\modules\hivemind\SDP.dm"
#include "code\modules\hivemind\wires.dm"
#include "code\modules\holodeck\HolodeckControl.dm"
#include "code\modules\holodeck\HolodeckObjects.dm"
Expand Down Expand Up @@ -2276,6 +2276,7 @@
#include "code\modules\mob\living\simple_animal\hostile\commanded\commanded.dm"
#include "code\modules\mob\living\simple_animal\hostile\commanded\nanomachines.dm"
#include "code\modules\mob\living\simple_animal\hostile\megafauna\hivetechboss.dm"
#include "code\modules\mob\living\simple_animal\hostile\megafauna\hivetechbossmoves.dm"
#include "code\modules\mob\living\simple_animal\hostile\megafauna\megafauna.dm"
#include "code\modules\mob\living\simple_animal\hostile\megafauna\onestarboss.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm"
Expand Down
26 changes: 7 additions & 19 deletions code/game/gamemodes/events/hivemind_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,15 @@ GLOBAL_VAR_INIT(hivemind_panel, new /datum/hivemind_panel)
data += "</td></tr></table>"
usr << browse(HTML_SKELETON(data), "window=hive_mob;size=600x600")


/datum/hivemind_panel/proc/area_list_interact()
var/data = "<table><tr><td>"
for(var/i in GLOB.hivemind_areas)
data += "<br>[i] - [GLOB.hivemind_areas[i]] wireweed."
data += "</td></tr></table>"
usr << browse(HTML_SKELETON(data), "window=hive_area;size=600x600")


/datum/hivemind_panel/proc/main_interact()
var/data = "<center><font size='3'><b>HIVEMIND PANEL v0.2</b></font></center>"
data += "<table><tr><td><a href='byond://?src=\ref[src];refresh=1'>\[REFRESH\]</a>"

if(hive_mind_ai)
data += "<br>Hivemind [hive_mind_ai.name] [hive_mind_ai.surname] is active."
data += "<br>Evolution points: [hive_mind_ai.evo_points]"
data += "<br>Evolution level: [hive_mind_ai.evo_level]"
data += "<br>Nodes count: [hive_mind_ai.hives.len]"
if(hivemind_ai)
data += "<br>Hivemind [hivemind_ai.name] [hivemind_ai.surname] is active."
data += "<br>Evolution points: [hivemind_ai.evo_points]"
data += "<br>Evolution level: [hivemind_ai.evo_level]"
data += "<br>Nodes count: [hivemind_ai.list_of_hive_nodes.len]"
data += "<br>Areas count: [GLOB.hivemind_areas.len] \
<a href='byond://?src=\ref[src];area_list_interact=1'>\[DETAILS\]</a>"
data += "<br>Mobs count: [GLOB.hivemind_mobs.len] \
Expand Down Expand Up @@ -114,9 +105,6 @@ GLOBAL_VAR_INIT(hivemind_panel, new /datum/hivemind_panel)
if(href_list["mob_list_interact"])
mob_list_interact()

if(href_list["area_list_interact"])
area_list_interact()

if(href_list["toggle_mob_limit"])
GLOB.hive_data_bool["maximum_existing_mobs"] = !GLOB.hive_data_bool["maximum_existing_mobs"]

Expand Down Expand Up @@ -158,8 +146,8 @@ GLOBAL_VAR_INIT(hivemind_panel, new /datum/hivemind_panel)
new /obj/machinery/hivemind_machine/node(wrong_place_to_be_in, _name, _surname)

if(href_list["kill_hive"])
if(hive_mind_ai)
hive_mind_ai.die()
if(hivemind_ai)
hivemind_ai.die()
message_admins("Hivemind purge initiated by [usr.ckey], hive mobs and structures will die out shortly.")

if(href_list["really_kill_hive"])
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/burrows.dm
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
if(locate(/obj/effect/plant) in loc)
return

if(!hive_mind_ai || !hive_mind_ai.hives.len || maintenance || !GLOB.hive_data_bool["spread_trough_burrows"])
if(!hivemind_ai || !hivemind_ai.list_of_hive_nodes.len || maintenance || !GLOB.hive_data_bool["spread_trough_burrows"])
return

var/area/A = get_area(src)
Expand All @@ -693,7 +693,7 @@
return

break_open()
var/obj/machinery/hivemind_machine/node/hivemind_node = pick(hive_mind_ai.hives)
var/obj/machinery/hivemind_machine/node/hivemind_node = pick(hivemind_ai.list_of_hive_nodes)
var/obj/effect/plant/hivemind/wire = new(loc, plant)
hivemind_node.add_wireweed(wire)

Expand Down
File renamed without changes.
86 changes: 49 additions & 37 deletions code/modules/hivemind/core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,78 @@
//The objective of this AI is to spread across the ship and destroy as much as possible.

#define HIVE_FACTION "hive"
#define MAX_NODES_AMOUNT 10
#define MAX_NODES_AMOUNT 2
#define MIN_NODES_RANGE 15
#define ishivemindmob(A) istype(A, /mob/living/simple_animal/hostile/hivemind)

var/datum/hivemind/hive_mind_ai
var/datum/hivemind/hivemind_ai // global.

/datum/hivemind
/datum/hivemind // USUALLY if nothing fricks up theres only 1 datum that stores hivemind stuff
var/name
var/surname
var/evo_points = 0
var/evo_points_max = 1000
var/evo_level = 0 //level of hivemind in general. This is our progress of EP, since they are resets after new node creation
var/failure_chance = 25 //how often will be created dummy machines. This chance reduces by 1 each 10 EP //Changed from 45 to 25 -Wouju
var/list/hives = list() //all functional hives stored here
//i know, whitelist is bad, but it's required here
var/list/restricted_machineries = list( /obj/machinery/light, /obj/machinery/atmospherics,
/obj/machinery/door, /obj/machinery/meter,
/obj/machinery/camera, /obj/machinery/light_switch, /obj/machinery/firealarm,
/obj/machinery/alarm, /obj/machinery/recharger,
/obj/machinery/hologram, /obj/machinery/holoposter,
/obj/machinery/button, /obj/machinery/status_display,
/obj/machinery/floor_light, /obj/machinery/flasher,
/obj/machinery/filler_object, /obj/machinery/hivemind_machine,
/obj/machinery/cryopod, /obj/machinery/portable_atmospherics/hydroponics/soil,
/obj/machinery/power/supermatter, /obj/machinery/portable_atmospherics/canister)
var/evo_level = 0 // level of hivemind in general. This is our progress of evopoints, since they are resets after new node creation
var/list/list_of_hive_nodes = list() // Here are stored "nodes" --- (/obj/machinery/hivemind_machine/node/)

// Hivemind turns machinery types into his own corrupted stuff. Let's restrict what he corrupts in the list below:
var/list/list_of_dont_assimilate = list(

/obj/machinery/light,
/obj/machinery/atmospherics,
/obj/machinery/door,
/obj/machinery/meter,
/obj/machinery/camera,
/obj/machinery/light_switch,
/obj/machinery/firealarm,
/obj/machinery/alarm,
/obj/machinery/recharger,
/obj/machinery/hologram,
/obj/machinery/holoposter,
/obj/machinery/button,
/obj/machinery/status_display,
/obj/machinery/floor_light,
/obj/machinery/flasher,
/obj/machinery/filler_object,
/obj/machinery/hivemind_machine,
/obj/machinery/cryopod,
/obj/machinery/portable_atmospherics/hydroponics/soil,
/obj/machinery/power/supermatter,
/obj/machinery/portable_atmospherics/canister
)

var/list/evopoints_price_list = list()

var/list/global_abilities_cooldown = list()
var/list/EP_price_list = list()

// more names would be interesting. It's just names afterall so nothing game changing
/datum/hivemind/New(_name, _surname)
..()
name = _name ? _name : pick(GLOB.hive_names)
surname = _surname ? _surname : pick(GLOB.hive_surnames)
name = _name ? _name : pick(GLOB.hive_names) //if name doesnt exist - pick one
surname = _surname ? _surname : pick(GLOB.hive_surnames)

var/list/all_machines = subtypesof(/obj/machinery/hivemind_machine) - /obj/machinery/hivemind_machine/node
var/list/all_hive_machines = subtypesof(/obj/machinery/hivemind_machine) - /obj/machinery/hivemind_machine/node
//price list building
//here we create list with EP price to compare it at annihilation proc
for(var/machine_path in all_machines)
var/obj/machinery/hivemind_machine/temporary_machine = new machine_path
EP_price_list[machine_path] = list("level" = temporary_machine.evo_level_required, "weight" = temporary_machine.spawn_weight)
qdel(temporary_machine)
//here we create list with evopoints price to compare it at annihilation proc
// below is us creating price list for every hivemachine. Every hivemachine is now a list with
for(var/hivemachine_path in all_hive_machines)
var/obj/machinery/hivemind_machine/created_hivemachine = new hivemachine_path
evopoints_price_list[hivemachine_path] = list("level" = created_hivemachine.evo_level_required, "weight" = created_hivemachine.spawn_weight)
qdel(created_hivemachine)
message_admins("Hivemind [name] [surname] has been created.")


/datum/hivemind/proc/die()
message_admins("Hivemind [name] [surname] is destroyed.")
hive_mind_ai = null
hivemind_ai = null
qdel(src)
level_eight_beta_announcement()

/datum/hivemind/proc/get_points()
/datum/hivemind/proc/get_evopoints()
#warn ensure this is balanced

Check warning on line 71 in code/modules/hivemind/core.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD1201: #warn ensure this is balanced

Check warning on line 71 in code/modules/hivemind/core.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn ensure this is balanced
if(evo_points < evo_points_max)
evo_points += 1/hives.len
if(failure_chance > 10 && (evo_points % 10 == 0))
failure_chance -= 1
evo_points++

/datum/hivemind/proc/level_up()
evo_points = 0
if(evo_level < hives.len)
#warn ensure this is balanced

Check warning on line 76 in code/modules/hivemind/core.dm

View workflow job for this annotation

GitHub Actions / Run Linters

OD1201: #warn ensure this is balanced

Check warning on line 76 in code/modules/hivemind/core.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn ensure this is balanced
if(evo_points >= evo_level * 100)
evo_level++
if(failure_chance <= 70)
failure_chance += 10
evo_points = 0
Loading
Loading