Files
Paradise/code/__HELPERS/flock_helpers.dm
24845b238a The Divine Flock - DaedalusDock Flockmind Port (#31984)
* Initial commit - FLOCKMIND - Probably has like a billion things to fix

* Do after conversions

* Config

* Moved the files, icon fixes

* Tick everything, language work, event, spawn landmark, role prefs, beginning mob port

* Spans and some other fixes. Also the tickening

* More tickening

* More fixes. Lots of fixes.

* More Fixes

* A whole lot more. Also flock TGUI.

* Fixes fixes fixes fixes fixes

* FIXES

* More fixes - PR ready, still needs a fuckton of testing

* Fixes

* fix incomplete upstream merge

* fix FlockPanel + sort button name

* TGUI review

* Fixes tealprint list

* Fixes

* More fixes

* Incapacitator Fix

* Filenames

* Linters

* Interceptor range buff

* Reagent counts

* Linters

* Fabricator vendor fix

* Keybinds and HUD - Flockdrones, Fixes Vendor Conversion, Cube Materials

* Reworks reagent, adds flock grilles, fixes compute node overlays

* Intent-based flockdrone parts

* Intent based drone parts

* Radial control panel for controlling drones manually, phasing through windows/grilles

* Movement fixes

* Radio talk power, stare fix

* Flock health HUD

* Fixes flock lights, linters

* Unit tests

* Adds countdown to relay

* Relay improvements

* Small fix

* Logic Schmogic

* Relay overlay and looping sound effect

* Ignore air when converting turfs

* Cage fixes and improvements

* Improved flock bolt

* Turret conversions

* Flock bolts taze simple or basic mobs

* Sentience type

* Fixe

* Linter

* tgui review stage 2

* Concentrated Repair Burst

* Improves radio detection

* Removes extra space

* Adds healing visual effect

* Cube tech levels

* Ghooost

* Excess

* Flock doors, chairs, lattices. Centralizes conversion code.  Crafting with Gnesis

* Update code/modules/antagonists/flockmind/ai_behaviors/flock_wander.dm

Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

* Fixes the fix

* Astar movement detection

* Fix, extraneous code, language stuff

* Language fixes and wander fix

* Fixes

* Another fix

* Lints

* Another linter

* Language improvement

* More language improvements

* Time requirement and appearing in orbit menu as an antag

* Cube glow

* TGUI

* Minicache

* Linters

* Grammar

* Material ID fix

* Lid fix

* Reagent turf reaction

* Reagent fix

* Butcher results

* Conversion rates

* Flock stare fix

* Fixes stare behavior

* Staring

* Flock mob blood

* Flock mobs gibs and blood. Also some runtime fixes

* Flock mobs now resist out of grabs, buckles, lockers, and more

* Fixes flock orbit, fixes a runtime I think,

* Target mechs, damage mechs, other bug fixes

* Cage fix

* Cage resist change

* Some mind changes, gatecrash buff

* Drones now shoot mechs, stare improvement

* Cut down on spam a little

* Nest fix

* No more resist spam

* Fixed drone death control

* Resist statement

* Makes the relay alarm scarier

* Fixes dead flock camera mobs having no ghost sprite, something with ghosting

* Enhanced flockphasing

* Improved flockmob pathing

* Added required turf restriction to relay

* Increased needed bandwidth for relay construction

* Nerfed drone substrate rate

* Added new status tab items for relay progress

* Another relay cost adjustment

* Improves drone AI responsiveness

* Computer frames now become flock computers

* Improves target finding for conversion, building, and replicating

* Reduced flock event pop requirements

* Adjusts flock protection on structures. Adjusts overlays.

* Relay unlock tweak

* Fixwes flock being able to gib mech'd AIs with one button

* Map conflict

* Flock can no longer be outed by merely existing

* Fied bug causing drones to shoot themselves

* Prevents mobs from attacking while in a cage

* Converter tool can now open closets and crates.

* Adds descriptions to flockdrone tools.

* More informatic blurbs

* Adds xenobiology organs

* Organ lint

* TGUI merge

* bundle and mm

---------

Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Co-authored-by: Toastical <20125180+Toastical@users.noreply.github.com>
Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2026-07-08 21:31:28 +00:00

119 lines
3.8 KiB
Plaintext

/// A copy of is_blocked_turf(), ignoring flock mobs
/turf/proc/can_flock_occupy(atom/source_atom)
if(density)
return FALSE
for(var/atom/movable/movable_content as anything in contents)
// We don't want to block ourselves or consider any ignored atoms.
if((movable_content == source_atom) || isflockmob(movable_content))
continue
// If the thing is dense AND we're including mobs or the thing isn't a mob AND if there's a source atom and
// it cannot pass through the thing on the turf, we consider the turf blocked.
if(movable_content.density)
if(source_atom && movable_content.CanPass(source_atom, get_dir(src, source_atom)))
continue
return FALSE
return TRUE
/proc/pointer_image_to(atom/from, atom/towards, color = "#00ff9dff")
var/image/pointer = image(icon = 'icons/mob/screen_gen.dmi', icon_state = "arrow_greyscale", loc = from)
pointer.plane = HUD_PLANE
pointer.appearance_flags |= RESET_COLOR
pointer.color = color
var/angle = 180 + get_angle(from, towards)
var/matrix/final_matrix = pointer.transform.Scale(2,2)
final_matrix = final_matrix.Turn(angle)
pointer.transform = final_matrix
pointer.pixel_x = sin(angle) * -48
pointer.pixel_y = cos(angle) * -48
return pointer
/proc/flock_realname(flock_type)
var/attempts = 0
var/name = ""
do
attempts++
switch(flock_type)
if(FLOCK_TYPE_OVERMIND)
name = "\proper[pick(GLOB.consonants_lower)][pick(GLOB.vowels_lower)].[pick(GLOB.consonants_lower)][pick(GLOB.vowels_lower)]"
if(FLOCK_TYPE_TRACE)
name = "[pick(GLOB.consonants_upper)][pick(GLOB.vowels_lower)].[pick(GLOB.vowels_lower)]"
if(FLOCK_TYPE_DRONE)
name = "\proper[pick(GLOB.consonants_lower)][pick(GLOB.vowels_lower)].[pick(GLOB.consonants_lower)][pick(GLOB.vowels_lower)].[pick(GLOB.consonants_lower)][pick(GLOB.vowels_lower)]"
if(FLOCK_TYPE_BIT)
name = "[pick(GLOB.consonants_upper)].[rand(10,99)].[rand(10,99)]"
while(attempts <= 10 && findname(name))
return name
/proc/flock_name(flock_type)
var/attempts = 0
var/name = ""
do
attempts++
switch(flock_type)
if(FLOCK_TYPE_DRONE)
name = "[pick(GLOB.flockdrone_name_adjectives)] [pick(GLOB.flockdrone_name_nouns)]"
if(FLOCK_TYPE_BIT)
name = "[pick(GLOB.consonants_upper)].[rand(10,99)].[rand(10,99)]"
while(attempts <= 10 && findname(name))
return name
/proc/animate_flockpass(atom/thing)
var/list/color_matrix = list(1,0,0, 0,1,0, 0,0,1, 0.15,0.77,0.66)
var/matrix/shrink = thing.transform.Scale(0.4)
var/old_transform = thing.transform
animate(thing, color = color_matrix, transform = shrink, time = 3, easing=BOUNCE_EASING)
animate(color = null, transform = old_transform, time = 3, easing=BOUNCE_EASING)
/// Make a color a repeating gradient between two colors. Note: This is inaccurate because its a linear transformation, but human eyes do not perceive color this way.
/proc/gradient_text(message, color_1, color_2)
var/list/color_list_1 = rgb2num(color_1)
var/list/color_list_2 = rgb2num(color_2)
var/r1 = color_list_1[1]
var/g1 = color_list_1[2]
var/b1 = color_list_1[3]
// The difference in value between each color part
var/delta_r = color_list_2[1] - r1
var/delta_g = color_list_2[2] - g1
var/delta_b = color_list_2[3] - b1
var/list/result = list()
// Start at a random point between the two, in increments of 0.1
var/coeff = rand(0,10) / 10.0
var/dir = prob(50) ? -1 : 1
for(var/i in 1 to length(message) step 3)
coeff += dir * 0.2
// 20% chance to start going in the opposite direction
if(prob(20))
dir = -dir
// Wrap back around
if(coeff < 0)
coeff = 0
dir = 1
else if(coeff > 1)
coeff = 1
dir = -1
var/col = rgb(r1 + delta_r*coeff, g1 + delta_g*coeff, b1 + delta_b*coeff)
var/chars = copytext(message, i, i + 3)
result += "<span style='color:[col]'>[chars]</span>"
. = jointext(result, "")