Blob Mode Major Overhaul

This commit is contained in:
Fox-McCloud
2015-07-12 02:45:40 -04:00
parent 898bcea1e8
commit 04511d3f0b
26 changed files with 1125 additions and 684 deletions

View File

@@ -0,0 +1,175 @@
////////////////
// BASE TYPE //
////////////////
//Do not spawn
/mob/living/simple_animal/hostile/blob
icon = 'icons/mob/blob.dmi'
pass_flags = PASSBLOB
faction = list("blob")
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
maxbodytemp = 360
var/mob/camera/blob/overmind = null
/mob/living/simple_animal/hostile/blob/proc/adjustcolors(var/a_color)
if(a_color)
color = a_color
/mob/living/simple_animal/hostile/blob/blob_act()
return
////////////////
// BLOB SPORE //
////////////////
/mob/living/simple_animal/hostile/blob/blobspore
name = "blob"
desc = "Some blob thing."
icon_state = "blobpod"
icon_living = "blobpod"
health = 40
maxHealth = 40
melee_damage_lower = 2
melee_damage_upper = 4
attacktext = "hits"
attack_sound = 'sound/weapons/genhit1.ogg'
speak_emote = list("pulses")
var/obj/effect/blob/factory/factory = null
var/list/human_overlays = list()
var/is_zombie = 0
/mob/living/simple_animal/hostile/blob/blobspore/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
adjustBruteLoss(Clamp(0.01 * exposed_temperature, 1, 5))
/mob/living/simple_animal/hostile/blob/blobspore/CanPass(atom/movable/mover, turf/target, height=0)
if(istype(mover, /obj/effect/blob))
return 1
return ..()
/mob/living/simple_animal/hostile/blob/blobspore/New(loc, var/obj/effect/blob/factory/linked_node)
if(istype(linked_node))
factory = linked_node
factory.spores += src
..()
/mob/living/simple_animal/hostile/blob/blobspore/Life()
if(!is_zombie && isturf(src.loc))
for(var/mob/living/carbon/human/H in oview(src,1)) //Only for corpse right next to/on same tile
if(H.stat == DEAD)
Zombify(H)
break
..()
/mob/living/simple_animal/hostile/blob/blobspore/proc/Zombify(var/mob/living/carbon/human/H)
is_zombie = 1
if(H.wear_suit)
var/obj/item/clothing/suit/armor/A = H.wear_suit
if(A.armor && A.armor["melee"])
maxHealth += A.armor["melee"] //That zombie's got armor, I want armor!
maxHealth += 40
health = maxHealth
name = "blob zombie"
desc = "A shambling corpse animated by the blob."
melee_damage_lower = 10
melee_damage_upper = 15
icon = H.icon
speak_emote = list("groans")
icon_state = "zombie2_s"
H.h_style = null
H.update_hair()
human_overlays = H.overlays
update_icons()
H.loc = src
loc.visible_message("<span class='warning'>The corpse of [H.name] suddenly rises!</span>")
/mob/living/simple_animal/hostile/blob/blobspore/Die()
// On death, create a small smoke of harmful gas (s-Acid)
var/datum/effect/effect/system/chem_smoke_spread/S = new
var/turf/location = get_turf(src)
// Create the reagents to put into the air
create_reagents(25)
if(overmind && overmind.blob_reagent_datum)
reagents.add_reagent(overmind.blob_reagent_datum.id, 25)
else
reagents.add_reagent("spore", 25)
// Attach the smoke spreader and setup/start it.
S.attach(location)
S.set_up(reagents, 1, 1, location, 15, 1) // only 1-2 smoke cloud
S.start()
ghostize()
qdel(src)
/mob/living/simple_animal/hostile/blob/blobspore/Destroy()
if(factory)
factory.spores -= src
factory = null
if(contents)
for(var/mob/M in contents)
M.loc = src.loc
return ..()
/mob/living/simple_animal/hostile/blob/blobspore/update_icons()
..()
if(overmind && overmind.blob_reagent_datum)
adjustcolors(overmind.blob_reagent_datum.color)
else
adjustcolors(color) //to ensure zombie/other overlays update
/mob/living/simple_animal/hostile/blob/blobspore/adjustcolors(var/a_color)
color = a_color
if(is_zombie)
overlays.Cut()
overlays = human_overlays
var/image/I = image('icons/mob/blob.dmi', icon_state = "blob_head")
I.color = color
color = initial(color)//looks better.
overlays += I
/////////////////
// BLOBBERNAUT //
/////////////////
/mob/living/simple_animal/hostile/blob/blobbernaut
name = "blobbernaut"
desc = "Some HUGE blob thing."
icon_state = "blobbernaut"
icon_living = "blobbernaut"
icon_dead = "blobbernaut_dead"
health = 240
maxHealth = 240
melee_damage_lower = 20
melee_damage_upper = 20
attacktext = "hits"
attack_sound = 'sound/effects/blobattack.ogg'
speak_emote = list("gurgles")
minbodytemp = 0
maxbodytemp = 360
force_threshold = 10
environment_smash = 3
/mob/living/simple_animal/hostile/blob/blobbernaut/blob_act()
return
/mob/living/simple_animal/hostile/blob/blobbernaut/Die()
flick("blobbernaut_death", src)

View File

@@ -1,93 +1,116 @@
/obj/effect/blob/core
name = "blob core"
icon = 'icons/mob/blob.dmi'
icon_state = "blob_core"
icon_state = "blank_blob"
health = 200
fire_resist = 2
var/mob/camera/blob/overmind = null // the blob core's overmind
var/overmind_get_delay = 0 // we don't want to constantly try to find an overmind, do it every 30 seconds
var/resource_delay = 0
var/point_rate = 2
var/mob/camera/blob/creator = null
var/is_offspring = null
New(loc, var/h = 200, var/client/new_overmind = null, var/new_rate = 2, var/mob/camera/blob/C = null)
blob_cores += src
processing_objects.Add(src)
creator = C
if(!overmind)
create_overmind(new_overmind)
point_rate = new_rate
..(loc, h)
/obj/effect/blob/core/New(loc, var/h = 200, var/client/new_overmind = null, var/new_rate = 2, offspring)
blob_cores += src
processing_objects.Add(src)
adjustcolors(color) //so it atleast appears
if(!overmind)
create_overmind(new_overmind)
if(overmind)
adjustcolors(overmind.blob_reagent_datum.color)
if(offspring)
is_offspring = 1
point_rate = new_rate
..(loc, h)
Destroy()
blob_cores -= src
if(overmind)
qdel(overmind)
processing_objects.Remove(src)
return ..()
/obj/effect/blob/core/adjustcolors(var/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
update_icon()
if(health <= 0)
playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
Delete()
return
/obj/effect/blob/core/Destroy()
blob_cores -= src
if(overmind)
overmind.blob_core = null
overmind = null
processing_objects.Remove(src)
return ..()
/obj/effect/blob/core/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
/obj/effect/blob/core/update_icon()
if(health <= 0)
qdel(src)
return
// update_icon is called when health changes so... call update_health in the overmind
if(overmind)
overmind.update_health()
return
/obj/effect/blob/core/RegenHealth()
return // Don't regen, we handle it in Life()
/obj/effect/blob/core/Life()
if(!overmind)
create_overmind()
else
if(resource_delay <= world.time)
resource_delay = world.time + 10 // 1 second
overmind.add_points(point_rate)
health = min(initial(health), health + 1)
if(overmind)
overmind.update_health()
for(var/i = 1; i < 8; i += i)
Pulse(0, i, overmind.blob_reagent_datum.color)
for(var/b_dir in alldirs)
if(!prob(5))
continue
var/obj/effect/blob/normal/B = locate() in get_step(src, b_dir)
if(B)
B.change_to(/obj/effect/blob/shield)
B.color = overmind.blob_reagent_datum.color
color = null
..()
/obj/effect/blob/core/proc/create_overmind(var/client/new_overmind, var/override_delay)
if(overmind_get_delay > world.time && !override_delay)
return
Life()
if(!overmind)
create_overmind()
else
if(resource_delay <= world.time)
resource_delay = world.time + 10 // 1 second
overmind.add_points(point_rate)
health = min(initial(health), health + 1)
for(var/i = 1; i < 8; i += i)
Pulse(0, i)
for(var/b_dir in alldirs)
if(!prob(5))
continue
var/obj/effect/blob/normal/B = locate() in get_step(src, b_dir)
if(B)
B.change_to(/obj/effect/blob/shield)
..()
overmind_get_delay = world.time + 300 // 30 seconds
if(overmind)
qdel(overmind)
run_action()
return 0
var/client/C = null
var/list/candidates = list()
if(!new_overmind)
candidates = get_candidates(BE_BLOB)
if(candidates.len)
C = pick(candidates)
else
C = new_overmind
proc/create_overmind(var/client/new_overmind)
if(overmind_get_delay > world.time)
return
overmind_get_delay = world.time + 300 // 30 seconds
if(overmind)
qdel(overmind)
var/client/C = null
var/list/candidates = list()
if(!new_overmind)
candidates = get_candidates(BE_BLOB)
if(candidates.len)
C = pick(candidates)
else
C = new_overmind
if(C)
respawnable_list -= C
var/mob/camera/blob/B = new(src.loc)
B.key = C.key
B.blob_core = src
src.overmind = B
if(!B.blob_core.creator)
B.verbs += /mob/camera/blob/proc/create_core
if(istype(ticker.mode, /datum/game_mode/blob))
var/datum/game_mode/blob/mode = ticker.mode
mode.infected_crew += B.mind
return 1
return 0
if(C)
var/mob/camera/blob/B = new(src.loc)
B.key = C.key
B.blob_core = src
src.overmind = B
color = overmind.blob_reagent_datum.color
if(B.mind && !B.mind.special_role)
B.mind.special_role = "Blob Overmind"
spawn(0)
if(is_offspring)
B.verbs -= /mob/camera/blob/verb/split_consciousness
return 1
return 0

View File

@@ -7,123 +7,34 @@
var/list/spores = list()
var/max_spores = 3
var/spore_delay = 0
var/mob/camera/blob/overmind
update_icon()
if(health <= 0)
playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
Delete()
return
return
/obj/effect/blob/factory/update_icon()
if(health <= 0)
qdel(src)
run_action()
if(spores.len >= max_spores)
return 0
if(spore_delay > world.time)
return 0
spore_delay = world.time + 100 // 10 seconds
new/mob/living/simple_animal/hostile/blobspore(src.loc, src)
return 1
/mob/living/simple_animal/hostile/blobspore
name = "blob"
desc = "Some blob thing."
icon = 'icons/mob/blob.dmi'
icon_state = "blobpod"
icon_living = "blobpod"
pass_flags = PASSBLOB
health = 40
maxHealth = 40
melee_damage_lower = 2
melee_damage_upper = 4
attacktext = "hits"
attack_sound = 'sound/weapons/genhit1.ogg'
var/obj/effect/blob/factory/factory = null
var/is_zombie = 0
faction = list("blob")
min_oxy = 0
max_oxy = 0
min_tox = 0
max_tox = 0
min_co2 = 0
max_co2 = 0
min_n2 = 0
max_n2 = 0
minbodytemp = 0
maxbodytemp = 360
fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
adjustBruteLoss(Clamp(0.01 * exposed_temperature, 1, 5))
blob_act()
return
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover, /obj/effect/blob))
return 1
return ..()
New(loc, var/obj/effect/blob/factory/linked_node)
if(istype(linked_node))
factory = linked_node
factory.spores += src
..()
/mob/living/simple_animal/hostile/blobspore/Life()
if(!is_zombie && isturf(src.loc))
for(var/mob/living/carbon/human/H in oview(src,1)) //Only for corpse right next to/on same tile
if(H.stat == DEAD)
Zombify(H)
break
..()
/mob/living/simple_animal/hostile/blobspore/proc/Zombify(var/mob/living/carbon/human/H)
is_zombie = 1
if(H.wear_suit)
var/obj/item/clothing/suit/armor/A = H.wear_suit
if(A.armor && A.armor["melee"])
maxHealth += A.armor["melee"] //That zombie's got armor, I want armor!
maxHealth += 40
health = maxHealth
name = "blob zombie"
desc = "A shambling corpse animated by the blob."
melee_damage_lower = 10
melee_damage_upper = 15
icon = H.icon
speak_emote = list("groans")
icon_state = "zombie2_s"
H.h_style = null
H.update_hair()
overlays = H.overlays
overlays += image('icons/mob/blob.dmi', icon_state = "blob_head")
H.loc = src
loc.visible_message("<span class='warning'> The corpse of [H.name] suddenly rises!</span>")
/mob/living/simple_animal/hostile/blobspore/Die()
// On death, create a small smoke of harmful gas (s-Acid)
var/datum/effect/effect/system/chem_smoke_spread/S = new
var/turf/location = get_turf(src)
// Create the reagents to put into the air, s-acid is yellow and stings a little
create_reagents(25)
reagents.add_reagent("spores", 25)
// Attach the smoke spreader and setup/start it.
S.attach(location)
S.set_up(reagents, 1, 1, location, 15, 1) // only 1-2 smoke cloud
S.start()
qdel(src)
/mob/living/simple_animal/hostile/blobspore/Destroy()
if(factory)
factory.spores -= src
if(contents)
for(var/mob/M in contents)
M.loc = src.loc
/obj/effect/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/effect/blob/factory/PulseAnimation(var/activate = 0)
if(activate)
..()
return
/obj/effect/blob/factory/run_action()
if(spores.len >= max_spores)
return 0
if(spore_delay > world.time)
return 0
spore_delay = world.time + 100 // 10 seconds
PulseAnimation(1)
var/mob/living/simple_animal/hostile/blob/blobspore/BS = new/mob/living/simple_animal/hostile/blob/blobspore(src.loc, src)
BS.color = color
BS.overmind = overmind
overmind.blob_mobs.Add(BS)
return 0

View File

@@ -1,33 +1,41 @@
/obj/effect/blob/node
name = "blob node"
icon = 'icons/mob/blob.dmi'
icon_state = "blob_node"
icon_state = "blank_blob"
health = 100
fire_resist = 2
var/mob/camera/blob/overmind
/obj/effect/blob/node/New(loc, var/h = 100)
blob_nodes += src
processing_objects.Add(src)
..(loc, h)
New(loc, var/h = 100)
blob_nodes += src
processing_objects.Add(src)
..(loc, h)
/obj/effect/blob/node/adjustcolors(var/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
Destroy()
blob_nodes -= src
processing_objects.Remove(src)
return ..()
/obj/effect/blob/node/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
Life()
for(var/i = 1; i < 8; i += i)
Pulse(5, i)
health = min(initial(health), health + 1)
/obj/effect/blob/node/Destroy()
blob_nodes -= src
processing_objects.Remove(src)
return ..()
update_icon()
if(health <= 0)
playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
Delete()
return
/obj/effect/blob/node/Life()
for(var/i = 1; i < 8; i += i)
Pulse(5, i, overmind.blob_reagent_datum.color)
health = min(initial(health), health + 1)
color = null
/obj/effect/blob/node/update_icon()
if(health <= 0)
qdel(src)
return
run_action()
return 0
return

View File

@@ -7,20 +7,25 @@
var/mob/camera/blob/overmind = null
var/resource_delay = 0
update_icon()
if(health <= 0)
playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
Delete()
return
return
/obj/effect/blob/resource/update_icon()
if(health <= 0)
qdel(src)
run_action()
if(resource_delay > world.time)
return 0
/obj/effect/blob/resource/PulseAnimation(var/activate = 0)
if(activate)
..()
return
resource_delay = world.time + 40 // 4 seconds
/obj/effect/blob/resource/run_action()
if(overmind)
overmind.add_points(1)
return 1
if(resource_delay > world.time)
return 0
PulseAnimation(1)
resource_delay = world.time + 40 // 4 seconds
if(overmind)
overmind.add_points(1)
return 0

View File

@@ -3,18 +3,19 @@
icon = 'icons/mob/blob.dmi'
icon_state = "blob_idle"
desc = "Some blob creature thingy"
health = 60
brute_resist = 4
health = 75
fire_resist = 2
update_icon()
if(health <= 0)
playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
Delete()
return
/obj/effect/blob/shield/update_icon()
if(health <= 0)
qdel(src)
return
return
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover) && mover.checkpass(PASSBLOB)) return 1
return 0
/obj/effect/blob/shield/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
/obj/effect/blob/shield/CanPass(atom/movable/mover, turf/target, height=0)
if(istype(mover) && mover.checkpass(PASSBLOB)) return 1
return 0

View File

@@ -0,0 +1,21 @@
/obj/effect/blob/storage
name = "storage blob"
icon = 'icons/mob/blob.dmi'
icon_state = "blob_resource"
health = 30
fire_resist = 2
var/mob/camera/blob/overmind = null
/obj/effect/blob/storage/update_icon()
if(health <= 0)
overmind.max_blob_points -= 50
qdel(src)
/obj/effect/blob/storage/PulseAnimation(var/activate = 0)
if(activate)
..()
return
/obj/effect/blob/storage/proc/update_max_blob_points(var/new_point_increase)
if(overmind)
overmind.max_blob_points += new_point_increase