mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
54 lines
1.8 KiB
Plaintext
54 lines
1.8 KiB
Plaintext
/datum/event/rogue_drone
|
|
startWhen = 10
|
|
endWhen = 1000
|
|
var/list/drones_list = list()
|
|
|
|
/datum/event/rogue_drone/start()
|
|
//spawn them at the same place as carp
|
|
var/list/possible_spawns = list()
|
|
for(var/obj/effect/landmark/C in landmarks_list)
|
|
if(C.name == "carpspawn")
|
|
possible_spawns.Add(C)
|
|
|
|
//25% chance for this to be a false alarm
|
|
var/num
|
|
if(prob(25))
|
|
num = 0
|
|
else
|
|
num = rand(2,6)
|
|
for(var/i=0, i<num, i++)
|
|
var/mob/living/simple_animal/hostile/retaliate/malf_drone/D = new(get_turf(pick(possible_spawns)))
|
|
drones_list.Add(D)
|
|
if(prob(25))
|
|
D.disabled = rand(15, 60)
|
|
|
|
/datum/event/rogue_drone/announce()
|
|
var/msg
|
|
if(prob(33))
|
|
msg = "A combat drone wing operating out of the NMV Icarus has failed to return from a sweep of this sector, if any are sighted approach with caution."
|
|
else if(prob(50))
|
|
msg = "Contact has been lost with a combat drone wing operating out of the NMV Icarus. If any are sighted in the area, approach with caution."
|
|
else
|
|
msg = "Unidentified hackers have targetted a combat drone wing deployed from the NMV Icarus. If any are sighted in the area, approach with caution."
|
|
command_alert(msg, "Rogue drone alert")
|
|
|
|
/datum/event/rogue_drone/tick()
|
|
return
|
|
|
|
/datum/event/rogue_drone/end()
|
|
var/num_recovered = 0
|
|
for(var/mob/living/simple_animal/hostile/retaliate/malf_drone/D in drones_list)
|
|
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
|
|
sparks.set_up(3, 0, D.loc)
|
|
sparks.start()
|
|
D.z = 2
|
|
D.has_loot = 0
|
|
|
|
del(D)
|
|
num_recovered++
|
|
|
|
if(num_recovered > drones_list.len * 0.75)
|
|
command_alert("Icarus drone control reports the malfunctioning wing has been recovered safely.", "Rogue drone alert")
|
|
else
|
|
command_alert("Icarus drone control registers disappointment at the loss of the drones, but the survivors have been recovered.", "Rogue drone alert")
|