Files
Bubberstation/code/game/gamemodes/blob/theblob.dm
Giacomand 6b39c6b1f9 Blob revamp!
Re-introduced the concept of a player controlling the blob in an RTS fashion, expanding the blob and building structures such as nodes and factories.

All blobs will try to find ghosts, with the BE_ALIEN flag, to be the blob overmind. Even random event blobs will try to get players to play as the overmind.

Added a /mob/camera that is now being used by the AI eye and the blob overmind. It is a mob that isn't dead but acts as a camera for the player, to be controlled by something like the AI or the blob.

There are now a resource currency for the blob to spend it's points on blob expansion and upgrades.

Added a small blob_act to mechs.

Made all camera mobs max invisibility. Because of this I removed the AI best friend button as it would be not working.

Blob mode will send a normal intercept report.
2013-07-06 21:19:33 +01:00

162 lines
3.5 KiB
Plaintext

//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'
luminosity = 3
desc = "Some blob creature thingy"
density = 1
opacity = 0
anchored = 1
var/active = 1
var/health = 30
var/brute_resist = 4
var/fire_resist = 1
New(loc)
blobs += src
src.dir = pick(1, 2, 4, 8)
src.update_icon()
..(loc)
return
Del()
blobs -= src
..()
return
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover) && mover.checkpass(PASSBLOB)) return 1
return 0
process()
Life()
return
proc/Life()
return
proc/Pulse(var/pulse = 0, var/origin_dir = 0)//Todo: Fix spaceblob expand
set background = 1
if(run_action())//If we can do something here then we dont need to pulse more
return
if(pulse > 30)
return//Inf loop check
//Looking for another blob to pulse
var/list/dirs = list(1,2,4,8)
dirs.Remove(origin_dir)//Dont pulse the guy who pulsed us
for(var/i = 1 to 4)
if(!dirs.len) break
var/dirn = pick(dirs)
dirs.Remove(dirn)
var/turf/T = get_step(src, dirn)
var/obj/effect/blob/B = (locate(/obj/effect/blob) in T)
if(!B)
expand(T)//No blob here so try and expand
return
B.Pulse((pulse+1),get_dir(src.loc,T))
return
return
proc/run_action()
return 0
proc/expand(var/turf/T = null)
if(!prob(health)) return
if(!T)
var/list/dirs = list(1,2,4,8)
for(var/i = 1 to 4)
var/dirn = pick(dirs)
dirs.Remove(dirn)
T = get_step(src, dirn)
if(!(locate(/obj/effect/blob) in T)) break
else T = null
if(!T) return 0
var/obj/effect/blob/normal/B = new /obj/effect/blob/normal(src.loc, min(src.health, 30))
if(T.Enter(B,src))//Attempt to move into the tile
B.loc = T
else
T.blob_act()//If we cant move in hit the turf
del(B)
for(var/atom/A in T)//Hit everything in the turf
A.blob_act()
return 1
ex_act(severity)
var/damage = 50
switch(severity)
if(1)
src.health -= rand(100,120)
if(2)
src.health -= rand(60,100)
if(3)
src.health -= rand(20,60)
health -= (damage/brute_resist)
update_icon()
return
update_icon()//Needs to be updated with the types
if(health <= 0)
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
del(src)
return
if(health <= 15)
icon_state = "blob_damaged"
return
// if(health <= 20)
// icon_state = "blob_damaged2"
// return
bullet_act(var/obj/item/projectile/Proj)
..()
switch(Proj.damage_type)
if(BRUTE)
health -= (Proj.damage/brute_resist)
if(BURN)
health -= (Proj.damage/fire_resist)
update_icon()
return 0
attackby(var/obj/item/weapon/W, var/mob/user)
playsound(src.loc, 'sound/effects/attackblob.ogg', 50, 1)
src.visible_message("\red <B>The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]")
var/damage = 0
switch(W.damtype)
if("fire")
damage = (W.force / max(src.fire_resist,1))
if(istype(W, /obj/item/weapon/weldingtool))
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
if("brute")
damage = (W.force / max(src.brute_resist,1))
health -= damage
update_icon()
return
proc/change_to(var/type)
if(!ispath(type))
error("[type] is an invalid type for the blob.")
new type(src.loc)
del(src)
return
/obj/effect/blob/normal
icon_state = "blob"