81 lines
2.6 KiB
Plaintext
81 lines
2.6 KiB
Plaintext
/obj/structure/blob/core
|
|
name = "blob core"
|
|
icon = 'icons/mob/blob.dmi'
|
|
icon_state = "blank_blob"
|
|
desc = "A huge, pulsating yellow mass."
|
|
max_integrity = 400
|
|
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 75, acid = 90)
|
|
explosion_block = 6
|
|
point_return = -1
|
|
health_regen = 0 //we regen in Life() instead of when pulsed
|
|
var/core_regen = 2
|
|
var/resource_delay = 0
|
|
var/point_rate = 2
|
|
|
|
|
|
/obj/structure/blob/core/Initialize(mapload, client/new_overmind = null, new_rate = 2, placed = 0)
|
|
GLOB.blob_cores += src
|
|
START_PROCESSING(SSobj, src)
|
|
GLOB.poi_list |= src
|
|
update_icon() //so it atleast appears
|
|
if(!placed && !overmind)
|
|
return INITIALIZE_HINT_QDEL
|
|
if(overmind)
|
|
update_icon()
|
|
point_rate = new_rate
|
|
addtimer(CALLBACK(src, .proc/generate_announcement), 1800)
|
|
. = ..()
|
|
|
|
/obj/structure/blob/core/proc/generate_announcement()
|
|
priority_announce("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/ai/outbreak5.ogg')
|
|
|
|
/obj/structure/blob/core/scannerreport()
|
|
return "Directs the blob's expansion, gradually expands, and sustains nearby blob spores and blobbernauts."
|
|
|
|
/obj/structure/blob/core/update_icon()
|
|
cut_overlays()
|
|
color = null
|
|
var/mutable_appearance/blob_overlay = mutable_appearance('icons/mob/blob.dmi', "blob")
|
|
if(overmind)
|
|
blob_overlay.color = overmind.blob_reagent_datum.color
|
|
add_overlay(blob_overlay)
|
|
add_overlay(mutable_appearance('icons/mob/blob.dmi', "blob_core_overlay"))
|
|
|
|
/obj/structure/blob/core/Destroy()
|
|
GLOB.blob_cores -= src
|
|
if(overmind)
|
|
overmind.blob_core = null
|
|
overmind = null
|
|
STOP_PROCESSING(SSobj, src)
|
|
GLOB.poi_list -= src
|
|
return ..()
|
|
|
|
/obj/structure/blob/core/ex_act(severity, target)
|
|
var/damage = 50 - 10 * severity //remember, the core takes half brute damage, so this is 20/15/10 damage based on severity
|
|
take_damage(damage, BRUTE, "bomb", 0)
|
|
|
|
/obj/structure/blob/core/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir, overmind_reagent_trigger = 1)
|
|
. = ..()
|
|
if(obj_integrity > 0)
|
|
if(overmind) //we should have an overmind, but...
|
|
overmind.update_health_hud()
|
|
|
|
/obj/structure/blob/core/Life()
|
|
if(QDELETED(src))
|
|
return
|
|
if(!overmind)
|
|
qdel(src)
|
|
else
|
|
if(resource_delay <= world.time)
|
|
resource_delay = world.time + 10 // 1 second
|
|
overmind.add_points(point_rate)
|
|
obj_integrity = min(max_integrity, obj_integrity+core_regen)
|
|
if(overmind)
|
|
overmind.update_health_hud()
|
|
Pulse_Area(overmind, 12, 4, 3)
|
|
for(var/obj/structure/blob/normal/B in range(1, src))
|
|
if(prob(5))
|
|
B.change_to(/obj/structure/blob/shield/core, overmind)
|
|
..()
|
|
|