Updates blob

Remains of player blob axed.
blob_act() axed. Blob now has an arbitary set of things it can attack.
It will flow over everything else. Blob has an awful tendency to destroy
non-craftables.
Will test more tomorrow.
Blob will now attack mechs.
Fixes #8106.
Fixes #10705.
This commit is contained in:
Kelenius
2015-10-05 18:10:16 +03:00
parent 8ce01aa648
commit 83adba88d4
77 changed files with 210 additions and 1456 deletions

206
code/modules/blob/blob.dm Normal file
View File

@@ -0,0 +1,206 @@
//I will need to recode parts of this but I am way too tired atm
/obj/effect/blob
name = "blob"
icon = 'icons/mob/blob.dmi'
icon_state = "blob"
light_range = 3
desc = "Some blob creature thingy"
density = 1
opacity = 0
anchored = 1
mouse_opacity = 2
var/maxHealth = 30
var/health
var/brute_resist = 4
var/fire_resist = 1
var/expandType = /obj/effect/blob
/obj/effect/blob/New(loc)
health = maxHealth
set_dir(pick(1,2,4,8))
update_icon()
return ..(loc)
/obj/effect/blob/CanPass(var/atom/movable/mover, vra/turf/target, var/height = 0, var/air_group = 0)
if(air_group || height == 0)
return 1
return 0
/obj/effect/blob/ex_act(var/severity)
switch(severity)
if(1)
take_damage(rand(100, 120) / brute_resist)
if(2)
take_damage(rand(60, 100) / brute_resist)
if(3)
take_damage(rand(20, 60) / brute_resist)
/obj/effect/blob/update_icon()
if(health > maxHealth / 2)
icon_state = "blob"
else
icon_state = "blob_damaged"
/obj/effect/blob/proc/take_damage(var/damage)
health -= damage
if(health < 0)
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
qdel(src)
else
update_icon()
/obj/effect/blob/proc/regen()
health = min(health + 1, maxHealth)
update_icon()
/obj/effect/blob/proc/expand(var/turf/T)
if(istype(T, /turf/unsimulated/) || istype(T, /turf/space))
return
if(istype(T, /turf/simulated/wall))
var/turf/simulated/wall/SW = T
SW.take_damage(80)
return
var/obj/structure/girder/G = locate() in T
if(G)
if(prob(40))
G.dismantle()
return
var/obj/structure/window/W = locate() in T
if(W)
W.shatter()
return
var/obj/structure/grille/GR = locate() in T
if(GR)
qdel(GR)
return
var/obj/machinery/door/D = locate() in T
if(D && D.density)
D.ex_act(2)
return
var/obj/structure/foamedmetal/F = locate() in T
if(F)
qdel(F)
return
var/obj/structure/inflatable/I = locate() in T
if(I)
I.deflate(1)
return
var/obj/vehicle/V = locate() in T
if(V)
V.ex_act(2)
return
var/obj/machinery/bot/B = locate() in T
if(B)
B.ex_act(2)
return
var/obj/mecha/M = locate() in T
if(M)
M.take_damage(40)
return
// Above things, we destroy completely and thus can use locate. Mobs are different.
for(var/mob/living/L in T)
if(L.stat == DEAD)
continue
L.visible_message("<span class='danger'>The blob attacks \the [L]!</span>", "<span class='danger'>The blob attacks you!</span>")
playsound(loc, 'sound/effects/attackblob.ogg', 50, 1)
L.take_organ_damage(rand(30, 40))
return
new expandType(T, min(health, 30))
/obj/effect/blob/proc/pulse(var/forceLeft, var/list/dirs)
regen()
sleep(5)
var/pushDir = pick(dirs)
var/turf/T = get_step(src, pushDir)
var/obj/effect/blob/B = (locate() in T)
if(!B)
if(prob(health))
expand(T)
return
B.pulse(forceLeft - 1, dirs)
/obj/effect/blob/bullet_act(var/obj/item/projectile/Proj)
if(!Proj)
return
switch(Proj.damage_type)
if(BRUTE)
take_damage(Proj.damage / brute_resist)
if(BURN)
take_damage(Proj.damage / fire_resist)
return 0
/obj/effect/blob/attackby(var/obj/item/weapon/W, var/mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
playsound(loc, 'sound/effects/attackblob.ogg', 50, 1)
visible_message("<span class='danger'>\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]</span>")
var/damage = 0
switch(W.damtype)
if("fire")
damage = (W.force / fire_resist)
if(istype(W, /obj/item/weapon/weldingtool))
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
if("brute")
damage = (W.force / brute_resist)
take_damage(damage)
return
/obj/effect/blob/core
name = "blob core"
icon = 'icons/mob/blob.dmi'
icon_state = "blob_core"
maxHealth = 200
brute_resist = 2
fire_resist = 2
expandType = /obj/effect/blob/shield
/obj/effect/blob/core/update_icon()
return
/obj/effect/blob/core/New(loc)
processing_objects.Add(src)
return ..(loc)
/obj/effect/blob/core/Destroy()
processing_objects.Remove(src)
return ..()
/obj/effect/blob/core/process()
pulse(20, list(NORTH, EAST))
pulse(20, list(NORTH, WEST))
pulse(20, list(SOUTH, EAST))
pulse(20, list(SOUTH, WEST))
/obj/effect/blob/shield
name = "strong blob"
icon = 'icons/mob/blob.dmi'
icon_state = "blob_idle"
desc = "Some blob creature thingy"
maxHealth = 60
brute_resist = 1
fire_resist = 2
/obj/effect/blob/shield/New()
..()
update_nearby_tiles()
/obj/effect/blob/shield/Destroy()
density = 0
update_nearby_tiles()
..()
/obj/effect/blob/shield/update_icon()
if(health > maxHealth * 2 / 3)
icon_state = "blob_idle"
else if(health > maxHealth / 3)
icon_state = "blob"
else
icon_state = "blob_damaged"
/obj/effect/blob/shield/CanPass(var/atom/movable/mover, var/turf/target, var/height = 0, var/air_group = 0)
return !density

View File

@@ -12,12 +12,13 @@
if(!T)
kill()
return
Blob = new /obj/effect/blob/core(T, 120)
Blob = new /obj/effect/blob/core(T)
for(var/i = 1; i < rand(3, 4), i++)
Blob.process()
/datum/event/blob/tick()
if(!Blob)
if(!Blob || !Blob.loc)
Blob = null
kill()
return
if(IsMultiple(activeFor, 3))

View File

@@ -163,11 +163,6 @@
emergencyShutdown()
..()
/obj/machinery/computer/HolodeckControl/blob_act()
emergencyShutdown()
..()
/obj/machinery/computer/HolodeckControl/power_change()
var/oldstat
..()

View File

@@ -1,253 +0,0 @@
/mob/living/blob
name = "blob fragment"
real_name = "blob fragment"
icon = 'icons/mob/blob.dmi'
icon_state = "blob_spore_temp"
pass_flags = PASSBLOB
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
var/ghost_name = "Unknown"
var/creating_blob = 0
faction = "blob"
use_me = 0 //Blobs can't emote
New()
real_name += " [pick(rand(1, 99))]"
name = real_name
..()
say(var/message)
return//No talking for you
emote(var/act,var/m_type=1,var/message = null)
return
Life()
set invisibility = 0
set background = 1
clamp_values()
UpdateDamage()
if(health < 0)
src.dust()
proc/clamp_values()
AdjustStunned(0)
AdjustParalysis(0)
AdjustWeakened(0)
sleeping = 0
if(stat)
stat = CONSCIOUS
return
proc/UpdateDamage()
health = 60 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
return
death(gibbed)
ghostize()
..(gibbed)
blob_act()
src << "The blob attempts to reabsorb you."
adjustToxLoss(20)
return
Process_Spacemove()
if(locate(/obj/effect/blob) in oview(1,src))
return 1
return (..())
/mob/living/blob/verb/create_node()
set category = "Blob"
set name = "Create Node"
set desc = "Create a Node."
if(creating_blob) return
var/turf/T = get_turf(src)
creating_blob = 1
if(!T)
creating_blob = 0
return
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
if(!B)//We are on a blob
usr << "There is no blob here!"
creating_blob = 0
return
if(istype(B,/obj/effect/blob/node)||istype(B,/obj/effect/blob/core)||istype(B,/obj/effect/blob/factory))
usr << "Unable to use this blob, find a normal one."
creating_blob = 0
return
for(var/obj/effect/blob/node/blob in orange(5))
usr << "There is another node nearby, move more than 5 tiles away from it!"
creating_blob = 0
return
for(var/obj/effect/blob/factory/blob in orange(2))
usr << "There is a porus blob nearby, move more than 2 tiles away from it!"
creating_blob = 0
B.change_to("Node")
src.dust()
return
/mob/living/blob/verb/create_factory()
set category = "Blob"
set name = "Create Defense"
set desc = "Create a Spore producing blob."
if(creating_blob) return
var/turf/T = get_turf(src)
creating_blob = 1
if(!T)
creating_blob = 0
return
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
if(!B)
usr << "You must be on a blob!"
creating_blob = 0
return
if(istype(B,/obj/effect/blob/node)||istype(B,/obj/effect/blob/core)||istype(B,/obj/effect/blob/factory))
usr << "Unable to use this blob, find a normal one."
creating_blob = 0
return
for(var/obj/effect/blob/blob in orange(2))//Not right next to nodes/cores
if(istype(B,/obj/effect/blob/node))
usr << "There is a node nearby, move away from it!"
creating_blob = 0
return
if(istype(B,/obj/effect/blob/core))
usr << "There is a core nearby, move away from it!"
creating_blob = 0
return
if(istype(B,/obj/effect/blob/factory))
usr << "There is another porous blob nearby, move away from it!"
creating_blob = 0
return
B.change_to("Factory")
src.dust()
return
/mob/living/blob/verb/revert()
set category = "Blob"
set name = "Purge Defense"
set desc = "Removes a porous blob."
if(creating_blob) return
var/turf/T = get_turf(src)
creating_blob = 1
if(!T)
creating_blob = 0
return
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
if(!B)
usr << "You must be on a blob!"
creating_blob = 0
return
if(!istype(B,/obj/effect/blob/factory))
usr << "Unable to use this blob, find another one."
creating_blob = 0
return
B.change_to("Normal")
src.dust()
return
/mob/living/blob/verb/spawn_blob()
set category = "Blob"
set name = "Create new blob"
set desc = "Attempts to create a new blob in this tile."
if(creating_blob) return
var/turf/T = get_turf(src)
creating_blob = 1
if(!T)
creating_blob = 0
return
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
if(B)
usr << "There is a blob here!"
creating_blob = 0
return
new/obj/effect/blob(src.loc)
src.dust()
return
///mob/proc/Blobize()
/client/proc/Blobcount()
set category = "Debug"
set name = "blobreport"
set desc = "blob report."
set hidden = 1
if(!holder)
src << "Only administrators may use this command."
return
if(ticker && ticker.mode)
src << "blobs: [blobs.len]"
src << "cores: [blob_cores.len]"
src << "nodes: [blob_nodes.len]"
return
/client/proc/Blobize()//Mostly stolen from the respawn command
set category = "Debug"
set name = "Ghostblob"
set desc = "Ghost into blobthing."
set hidden = 1
if(!holder)
src << "Only administrators may use this command."
return
var/input = input(src, "Please specify which key will be turned into a bloby.", "Key", "")
var/mob/dead/observer/G_found
if(!input)
var/list/ghosts = list()
for(var/mob/dead/observer/G in player_list)
ghosts += G
if(ghosts.len)
G_found = pick(ghosts)
else
for(var/mob/dead/observer/G in player_list)
if(G.client&&ckey(G.key)==ckey(input))
G_found = G
break
if(!G_found)//If a ghost was not found.
alert("There is no active key like that in the game or the person is not currently a ghost. Aborting command.")
return
if(G_found.client)
G_found.client.screen.len = null
var/mob/living/blob/B = new/mob/living/blob(locate(0,0,1))//temp area also just in case should do this better but tired
if(blob_cores.len > 0)
var/obj/effect/blob/core/core = pick(blob_cores)
if(core)
B.loc = core.loc
B.ghost_name = G_found.real_name
if (G_found.client)
G_found.client.mob = B
B.verbs += /mob/living/blob/verb/create_node
B.verbs += /mob/living/blob/verb/create_factory
B << "<B>You are now a blob fragment.</B>"
B << "You are a weak bit that has temporarily broken off of the blob."
B << "If you stay on the blob for too long you will likely be reabsorbed."
B << "If you stray from the blob you will likely be killed by other organisms."
B << "You have the power to create a new blob node that will help expand the blob."
B << "To create this node you will have to be on a normal blob tile and far enough away from any other node."
B << "Check your Blob verbs and hit Create Node to build a node."
spawn(10)
qdel(G_found)

View File

@@ -31,26 +31,3 @@
adjustFireLoss(f_loss)
updatehealth()
/mob/living/carbon/alien/blob_act()
if (stat == 2)
return
var/shielded = 0
var/damage = null
if (stat != 2)
damage = rand(10,30)
if(shielded)
damage /= 4
//paralysis += 1
show_message("\red The blob attacks you!")
adjustFireLoss(damage)
updatehealth()
return

View File

@@ -168,15 +168,6 @@
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if(update) UpdateDamageIcon()
/mob/living/carbon/human/blob_act()
if(stat == 2) return
show_message("\red The blob attacks you!")
var/dam_zone = pick(organs_by_name)
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
apply_damage(rand(30,40), BRUTE, affecting, run_armor_check(affecting, "melee"))
return
/mob/living/carbon/human/proc/implant_loyalty(mob/living/carbon/human/M, override = FALSE) // Won't override by default.
if(!config.use_loyalty_implants && !override) return // Nuh-uh.

View File

@@ -194,26 +194,6 @@
updatehealth()
/mob/living/carbon/slime/blob_act()
if (stat == 2)
return
var/shielded = 0
var/damage = null
if (stat != 2)
damage = rand(10,30)
if(shielded)
damage /= 4
show_message("<span class='danger'> The blob attacks you!</span>")
adjustFireLoss(damage)
updatehealth()
return
/mob/living/carbon/slime/u_equip(obj/item/W as obj)
return

View File

@@ -119,13 +119,6 @@
return -1
return 0
/mob/living/silicon/pai/blob_act()
if (src.stat != 2)
src.adjustBruteLoss(60)
src.updatehealth()
return 1
return 0
/mob/living/silicon/pai/restrained()
if(istype(src.loc,/obj/item/device/paicard))
return 0

View File

@@ -97,13 +97,6 @@
/mob/living/silicon/IsAdvancedToolUser()
return 1
/mob/living/silicon/blob_act()
if (src.stat != 2)
src.adjustBruteLoss(60)
src.updatehealth()
return 1
return 0
/mob/living/silicon/bullet_act(var/obj/item/projectile/Proj)
if(!Proj.nodamage)

View File

@@ -146,15 +146,6 @@
toner = 0
return
/obj/machinery/photocopier/blob_act()
if(prob(50))
qdel(src)
else
if(toner > 0)
new /obj/effect/decal/cleanable/blood/oil(get_turf(src))
toner = 0
return
/obj/machinery/photocopier/proc/copy(var/obj/item/weapon/paper/copy)
var/obj/item/weapon/paper/c = new /obj/item/weapon/paper (loc)
if(toner > 10) //lots of toner, make it dark

View File

@@ -101,19 +101,6 @@
return 0
/obj/machinery/power/am_control_unit/blob_act()
stability -= 20
if(prob(100-stability))//Might infect the rest of the machine
for(var/obj/machinery/am_shielding/AMS in linked_shielding)
AMS.blob_act()
spawn(0)
//Likely explode
qdel(src)
return
check_stability()
return
/obj/machinery/power/am_control_unit/ex_act(severity)
switch(severity)
if(1.0)

View File

@@ -90,20 +90,6 @@ proc/cardinalrange(var/center)
return 0
/obj/machinery/am_shielding/blob_act()
stability -= 20
if(prob(100-stability))
if(prob(10))//Might create a node
new /obj/effect/blob/node(src.loc,150)
else
new /obj/effect/blob(src.loc,60)
spawn(0)
qdel(src)
return
check_stability()
return
/obj/machinery/am_shielding/ex_act(severity)
switch(severity)
if(1.0)

View File

@@ -1178,12 +1178,6 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on)
cell.ex_act(3.0)
return
/obj/machinery/power/apc/blob_act()
if (prob(75))
set_broken()
if (cell && prob(5))
cell.blob_act()
/obj/machinery/power/apc/disconnect_terminal()
if(terminal)
terminal.master = null

View File

@@ -161,10 +161,6 @@
corrupt()
return
/obj/item/weapon/cell/blob_act()
if(prob(75))
explode()
/obj/item/weapon/cell/proc/get_electrocute_damage()
switch (charge)
/* if (9000 to INFINITY)

View File

@@ -548,10 +548,6 @@
//blob effect
/obj/machinery/light/blob_act()
if(prob(75))
broken()
// timed process
// use power

View File

@@ -30,10 +30,6 @@
return 1
/obj/machinery/containment_field/blob_act()
return 0
/obj/machinery/containment_field/ex_act(severity)
return 0

View File

@@ -159,13 +159,6 @@ field_generator power level display
/obj/machinery/field_generator/emp_act()
return 0
/obj/machinery/field_generator/blob_act()
if(active)
return 0
else
..()
/obj/machinery/field_generator/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj, /obj/item/projectile/beam))
power += Proj.damage * EMITTER_DAMAGE_POWER_TRANSFER

View File

@@ -157,12 +157,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
else
return
/obj/structure/particle_accelerator/blob_act()
if(prob(50))
qdel(src)
return
/obj/structure/particle_accelerator/update_icon()
switch(construction_state)
if(0,1)
@@ -339,12 +333,6 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
return
/obj/machinery/particle_accelerator/blob_act()
if(prob(50))
qdel(src)
return
/obj/machinery/particle_accelerator/proc/update_state()
return 0

View File

@@ -53,9 +53,6 @@
consume(user)
return 1
/obj/singularity/blob_act(severity)
return
/obj/singularity/ex_act(severity)
if(current_size == STAGE_SUPER)//IT'S UNSTOPPABLE
return

View File

@@ -80,12 +80,6 @@ var/list/solars_list = list()
..()
/obj/machinery/power/solar/blob_act()
src.health--
src.healthcheck()
return
/obj/machinery/power/solar/proc/healthcheck()
if (src.health <= 0)
if(!(stat & BROKEN))
@@ -172,12 +166,6 @@ var/list/solars_list = list()
return
/obj/machinery/power/solar/blob_act()
if(prob(75))
broken()
src.density = 0
/obj/machinery/power/solar/fake/New(var/turf/loc, var/obj/item/solar_assembly/S)
..(loc, S, 0)
@@ -539,12 +527,6 @@ var/list/solars_list = list()
broken()
return
/obj/machinery/power/solar_control/blob_act()
if (prob(75))
broken()
src.density = 0
// Used for mapping in solar array which automatically starts itself (telecomms, for example)
/obj/machinery/power/solar_control/autostart
track = 2 // Auto tracking mode

View File

@@ -44,10 +44,6 @@
qdel(src)
return
/obj/machinery/chem_master/blob_act()
if (prob(50))
qdel(src)
/obj/machinery/chem_master/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob)
if(istype(B, /obj/item/weapon/reagent_containers/glass))

View File

@@ -59,11 +59,6 @@
else
return
blob_act()
if(prob(50))
new /obj/effect/effect/water(src.loc)
qdel(src)
@@ -154,9 +149,6 @@
if(!istype(Proj ,/obj/item/projectile/beam/lastertag) && !istype(Proj ,/obj/item/projectile/beam/practice) )
explode()
/obj/structure/reagent_dispensers/fueltank/blob_act()
explode()
/obj/structure/reagent_dispensers/fueltank/ex_act()
explode()
@@ -223,10 +215,6 @@
..()
reagents.add_reagent("beer",1000)
/obj/structure/reagent_dispensers/beerkeg/blob_act()
explosion(src.loc,0,3,5,7,10)
qdel(src)
/obj/structure/reagent_dispensers/virusfood
name = "Virus Food Dispenser"
desc = "A dispenser of virus food."

View File

@@ -79,10 +79,6 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
else
icon_state = "circuit_imprinter"
/obj/machinery/r_n_d/circuit_imprinter/blob_act()
if(prob(50))
qdel(src)
/obj/machinery/r_n_d/circuit_imprinter/proc/TotalMaterials()
var/t = 0
for(var/f in materials)

View File

@@ -79,10 +79,6 @@
griefProtection()
..()
/obj/machinery/r_n_d/server/blob_act()
griefProtection()
..()
//Backup files to centcomm to help admins recover data after greifer attacks
/obj/machinery/r_n_d/server/proc/griefProtection()
for(var/obj/machinery/r_n_d/server/centcom/C in machines)

View File

@@ -13,9 +13,6 @@
if(!istype(Proj ,/obj/item/projectile/beam/lastertag) && !istype(Proj ,/obj/item/projectile/beam/practice) )
explode()
/obj/structure/reagent_dispensers/coolanttank/blob_act()
explode()
/obj/structure/reagent_dispensers/coolanttank/ex_act()
explode()

View File

@@ -87,9 +87,6 @@
if(prob(50))
qdel(src)
/obj/machinery/shield/blob_act()
qdel(src)
/obj/machinery/shield/hitby(AM as mob|obj)
//Let everyone know we've been hit!

View File

@@ -116,11 +116,6 @@
..()
healthcheck()
/obj/vehicle/blob_act()
src.health -= rand(20,40)*fire_dam_coeff
healthcheck()
return
/obj/vehicle/ex_act(severity)
switch(severity)
if(1.0)