mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-24 09:14:17 +00:00
Roundstart blob removal attempt 3 (#20403)
This commit is contained in:
144
code/modules/events/blob/blob_structures/blob_core.dm
Normal file
144
code/modules/events/blob/blob_structures/blob_core.dm
Normal file
@@ -0,0 +1,144 @@
|
||||
/obj/structure/blob/core
|
||||
name = "blob core"
|
||||
icon = 'icons/mob/blob.dmi'
|
||||
icon_state = "blank_blob"
|
||||
max_integrity = 400
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 75, ACID = 90)
|
||||
fire_resist = 2
|
||||
point_return = -1
|
||||
var/overmind_get_delay = 0 // we don't want to constantly try to find an overmind, do it every 5 minutes
|
||||
var/resource_delay = 0
|
||||
var/point_rate = 2
|
||||
var/is_offspring = null
|
||||
var/selecting = 0
|
||||
|
||||
/obj/structure/blob/core/Initialize(mapload, client/new_overmind = null, new_rate = 2, offspring)
|
||||
. = ..()
|
||||
GLOB.blob_cores += src
|
||||
START_PROCESSING(SSobj, src)
|
||||
GLOB.poi_list |= src
|
||||
adjustcolors(color) //so it atleast appears
|
||||
if(offspring)
|
||||
is_offspring = TRUE
|
||||
if(overmind)
|
||||
adjustcolors(overmind.blob_reagent_datum.color)
|
||||
if(!overmind)
|
||||
create_overmind(new_overmind)
|
||||
point_rate = new_rate
|
||||
|
||||
|
||||
/obj/structure/blob/core/adjustcolors(a_color)
|
||||
overlays.Cut()
|
||||
color = null
|
||||
var/image/I = new('icons/mob/blob.dmi', "blob")
|
||||
I.color = a_color
|
||||
overlays += I
|
||||
var/image/C = new('icons/mob/blob.dmi', "blob_core_overlay")
|
||||
overlays += C
|
||||
|
||||
|
||||
/obj/structure/blob/core/Destroy()
|
||||
GLOB.blob_cores -= src
|
||||
if(overmind)
|
||||
overmind.blob_core = null
|
||||
overmind = null
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
GLOB.poi_list.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/blob/core/ex_act(severity)
|
||||
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/RegenHealth()
|
||||
return // Don't regen, we handle it in Life()
|
||||
|
||||
/obj/structure/blob/core/Life(seconds, times_fired)
|
||||
if(!overmind)
|
||||
create_overmind()
|
||||
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 + 1)
|
||||
if(overmind)
|
||||
overmind.update_health_hud()
|
||||
if(overmind)
|
||||
for(var/i = 1; i < 8; i += i)
|
||||
Pulse(0, i, overmind.blob_reagent_datum.color)
|
||||
else
|
||||
for(var/i = 1; i < 8; i += i)
|
||||
Pulse(0, i, color)
|
||||
for(var/b_dir in GLOB.alldirs)
|
||||
if(!prob(5))
|
||||
continue
|
||||
var/obj/structure/blob/normal/B = locate() in get_step(src, b_dir)
|
||||
if(B)
|
||||
B.change_to(/obj/structure/blob/shield/core)
|
||||
if(B && overmind)
|
||||
B.color = overmind.blob_reagent_datum.color
|
||||
else
|
||||
B.color = color
|
||||
color = null
|
||||
..()
|
||||
|
||||
|
||||
/obj/structure/blob/core/proc/create_overmind(client/new_overmind, override_delay)
|
||||
if(overmind_get_delay > world.time && !override_delay)
|
||||
return
|
||||
|
||||
overmind_get_delay = world.time + 5 MINUTES
|
||||
|
||||
if(overmind)
|
||||
qdel(overmind)
|
||||
|
||||
INVOKE_ASYNC(src, PROC_REF(get_new_overmind), new_overmind)
|
||||
|
||||
/obj/structure/blob/core/proc/get_new_overmind(client/new_overmind)
|
||||
var/mob/C = null
|
||||
var/list/candidates = list()
|
||||
if(!new_overmind)
|
||||
// sendit
|
||||
if(is_offspring)
|
||||
candidates = SSghost_spawns.poll_candidates("Do you want to play as a blob offspring?", ROLE_BLOB, TRUE, 10 SECONDS, source = src)
|
||||
else
|
||||
candidates = SSghost_spawns.poll_candidates("Do you want to play as a blob?", ROLE_BLOB, TRUE, 10 SECONDS, source = src)
|
||||
|
||||
if(length(candidates))
|
||||
C = pick(candidates)
|
||||
else
|
||||
C = new_overmind
|
||||
|
||||
if(C && !QDELETED(src))
|
||||
var/mob/camera/blob/B = new(loc)
|
||||
B.is_offspring = is_offspring
|
||||
B.key = C.key
|
||||
B.blob_core = src
|
||||
overmind = B
|
||||
color = overmind.blob_reagent_datum.color
|
||||
if(B.mind && !B.mind.special_role)
|
||||
B.mind.make_Overmind()
|
||||
|
||||
/obj/structure/blob/core/proc/lateblobtimer()
|
||||
addtimer(CALLBACK(src, PROC_REF(lateblobcheck)), 50)
|
||||
|
||||
/obj/structure/blob/core/proc/lateblobcheck()
|
||||
if(overmind)
|
||||
overmind.add_points(60)
|
||||
if(overmind.mind)
|
||||
overmind.mind.make_Overmind()
|
||||
else
|
||||
log_debug("/obj/structure/blob/core/proc/lateblobcheck: Blob core lacks a overmind.mind.")
|
||||
else
|
||||
log_debug("/obj/structure/blob/core/proc/lateblobcheck: Blob core lacks an overmind.")
|
||||
|
||||
/obj/structure/blob/core/onTransitZ(old_z, new_z)
|
||||
if(overmind && is_station_level(new_z))
|
||||
overmind.forceMove(get_turf(src))
|
||||
return ..()
|
||||
28
code/modules/events/blob/blob_structures/captured_nuke.dm
Normal file
28
code/modules/events/blob/blob_structures/captured_nuke.dm
Normal file
@@ -0,0 +1,28 @@
|
||||
/obj/structure/blob/captured_nuke //alternative to blob just straight up destroying nukes
|
||||
name = "blob captured nuke"
|
||||
icon_state = "blob"
|
||||
desc = "A Nuclear Warhead tangled in blob tendrils pulsating with a horrific green glow."
|
||||
max_integrity = 100
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 65, ACID = 90)
|
||||
point_return = 0
|
||||
|
||||
/obj/structure/blob/captured_nuke/Initialize(mapload, obj/machinery/nuclearbomb/N)
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
N?.forceMove(src)
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/structure/blob/captured_nuke/update_overlays()
|
||||
. = ..()
|
||||
var/image/nuke_overlay = image('icons/mob/blob.dmi', "blob_nuke_overlay")
|
||||
nuke_overlay.appearance_flags = RESET_COLOR
|
||||
. += nuke_overlay
|
||||
|
||||
/obj/structure/blob/captured_nuke/Destroy()
|
||||
for(var/obj/machinery/nuclearbomb/O in contents)
|
||||
O.forceMove(loc)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/blob/captured_nuke/Life(seconds, times_fired)
|
||||
obj_integrity = min(max_integrity, obj_integrity + 1)
|
||||
27
code/modules/events/blob/blob_structures/factory.dm
Normal file
27
code/modules/events/blob/blob_structures/factory.dm
Normal file
@@ -0,0 +1,27 @@
|
||||
/obj/structure/blob/factory
|
||||
name = "factory blob"
|
||||
icon = 'icons/mob/blob.dmi'
|
||||
icon_state = "blob_factory"
|
||||
max_integrity = 200
|
||||
point_return = 18
|
||||
var/list/spores = list()
|
||||
var/max_spores = 3
|
||||
var/spore_delay = 0
|
||||
|
||||
/obj/structure/blob/factory/Destroy()
|
||||
for(var/mob/living/simple_animal/hostile/blob/blobspore/spore in spores)
|
||||
if(spore.factory == src)
|
||||
spore.factory = null
|
||||
spores = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/blob/factory/run_action()
|
||||
if(spores.len >= max_spores)
|
||||
return
|
||||
if(spore_delay > world.time)
|
||||
return
|
||||
flick("blob_factory_glow", src)
|
||||
spore_delay = world.time + 100 // 10 seconds
|
||||
var/mob/living/simple_animal/hostile/blob/blobspore/BS = new/mob/living/simple_animal/hostile/blob/blobspore(src.loc, src)
|
||||
if(overmind)
|
||||
overmind.add_mob_to_overmind(BS)
|
||||
36
code/modules/events/blob/blob_structures/node.dm
Normal file
36
code/modules/events/blob/blob_structures/node.dm
Normal file
@@ -0,0 +1,36 @@
|
||||
/obj/structure/blob/node
|
||||
name = "blob node"
|
||||
icon = 'icons/mob/blob.dmi'
|
||||
icon_state = "blank_blob"
|
||||
max_integrity = 200
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 65, ACID = 90)
|
||||
point_return = 18
|
||||
|
||||
/obj/structure/blob/node/Initialize(mapload)
|
||||
. = ..()
|
||||
GLOB.blob_nodes += src
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/structure/blob/node/adjustcolors(a_color)
|
||||
overlays.Cut()
|
||||
color = null
|
||||
var/image/I = new('icons/mob/blob.dmi', "blob")
|
||||
I.color = a_color
|
||||
src.overlays += I
|
||||
var/image/C = new('icons/mob/blob.dmi', "blob_node_overlay")
|
||||
src.overlays += C
|
||||
|
||||
/obj/structure/blob/node/Destroy()
|
||||
GLOB.blob_nodes -= src
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/blob/node/Life(seconds, times_fired)
|
||||
if(overmind)
|
||||
for(var/i = 1; i < 8; i += i)
|
||||
Pulse(5, i, overmind.blob_reagent_datum.color)
|
||||
else
|
||||
for(var/i = 1; i < 8; i += i)
|
||||
Pulse(5, i, color)
|
||||
obj_integrity = min(max_integrity, obj_integrity + 1)
|
||||
color = null
|
||||
15
code/modules/events/blob/blob_structures/resource.dm
Normal file
15
code/modules/events/blob/blob_structures/resource.dm
Normal file
@@ -0,0 +1,15 @@
|
||||
/obj/structure/blob/resource
|
||||
name = "resource blob"
|
||||
icon = 'icons/mob/blob.dmi'
|
||||
icon_state = "blob_resource"
|
||||
max_integrity = 60
|
||||
point_return = 12
|
||||
var/resource_delay = 0
|
||||
|
||||
/obj/structure/blob/resource/run_action()
|
||||
if(resource_delay > world.time)
|
||||
return
|
||||
flick("blob_resource_glow", src)
|
||||
resource_delay = world.time + 40 // 4 seconds
|
||||
if(overmind)
|
||||
overmind.add_points(1)
|
||||
76
code/modules/events/blob/blob_structures/shield.dm
Normal file
76
code/modules/events/blob/blob_structures/shield.dm
Normal file
@@ -0,0 +1,76 @@
|
||||
/obj/structure/blob/shield
|
||||
name = "strong blob"
|
||||
icon = 'icons/mob/blob.dmi'
|
||||
icon_state = "blob_shield"
|
||||
desc = "Some blob creature thingy"
|
||||
max_integrity = 150
|
||||
brute_resist = 0.25
|
||||
explosion_block = 3
|
||||
atmosblock = TRUE
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 90, ACID = 90)
|
||||
|
||||
/obj/structure/blob/shield/core
|
||||
point_return = 0
|
||||
|
||||
/obj/structure/blob/shield/check_integrity()
|
||||
var/old_compromised_integrity = compromised_integrity
|
||||
if(obj_integrity < max_integrity * 0.5)
|
||||
compromised_integrity = TRUE
|
||||
else
|
||||
compromised_integrity = FALSE
|
||||
if(old_compromised_integrity != compromised_integrity)
|
||||
update_state()
|
||||
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE)
|
||||
|
||||
/obj/structure/blob/shield/update_state()
|
||||
if(compromised_integrity)
|
||||
atmosblock = FALSE
|
||||
else
|
||||
atmosblock = TRUE
|
||||
air_update_turf(1)
|
||||
|
||||
/obj/structure/blob/shield/update_name()
|
||||
. = ..()
|
||||
if(compromised_integrity)
|
||||
name = "weakened [initial(name)]"
|
||||
else
|
||||
name = initial(name)
|
||||
|
||||
/obj/structure/blob/shield/update_desc()
|
||||
. = ..()
|
||||
if(compromised_integrity)
|
||||
desc = "A wall of twitching tendrils."
|
||||
else
|
||||
desc = initial(desc)
|
||||
|
||||
/obj/structure/blob/shield/update_icon_state()
|
||||
if(compromised_integrity)
|
||||
icon_state = "[initial(icon_state)]_damaged"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/structure/blob/shield/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(istype(mover) && mover.checkpass(PASSBLOB)) return 1
|
||||
return 0
|
||||
|
||||
/obj/structure/blob/shield/reflective
|
||||
name = "reflective blob"
|
||||
desc = "A solid wall of slightly twitching tendrils with a reflective glow."
|
||||
icon_state = "blob_glow"
|
||||
max_integrity = 100
|
||||
brute_resist = 0.5
|
||||
explosion_block = 2
|
||||
point_return = 9
|
||||
flags_2 = CHECK_RICOCHET_2
|
||||
|
||||
/obj/structure/blob/shield/reflective/handle_ricochet(obj/item/projectile/P)
|
||||
var/turf/p_turf = get_turf(P)
|
||||
var/face_direction = get_dir(src, p_turf)
|
||||
var/face_angle = dir2angle(face_direction)
|
||||
var/incidence_s = GET_ANGLE_OF_INCIDENCE(face_angle, (P.Angle + 180))
|
||||
if(abs(incidence_s) > 90 && abs(incidence_s) < 270)
|
||||
return FALSE
|
||||
var/new_angle_s = SIMPLIFY_DEGREES(face_angle + incidence_s)
|
||||
P.set_angle(new_angle_s)
|
||||
visible_message("<span class='warning'>[P] reflects off [src]!</span>")
|
||||
return TRUE
|
||||
16
code/modules/events/blob/blob_structures/storage_blob.dm
Normal file
16
code/modules/events/blob/blob_structures/storage_blob.dm
Normal file
@@ -0,0 +1,16 @@
|
||||
/obj/structure/blob/storage
|
||||
name = "storage blob"
|
||||
icon = 'icons/mob/blob.dmi'
|
||||
icon_state = "blob_resource"
|
||||
max_integrity = 30
|
||||
fire_resist = 2
|
||||
point_return = 12
|
||||
|
||||
/obj/structure/blob/storage/obj_destruction(damage_flag)
|
||||
if(overmind)
|
||||
overmind.max_blob_points -= 50
|
||||
..()
|
||||
|
||||
/obj/structure/blob/storage/proc/update_max_blob_points(new_point_increase)
|
||||
if(overmind)
|
||||
overmind.max_blob_points += new_point_increase
|
||||
Reference in New Issue
Block a user