Skip to content

Commit

Permalink
bugfix/tweak: blob mode&event rework bugfixes and qol tweaks (#5458)
Browse files Browse the repository at this point in the history
* bugfix: fix blob mode rework bugs

* bugfix/tweak: blob mode&event rework bugfixes and qol tweaks

* borer inside blob_infected fix

* fix

* Text fix in code/modules/admin/verbs/one_click_antag.dm

Co-authored-by: Vladisvell <[email protected]>

* Text fix in code/datums/mind.dm

Co-authored-by: Vladisvell <[email protected]>

* Text fix in code/modules/admin/verbs/one_click_antag.dm

Co-authored-by: Vladisvell <[email protected]>

* blob talk folow+gt fix+some fixes

* add to gamemode fix+actions update fix

---------

Co-authored-by: Vladisvell <[email protected]>
  • Loading branch information
dageavtobusnick and Vladisvell authored Jul 15, 2024
1 parent 5aaabb3 commit 11ab4a8
Show file tree
Hide file tree
Showing 18 changed files with 195 additions and 102 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/blob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define TIME_TO_SWITCH_CODE 10 SECONDS
#define BURST_BLOB_TICK 1 SECONDS
#define BURST_MESSAGE_TICK 10 SECONDS
#define TIME_TO_ADD_OM_DATUM 3 SECONDS
#define TIME_TO_ADD_OM_DATUM 1 SECONDS
#define BLOB_BASE_TARGET_POINT 350
#define BLOB_TARGET_POINT_PER_CORE 350
#define BLOB_PLAYERS_PER_CORE 30
Expand Down
21 changes: 18 additions & 3 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,13 @@
/datum/mind/proc/memory_edit_blob()
. = _memory_edit_header("blob")
if(isblobinfected(src))
. += "|<b><font color='red'>BLOB</font></b>|<a href='?src=[UID()];blob=clear'>no</a>"
. += "|<b><font color='red'>BLOB</font></b>|<a href='?src=[UID()];blob=clear'>deblobize</a>"
. += "|<a href='?src=[UID()];blob=burst'>burst blob</a>"
else
else if(isblobovermind(src))
var/mob/camera/blob/blob_overmind = current
. += "|<b><font color='red'>BLOB Overmind</font></b>|"
. += "<br/><b>Total points: <a href='?src=[UID()];blob=set_points'>[blob_overmind.blob_points]</a>/[blob_overmind.max_blob_points]</b>"
else if(current.can_be_blob())
. += "<a href='?src=[UID()];blob=blob'>blobize</a>|<b>NO</b>"
. += _memory_edit_role_enabled(ROLE_BLOB)

Expand Down Expand Up @@ -765,7 +769,7 @@

sections["eventmisc"] = memory_edit_eventmisc(H)

if(isliving(current) && current.can_be_blob())
if((isliving(current) && current.can_be_blob()) || isblobovermind(src))
sections["blob"] = memory_edit_blob(current)

if(!issilicon(current))
Expand Down Expand Up @@ -2526,6 +2530,17 @@
log_admin("[key_name(usr)] has bursted [key_name(current)]")
message_admins("[key_name_admin(usr)] has bursted [key_name_admin(current)]")

if("set_points")
if(!isblobovermind(src))
return
var/mob/camera/blob/blob_overmind = current
var/blob_points = input(usr, "Введите новое число очков в диапазоне от 0 до [blob_overmind.max_blob_points]","Count:", blob_overmind.blob_points) as num|null
if(isnull(blob_points) || QDELETED(current) || current.stat == DEAD)
return
blob_overmind.blob_points = clamp(blob_points, 0, blob_overmind.max_blob_points)
log_admin("[key_name(usr)] set blob points to [key_name(current)] as [blob_overmind.blob_points]")
message_admins("[key_name_admin(usr)] set blob points to [key_name_admin(current)] as [blob_overmind.blob_points]")


else if(href_list["common"])
switch(href_list["common"])
Expand Down
2 changes: 2 additions & 0 deletions code/datums/weather/weather_types/blob_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
/datum/weather/blob_storm/can_weather_act(mob/living/mob_to_check)
if(prob(50))
return FALSE
if(QDELETED(mob_to_check) || mob_to_check.stat == DEAD)
return FALSE
if(!mob_to_check.mind || mob_to_check.mind.special_role == SPECIAL_ROLE_BLOB)
return FALSE
if(!mob_to_check.can_be_blob())
Expand Down
28 changes: 28 additions & 0 deletions code/game/gamemodes/blob/blob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,33 @@
return count


/datum/game_mode/proc/make_blobized_mouses(count)
var/list/candidates = SSghost_spawns.poll_candidates("Вы хотите сыграть за мышь, зараженную Блобом?", ROLE_BLOB, TRUE, source = /mob/living/simple_animal/mouse/blobinfected)

if(!length(candidates))
return FALSE

var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE, exclude_visible_by_mobs = TRUE)
if(!length(vents))
return FALSE

for(var/i in 1 to count)
if (length(candidates))
var/obj/vent = pick(vents)
var/mob/living/simple_animal/mouse/B = new(vent.loc)
var/mob/M = pick(candidates)
candidates.Remove(M)
B.key = M.key
var/datum/antagonist/blob_infected/blob_datum = new
blob_datum.time_to_burst_hight = TIME_TO_BURST_MOUSE_HIGHT
blob_datum.time_to_burst_low = TIME_TO_BURST_MOUSE_LOW
B.mind.add_antag_datum(blob_datum)
to_chat(B, span_userdanger("Теперь вы мышь, заражённая спорами Блоба. Найдите какое-нибудь укромное место до того, как вы взорветесь и станете Блобом! Вы можете перемещаться по вентиляции, нажав Alt+ЛКМ на вентиляционном отверстии."))
log_game("[B.key] has become blob infested mouse.")
notify_ghosts("Заражённая мышь появилась в [get_area(B)].", source = B, action = NOTIFY_FOLLOW)
return TRUE


/datum/game_mode/proc/process_blob_stages()
if(!GLOB.blob_cores.len)
return
Expand All @@ -156,6 +183,7 @@
if(blob_stage == BLOB_STAGE_ZERO && GLOB.blobs.len >= FIRST_STAGE_COEF * blob_win_count)
blob_stage = BLOB_STAGE_FIRST
send_intercept(BLOB_FIRST_REPORT)
SSshuttle?.emergency?.cancel()
SSshuttle?.lockdown_escape()

if(blob_stage == BLOB_STAGE_FIRST && GLOB.blobs.len >= SECOND_STAGE_COEF * blob_win_count)
Expand Down
16 changes: 8 additions & 8 deletions code/game/gamemodes/blob/blob_finish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
to_chat(world, "<B>Целью блоба было:</B>")

if(blob_objective.check_completion())
to_chat(world, "<br>[blob_objective.explanation_text] <font color='green'><B>Success!</B></font>")
to_chat(world, "<br/>[blob_objective.explanation_text] <font color='green'><B>Success!</B></font>")
SSblackbox.record_feedback("nested tally", "traitor_objective", 1, list("[blob_objective.type]", "SUCCESS"))
else
to_chat(world, "<br>[blob_objective.explanation_text] <font color='red'>Fail.</font>")
to_chat(world, "<br/>[blob_objective.explanation_text] <font color='red'>Fail.</font>")
SSblackbox.record_feedback("nested tally", "traitor_objective", 1, list("[blob_objective.type]", "FAIL"))
return TRUE

Expand All @@ -62,20 +62,20 @@
var/list/blobernauts = blobs["blobernauts"]
if(blob_infected?.len)
declare_blob_completion()
var/text = "<FONT size = 2><B>Блоб[(blob_infected.len > 1 ? "ами были" : "ом был")]:</B></FONT>"
var/text = "<br/><FONT size = 2><B>Блоб[(blob_infected.len > 1 ? "ами были" : "ом был")]:</B></FONT>"

for(var/datum/mind/blob in blob_infected)
text += "<br><b>[blob.key]</b> был <b>[blob.name]</b>"
text += "<br/><b>[blob.key]</b> был <b>[blob.name]</b>"

if(blob_offsprings?.len)
text += "<br><FONT size = 2><B>Потомк[(blob_offsprings.len > 1 ? "ами блоба были" : "ом блоба был")]:</B></FONT>"
text += "<br/><br/><FONT size = 2><B>Потомк[(blob_offsprings.len > 1 ? "ами блоба были" : "ом блоба был")]:</B></FONT>"
for(var/datum/mind/blob in blob_offsprings)
text += "<br><b>[blob.key]</b> был <b>[blob.name]</b>"
text += "<br/><b>[blob.key]</b> был <b>[blob.name]</b>"

if(blobernauts?.len)
text += "<br><FONT size = 2><B>Блобернаут[(blobernauts.len > 1 ? "ами были" : "ом был")]:</B></FONT>"
text += "<br/><br/><FONT size = 2><B>Блобернаут[(blobernauts.len > 1 ? "ами были" : "ом был")]:</B></FONT>"
for(var/datum/mind/blob in blobernauts)
text += "<br><b>[blob.key]</b> был <b>[blob.name]</b>"
text += "<br/><b>[blob.key]</b> был <b>[blob.name]</b>"

to_chat(world, text)
return TRUE
Expand Down
12 changes: 10 additions & 2 deletions code/game/gamemodes/blob/blobs/blob_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
if(!HAS_TRAIT(src, TRAIT_NEGATES_GRAVITY))
return ..()

/mob/living/simple_animal/hostile/blob/blobbernaut/proc/add_to_gamemode()
var/list/blobernauts = SSticker?.mode?.blobs["blobernauts"]
blobernauts |= mind

/mob/living/simple_animal/hostile/blob/blobbernaut/Life(seconds, times_fired)
if(stat != DEAD && (getBruteLoss() || getFireLoss())) // Heal on blob structures
Expand All @@ -224,6 +227,7 @@
name = text("blobbernaut ([rand(1, 1000)])")

/mob/living/simple_animal/hostile/blob/blobbernaut/death(gibbed)
mind.name = name
// Only execute the below if we successfully died
. = ..()
if(!.)
Expand All @@ -240,8 +244,12 @@

/mob/living/simple_animal/hostile/blob/blobbernaut/proc/blob_talk()
var/message = input(src, "Announce to the overmind", "Blob Telepathy")
var/rendered = "<i><span class='blob'>Blob Telepathy,</span> <span class='name'>[name]([overmind])</span> states, <span class='blob'>\"[message]\"</span></i>"
var/rendered = "<i><span class='blob'>Blob Telepathy,</span> <span class='name'>[name]([overmind]) states, <span class='blob'>\"[message]\"</span></i>"
if(message)
for(var/mob/M in GLOB.mob_list)
if(isovermind(M) || isobserver(M) || isblobbernaut(M) || isblobinfected(M.mind))
if(isovermind(M) || isblobbernaut(M) || isblobinfected(M.mind))
M.show_message(rendered, 2)
else if(isobserver(M) && !isnewplayer(M))
var/rendered_ghost = "<i><span class='blob'>Blob Telepathy,</span> <span class='name'>[name]([overmind]) </span> \
<a href='?src=[M.UID()];follow=[UID()]'>(F)</a> states, <span class='blob'>\"[message]\"</span></i>"
M.show_message(rendered_ghost, 2)
14 changes: 6 additions & 8 deletions code/game/gamemodes/blob/blobs/core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
GLOB.blob_cores += src
START_PROCESSING(SSobj, src)
GLOB.poi_list |= src
adjustcolors(color) //so it atleast appears
if(!overmind)
create_overmind(new_overmind)
adjustcolors(color) //so it atleast appears
if(offspring)
is_offspring = TRUE
if(overmind)
adjustcolors(overmind.blob_reagent_datum.color)
point_rate = new_rate
..(loc, h)

Expand Down Expand Up @@ -73,7 +71,7 @@
obj_integrity = min(max_integrity, obj_integrity + 1)
if(overmind)
overmind.update_health_hud()
if(overmind)
if(overmind?.blob_reagent_datum?.color)
for(var/i = 1; i < 8; i += i)
Pulse(0, i, overmind.blob_reagent_datum.color)
else
Expand All @@ -85,7 +83,7 @@
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)
if(B && overmind?.blob_reagent_datum?.color)
B.color = overmind.blob_reagent_datum.color
else
B.color = color
Expand Down Expand Up @@ -124,8 +122,6 @@
B.key = C.key
B.blob_core = src
overmind = B
B.select_reagent()
color = overmind.blob_reagent_datum.color
B.is_offspring = is_offspring
addtimer(CALLBACK(src, PROC_REF(add_datum_if_not_exist)), TIME_TO_ADD_OM_DATUM)
log_game("[B.key] has become Blob [is_offspring ? "offspring" : ""]")
Expand All @@ -146,11 +142,13 @@
return ..()

/obj/structure/blob/core/proc/add_datum_if_not_exist()
overmind.select_reagent()
if(!overmind.mind.has_antag_datum(/datum/antagonist/blob_overmind))
var/datum/antagonist/blob_overmind/overmind_datum = new
overmind_datum.add_to_mode = TRUE
overmind_datum.is_offspring = is_offspring
if(overmind.blob_reagent_datum)
overmind_datum = overmind.blob_reagent_datum
overmind_datum.reagent = overmind.blob_reagent_datum
overmind.mind.add_antag_datum(overmind_datum)
color = overmind.blob_reagent_datum.color

8 changes: 6 additions & 2 deletions code/game/gamemodes/blob/overmind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@
return

var/rendered = "<i><span class='blob[blob_reagent_datum.id]'>Blob Telepathy,</span> <span class='name'>[name](<span class='blob[blob_reagent_datum.id]'>[blob_reagent_datum.name]</span>)</span> states, <span class='blob[blob_reagent_datum.id]'>\"[message]\"</span></i>"

for(var/mob/M in GLOB.mob_list)
if(isovermind(M) || isobserver(M) || isblobbernaut(M) || isblobinfected(M.mind))
if(isovermind(M) || isblobbernaut(M) || isblobinfected(M.mind))
M.show_message(rendered, 2)
else if(isobserver(M) && !isnewplayer(M))
var/rendered_ghost = "<i><span class='blob[blob_reagent_datum.id]'>Blob Telepathy,</span> \
<span class='name'>[name](<span class='blob[blob_reagent_datum.id]'>[blob_reagent_datum.name]</span>)</span> \
<a href='?src=[M.UID()];follow=[UID()]'>(F)</a> states, <span class='blob[blob_reagent_datum.id]'>\"[message]\"</span></i>"
M.show_message(rendered_ghost, 2)


/mob/camera/blob/blob_act(obj/structure/blob/B)
Expand Down
4 changes: 1 addition & 3 deletions code/game/gamemodes/blob/powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,6 @@
var/mob/living/simple_animal/hostile/blob/blobbernaut/blobber = new (get_turf(b_fac))
qdel(b_fac)
blobber.key = C.key
if(blobber.mind in SSticker?.mode?.blobs["blobernauts"])
SSticker?.mode?.blobs["blobernauts"] -= blobber.mind
SSticker?.mode?.blobs["blobernauts"] += blobber.mind
log_game("[blobber.key] has spawned as Blobbernaut")
to_chat(blobber, "<span class='biggerdanger'>Вы блобернаут! Вы должны помочь всем формам блоба в их миссии по уничтожению всего!</span>")
to_chat(blobber, "<span class='danger'>Вы исцеляетесь, стоя на плитках блоба, однако вы будете медленно разлагаться, если получите урон за пределами блоба.</span>")
Expand All @@ -259,6 +256,7 @@
blob_mobs.Add(blobber)
blobber.AIStatus = AI_OFF
blobber.LoseTarget()
addtimer(CALLBACK(blobber, TYPE_PROC_REF(/mob/living/simple_animal/hostile/blob/blobbernaut/, add_to_gamemode)), TIME_TO_ADD_OM_DATUM)
return TRUE


Expand Down
11 changes: 7 additions & 4 deletions code/modules/admin/verbs/one_click_antag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,13 @@
return
log_admin("[key_name(owner)] tried making [antnum] blobs with One-Click-Antag")
message_admins("[key_name_admin(owner)] tried making [antnum] blobs with One-Click-Antag")

if(SSticker && SSticker.mode && SSticker.mode.make_blobs(antnum))
return TRUE
return FALSE
var/result = FALSE
switch(alert(usr, "Вы хотите создать блобов из членов экипажа или же с помощью инфицированных мышек?", "", "Из экипажа", "С помощью мышек"))
if("Из экипажа")
result = SSticker?.mode?.make_blobs(antnum)
if("С помощью мышек")
result = SSticker?.mode?.make_blobized_mouses(antnum)
return result

/datum/admins/proc/makeRevs()

Expand Down
53 changes: 53 additions & 0 deletions code/modules/antagonists/blob/blob_actions.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/datum/action/innate/blob
icon_icon = 'icons/mob/actions/actions.dmi'
background_icon_state = "bg_default_on"

/datum/action/innate/blob/comm
name = "Blob Telepathy"
desc = "Телепатически отправляет сообщение всем блобам, иблобернаутам и зараженным блобом"
button_icon_state = "alien_whisper"
check_flags = AB_CHECK_CONSCIOUS|AB_TRANSFER_MIND

/datum/action/innate/blob/comm/Activate()
var/input = stripped_input(usr, "Выберите сообщение для отправки другому блобу.", "Blob Telepathy", "")
if(!input || !IsAvailable())
return
blob_talk(usr, input)
return

/datum/action/innate/blob/self_burst
icon_icon = 'icons/mob/blob.dmi'
button_icon = 'icons/mob/blob.dmi'
background_icon_state = "block"
button_icon_state = "ui_tocore"
name = "Self burst"
desc = "Позволяет лопнуть носителя и превратиться в блоба досрочно."
check_flags = AB_CHECK_CONSCIOUS|AB_TRANSFER_MIND

/datum/action/innate/blob/self_burst/Activate()
var/input = alert(usr,"Вы действительно хотите лопнуть себя и превратиться в блоба досрочно? Это действие необратимо.", "", "Да", "Нет") == "Да"
if(!input || !IsAvailable())
return
var/datum/antagonist/blob_infected/blob = usr?.mind?.has_antag_datum(/datum/antagonist/blob_infected)
if(!blob)
return
blob.burst_blob()
return

/proc/blob_talk(mob/living/user, message)
add_say_logs(user, message, language = "BLOB")

message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))

if(!message)
return

var/rendered = "<i><span class='blob'>Blob Telepathy,</span> <span class='name'>[user.name]</span> states, <span class='blob'>\"[message]\"</span></i>"
for(var/mob/M in GLOB.mob_list)
if(isovermind(M) || isblobbernaut(M) || isblobinfected(M.mind))
M.show_message(rendered, 2)
else if(isobserver(M) && !isnewplayer(M))
var/rendered_ghost = "<i><span class='blob'>Blob Telepathy,</span> <span class='name'>[user.name]</span> \
<a href='?src=[M.UID()];follow=[user.UID()]'>(F)</a> states, <span class='blob'>\"[message]\"</span></i>"
M.show_message(rendered_ghost, 2)

Loading

0 comments on commit 11ab4a8

Please sign in to comment.