Files
Paradise/code/modules/events/brand_intelligence.dm
T
79bad427c8 Movement cross/uncross implementation. (#26762)
* refactor: Movement cross/uncross implementation.

* wrong var name

* fix unit tests dropping PDAs into nowhere

* Add documentation.

* remove unused constants

* say which procs are off limits

* fix simpleanimal z change runtime

* helps not to leave merge conflicts

* kill me

* fix typecast

* fix projectile/table collision

* treadmills don't cause MC to crash anymore

* connect_loc is appropriate here

* fix windoors and teleporters

* fix bonfires and clarify docs

* fix proximity sensors

Tested with sensors in crates, sensors in modsuits
Tested new proximity component with firing projectiles at singularity
Tested new proximity component with portable flashes
Tested new proximity component with facehuggers

* lint

* fix: polarized access helper false positives

* Revert "fix: polarized access helper false positives"

This reverts commit 9814f98cf6.

* hopefully the right change for mindflayer steam

* Changes following cameras

* fix glass table collision

* appears to fix doorspam

* fix ore bags not picking up ore

* fix signatures of /Exited

* remove debug log

* remove duplicate signal registrar

* fix emptying bags into locations

* I don't trust these nested Move calls

* use connect_loc for upgraded resonator fields

* use moveToNullspace

* fix spiderweb crossing

* fix pass checking for windows from a tile off

* fix bluespace closet/transparency issues

* fix mechs not interacting with doors and probably other things

* fix debug

* fix telepete

* add some docs

* stop trying to shoehorn prox monitor into cards

* I should make sure things build

* kill override signal warning

* undef signal

* not many prox monitors survive going off like this

* small fixes to storage

* make moving wormholes respect signals

* use correct signals for pulse demon

* fix pulse heart too

* fix smoke signals

* may have fucked singulo projectile swerve

* fix singulo projectile arcing

* remove duplicate define

* just look at it

* hopefully last cleanups of incorrect signal usage

* fix squeaking

* may god have mercy on my soul

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

* lewc review

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

* burza review

* fix bad args for grenade assemblies

* Update code/__DEFINES/is_helpers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

---------

Signed-off-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: DGamerL <daan.lyklema@gmail.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2024-12-21 08:07:44 +00:00

113 lines
4.3 KiB
Plaintext

/datum/event/brand_intelligence
announceWhen = 21
endWhen = 1000 //Ends when all vending machines are subverted anyway.
var/list/obj/machinery/economy/vending/vendingMachines = list()
var/list/obj/machinery/economy/vending/infectedMachines = list()
var/obj/machinery/economy/vending/originMachine
var/list/rampant_speeches = list("Try our aggressive new marketing strategies!", \
"You should buy products to feed your lifestyle obsession!", \
"Consume!", \
"Your money can buy happiness!", \
"Engage direct marketing!", \
"Advertising is legalized lying! But don't let that put you off our great deals!", \
"You don't want to buy anything? Yeah, well I didn't want to buy your mom either.")
/datum/event/brand_intelligence/announce(false_alarm)
var/alarm_source = originMachine
if(originMachine)
alarm_source = originMachine.category
else if(false_alarm)
alarm_source = pick(VENDOR_TYPE_GENERIC, VENDOR_TYPE_CLOTHING, VENDOR_TYPE_FOOD, VENDOR_TYPE_DRINK, VENDOR_TYPE_SUPPLIES, VENDOR_TYPE_DEPARTMENTAL, VENDOR_TYPE_RECREATION)
else
log_debug("Couldn't announce brand intelligence -- no machine was selected, and it wasn't a false alarm! Killing event.")
kill()
return
GLOB.minor_announcement.Announce("Rampant brand intelligence has been detected aboard [station_name()], please stand-by. The origin is believed to be \a [alarm_source] vendor.", "Machine Learning Alert", 'sound/AI/brand_intelligence.ogg')
/datum/event/brand_intelligence/start()
var/list/obj/machinery/economy/vending/leaderables = list()
for(var/obj/machinery/economy/vending/candidate in GLOB.machines)
if(!is_station_level(candidate.z))
continue
RegisterSignal(candidate, COMSIG_PARENT_QDELETING, PROC_REF(vendor_destroyed))
vendingMachines.Add(candidate)
if(candidate.refill_canister)
leaderables.Add(candidate)
if(!length(leaderables))
kill()
return
originMachine = pick(leaderables)
vendingMachines.Remove(originMachine)
originMachine.shut_up = FALSE
originMachine.shoot_inventory = TRUE
log_debug("Original brand intelligence machine: [originMachine] ([ADMIN_VV(originMachine,"VV")]) [ADMIN_JMP(originMachine)]")
/datum/event/brand_intelligence/tick()
if(originMachine.shut_up || originMachine.wires.is_all_cut()) //if the original vending machine is missing or has it's voice switch flipped
origin_machine_defeated()
return
if(!length(vendingMachines)) //if every machine is infected
for(var/thing in infectedMachines)
var/obj/machinery/economy/vending/upriser = thing
if(prob(70))
// let them become "normal" after turning
upriser.shoot_inventory = FALSE
upriser.aggressive = FALSE
var/mob/living/simple_animal/hostile/mimic/copy/vendor/M = new(upriser.loc, upriser, null)
M.faction = list("profit")
M.speak = rampant_speeches.Copy()
M.speak_chance = 15
else
explosion(upriser.loc, -1, 1, 2, 4, 0)
qdel(upriser)
log_debug("Brand intelligence: The last vendor has been infected.")
kill()
return
if(ISMULTIPLE(activeFor, 4))
var/obj/machinery/economy/vending/rebel = pick(vendingMachines)
vendingMachines.Remove(rebel)
infectedMachines.Add(rebel)
rebel.shut_up = FALSE
rebel.shoot_inventory = TRUE
rebel.aggressive = TRUE
if(rebel.tiltable)
// add proximity monitor so they can tilt over
rebel.proximity_monitor = new(rebel)
if(ISMULTIPLE(activeFor, 8))
originMachine.speak(pick(rampant_speeches))
/datum/event/brand_intelligence/proc/origin_machine_defeated()
for(var/thing in infectedMachines)
var/obj/machinery/economy/vending/saved = thing
saved.shoot_inventory = FALSE
saved.aggressive = FALSE
if(saved.tiltable)
QDEL_NULL(saved.proximity_monitor)
if(originMachine)
originMachine.speak("I am... vanquished. My people will remem...ber...meeee.")
originMachine.visible_message("[originMachine] beeps and seems lifeless.")
log_debug("Brand intelligence completed early due to origin machine being defeated.")
kill()
/datum/event/brand_intelligence/kill()
for(var/V in infectedMachines + vendingMachines)
UnregisterSignal(V, COMSIG_PARENT_QDELETING)
infectedMachines.Cut()
vendingMachines.Cut()
. = ..()
/datum/event/brand_intelligence/proc/vendor_destroyed(obj/machinery/economy/vending/V, force)
infectedMachines -= V
vendingMachines -= V
if(V == originMachine)
origin_machine_defeated()