BLOB BUFFS

This commit is contained in:
vuonojenmustaturska
2019-05-30 19:35:16 +03:00
parent f66769a113
commit 8f9686d77d
4 changed files with 44 additions and 20 deletions

View File

@@ -93,8 +93,8 @@
/obj/screen/blob/ReadaptStrain
icon_state = "ui_chemswap"
name = "Readapt Chemical (40)"
desc = "Randomly rerolls your chemical for 40 resources."
name = "Readapt Strain (40)"
desc = "Allows you to choose a new strain from 4 random choices for 40 resources."
/obj/screen/blob/ReadaptStrain/MouseEntered(location,control,params)
if(hud && hud.mymob && isovermind(hud.mymob))

View File

@@ -22,6 +22,19 @@ GLOBAL_LIST_INIT(valid_blobstrains, subtypesof(/datum/blobstrain) - list(/datum/
stack_trace("blobstrain created without overmind")
overmind = new_overmind
/datum/blobstrain/proc/on_gain()
overmind.color = complementary_color
for(var/BL in GLOB.blobs)
var/obj/structure/blob/B = BL
B.update_icon()
for(var/BLO in overmind.blob_mobs)
var/mob/living/simple_animal/hostile/blob/BM = BLO
BM.update_icons() //If it's getting a new strain, tell it what it does!
to_chat(BM, "Your overmind's blob strain is now: <b><font color=\"[color]\">[name]</b></font>!")
to_chat(BM, "The <b><font color=\"[color]\">[name]</b></font> strain [shortdesc ? "[shortdesc]" : "[description]"]")
/datum/blobstrain/proc/on_lose()
/datum/blobstrain/proc/on_sporedeath(mob/living/spore)
/datum/blobstrain/proc/send_message(mob/living/M)

View File

@@ -50,7 +50,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
real_name = new_name
last_attack = world.time
var/datum/blobstrain/BS = pick(GLOB.valid_blobstrains)
blobstrain = new BS(src)
set_strain(BS)
color = blobstrain.complementary_color
if(blob_core)
blob_core.update_icon()
@@ -70,6 +70,22 @@ GLOBAL_LIST_EMPTY(blob_nodes)
CRASH("No blobspawnpoints and blob spawned in nullspace.")
forceMove(T)
/mob/camera/blob/proc/set_strain(datum/blobstrain/new_strain)
if (ispath(new_strain))
var/hadstrain = FALSE
if (istype(blobstrain))
blobstrain.on_lose()
qdel(blobstrain)
hadstrain = TRUE
blobstrain = new new_strain(src)
blobstrain.on_gain()
if (hadstrain)
to_chat(src, "Your strain is now: <b><font color=\"[blobstrain.color]\">[blobstrain.name]</b></font>!")
to_chat(src, "The <b><font color=\"[blobstrain.color]\">[blobstrain.name]</b></font> strain [blobstrain.description]")
if(blobstrain.effectdesc)
to_chat(src, "The <b><font color=\"[blobstrain.color]\">[blobstrain.name]</b></font> strain [blobstrain.effectdesc]")
/mob/camera/blob/proc/is_valid_turf(turf/T)
var/area/A = get_area(T)
if((A && !A.blob_allowed) || !T || !is_station_level(T.z) || isspaceturf(T))

View File

@@ -341,27 +341,22 @@
set name = "Reactive Strain Adaptation (40)"
set desc = "Replaces your strain with a random, different one."
if(free_strain_rerolls || can_buy(40))
set_strain()
reroll_strain()
if(free_strain_rerolls)
free_strain_rerolls--
last_reroll_time = world.time
/mob/camera/blob/proc/set_strain()
var/datum/blobstrain/bs = pick((GLOB.valid_blobstrains - blobstrain.type))
blobstrain = new bs(src)
color = blobstrain.complementary_color
for(var/BL in GLOB.blobs)
var/obj/structure/blob/B = BL
B.update_icon()
for(var/BLO in blob_mobs)
var/mob/living/simple_animal/hostile/blob/BM = BLO
BM.update_icons() //If it's getting a new strain, tell it what it does!
to_chat(BM, "Your overmind's blob strain is now: <b><font color=\"[blobstrain.color]\">[blobstrain.name]</b></font>!")
to_chat(BM, "The <b><font color=\"[blobstrain.color]\">[blobstrain.name]</b></font> strain [blobstrain.shortdesc ? "[blobstrain.shortdesc]" : "[blobstrain.description]"]")
to_chat(src, "Your strain is now: <b><font color=\"[blobstrain.color]\">[blobstrain.name]</b></font>!")
to_chat(src, "The <b><font color=\"[blobstrain.color]\">[blobstrain.name]</b></font> strain [blobstrain.description]")
if(blobstrain.effectdesc)
to_chat(src, "The <b><font color=\"[blobstrain.color]\">[blobstrain.name]</b></font> strain [blobstrain.effectdesc]")
/mob/camera/blob/proc/reroll_strain()
var/list/choices = list()
while (length(choices) < 4)
var/datum/blobstrain/bs = pick((GLOB.valid_blobstrains))
choices[initial(bs.name)] = bs
var/choice = input(usr, "Please choose a new strain","Strain") as anything in choices
if (choice && choices[choice] && !QDELETED(src))
var/datum/blobstrain/bs = choices[choice]
set_strain(bs)
/mob/camera/blob/verb/blob_help()
set category = "Blob"