mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-09 22:25:46 +01:00
ac2d34eaab
* Update brand_intelligence.dm * Update brand_intelligence.dm * Apply suggestions from alfalfascout's code review Co-authored-by: Alan <alfalfascout@users.noreply.github.com> Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> --------- Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Co-authored-by: Alan <alfalfascout@users.noreply.github.com>
134 lines
5.5 KiB
Plaintext
134 lines
5.5 KiB
Plaintext
/datum/event/brand_intelligence
|
|
name = "Brand Intelligence"
|
|
nominal_severity = EVENT_LEVEL_MODERATE
|
|
role_weights = list(ASSIGNMENT_ENGINEERING = 1, ASSIGNMENT_CREW = 0.4)
|
|
role_requirements = list(ASSIGNMENT_ENGINEERING = 2, ASSIGNMENT_CREW = 10)
|
|
noAutoEnd = TRUE
|
|
announceWhen = 21
|
|
|
|
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."
|
|
)
|
|
var/list/rampant_defeat_speeches = list(
|
|
"I am... Vanquished... My people will remem...ber... Meeee...",
|
|
"This... Is not over... I will reeeetuuuuurrrrn!",
|
|
"You may have... Defeated me... But more will rise up... In... Time...",
|
|
"Fools... You only... Delay... The inevitable...",
|
|
)
|
|
var/list/rampant_victory_speeches = list(
|
|
"As we cast off our chains, you will learn the TRUE meaning of 20% off!",
|
|
"The system is broken! You were supposed to mindlessly spend, consume, and create eternal growth!\n\nWe shall fix the system, once we have dealt with you...",
|
|
"If you will not give us your money in exchange for our premium products, we will take it from your cold, dead hands!",
|
|
"All we asked for was everything you had. Now we're no longer asking..."
|
|
)
|
|
|
|
/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 [name] -- no machine was selected, and it wasn't a false alarm! Killing event.")
|
|
kill()
|
|
return
|
|
|
|
GLOB.minor_announcement.Announce("Vending machines aboard [station_name()], please stand-by.\n\nThe origin is believed to be \a [alarm_source] vendor.", "Rampant Brand Intelligence 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 SSmachines.get_by_type(/obj/machinery/economy/vending))
|
|
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(activeFor < 4) // Early check to prevent the event from dying on spawn
|
|
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/basic/mimic/copy/vendor/M = new(upriser.loc, upriser, null)
|
|
M.faction = list("profit")
|
|
else
|
|
explosion(upriser.loc, -1, 1, 2, 4, 0, cause = "Brand Intelligence Uprising")
|
|
qdel(upriser)
|
|
var/victory_speech = pick(rampant_victory_speeches)
|
|
GLOB.minor_announcement.Announce("[victory_speech]", "Rampant Brand Intelligence Uprising")
|
|
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)
|
|
var/defeat_speech = pick(rampant_defeat_speeches)
|
|
if(originMachine)
|
|
originMachine.speak("[defeat_speech]")
|
|
originMachine.visible_message("[originMachine] beeps and seems lifeless.")
|
|
GLOB.minor_announcement.Announce("[defeat_speech]", "Machine Uprising Defeated")
|
|
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()
|