Skip to content

Commit

Permalink
Merge branch 'master' into zt-s1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zytolg authored Sep 25, 2023
2 parents f0e3fbf + 30710b8 commit c432494
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 39 deletions.
2 changes: 0 additions & 2 deletions code/__DEFINES/statpanel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ GLOBAL_LIST_INIT(client_verbs_required, list(
/client/verb/forum,
/client/verb/github,
/client/verb/joindiscord,
// Admin help
/client/verb/adminhelp,
))
2 changes: 1 addition & 1 deletion code/datums/map_zones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
unlink(dir)
parent_level.virtual_levels -= src
parent_level = null
SSidlenpcpool.idle_mobs_by_virtual_level["[id]"] = null
LAZYREMOVE(SSidlenpcpool.idle_mobs_by_virtual_level, "[id]")
SSmapping.virtual_z_translation -= "[id]"
parent_map_zone.remove_virtual_level(src)
if(up_linkage)
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/effects/anomalies/anomalies_heartbeat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

COOLDOWN_START(src, pulse_secondary_cooldown, pulse_delay*4)
var/turf/spot = locate(rand(src.x-effectrange, src.x+effectrange), rand(src.y-effectrange, src.y+effectrange), src.z)
if(!spot)
return

playsound(spot, 'sound/health/slowbeat2.ogg', 100)
radiation_pulse(spot, 200, effectrange)
for(var/mob/living/carbon/nearby in range(effectrange, spot))
Expand Down
64 changes: 36 additions & 28 deletions code/modules/mob/living/simple_animal/bot/firebot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
window_name = "Mobile Fire Extinguisher v1.0"
path_image_color = "#FFA500"

var/atom/target_fire
var/atom/old_target_fire
var/datum/weakref/target_fire_ref
var/datum/weakref/old_target_fire_ref

var/obj/item/extinguisher/internal_ext

Expand Down Expand Up @@ -106,15 +106,15 @@

/mob/living/simple_animal/bot/firebot/bot_reset()
..()
target_fire = null
old_target_fire = null
target_fire_ref = null
old_target_fire_ref = null
ignore_list = list()
anchored = FALSE
update_appearance()

/mob/living/simple_animal/bot/firebot/proc/soft_reset()
path = list()
target_fire = null
target_fire_ref = null
mode = BOT_IDLE
last_found = world.time
update_appearance()
Expand Down Expand Up @@ -149,7 +149,7 @@
audible_message("<span class='danger'>[src] buzzes oddly!</span>")
playsound(src, "sparks", 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
if(user)
old_target_fire = user
old_target_fire_ref = WEAKREF(user)
extinguish_fires = FALSE
extinguish_people = TRUE

Expand Down Expand Up @@ -184,7 +184,7 @@

else if(isturf(target))
var/turf/open/T = target
if(T.active_hotspot)
if(T.active_hotspot || T.turf_fire)
return TRUE

return FALSE
Expand All @@ -194,12 +194,12 @@
return

if(IsStun() || IsParalyzed())
old_target_fire = target_fire
target_fire = null
old_target_fire_ref = target_fire_ref
target_fire_ref = null
mode = BOT_IDLE
return

if(prob(1) && target_fire == null)
if(prob(1) && !target_fire_ref)
var/list/messagevoice = list("No fires detected." = 'sound/voice/firebot/nofires.ogg',
"Only you can prevent station fires." = 'sound/voice/firebot/onlyyou.ogg',
"Temperature nominal." = 'sound/voice/firebot/tempnominal.ogg',
Expand All @@ -210,24 +210,39 @@

// Couldn't reach the target, reset and try again ignoring the old one
if(frustration > 8)
old_target_fire = target_fire
old_target_fire_ref = target_fire_ref
soft_reset()

var/atom/target_fire = target_fire_ref?.resolve()

// We extinguished our target or it was deleted
if(QDELETED(target_fire) || !is_burning(target_fire) || isdead(target_fire))
target_fire = null
target_fire_ref = null
var/scan_range = (stationary_mode ? 1 : DEFAULT_SCAN_RANGE)
var/old_target_fire = old_target_fire_ref?.resolve()

if(extinguish_people)
target_fire = scan(/mob/living, old_target_fire, scan_range) // Scan for burning humans first
target_fire_ref = WEAKREF(target_fire)

if(target_fire == null && extinguish_fires)
if(!target_fire && extinguish_fires)
target_fire = scan(/turf/open, old_target_fire, scan_range) // Scan for burning turfs second
target_fire_ref = WEAKREF(target_fire)

old_target_fire = target_fire
old_target_fire_ref = target_fire_ref

if(!target_fire)
if(auto_patrol)
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
start_patrol()

if(mode == BOT_PATROL)
bot_patrol()
return

// Target reached ENGAGE WATER CANNON
if(target_fire && (get_dist(src, target_fire) <= (emagged == 2 ? 1 : 2))) // Make the bot spray water from afar when not emagged
if(get_dist(src, target_fire) <= (emagged == 2 ? 1 : 2)) // Make the bot spray water from afar when not emagged
if((speech_cooldown + SPEECH_INTERVAL) < world.time)
if(ishuman(target_fire))
speak("Stop, drop and roll!")
Expand All @@ -243,39 +258,32 @@
soft_reset()

// Target ran away
else if(target_fire && path.len && (get_dist(target_fire,path[path.len]) > 2))
else if(length(path) && (get_dist(target_fire, path[length(path)]) > 2))
path = list()
mode = BOT_IDLE
last_found = world.time

else if(target_fire && stationary_mode)
else if(stationary_mode)
soft_reset()
return

if(target_fire && (get_dist(src, target_fire) > 2))
if(get_dist(src, target_fire) > 2)

path = get_path_to(src, get_turf(target_fire), /turf/proc/Distance_cardinal, 0, 30, 1, id=access_card)
mode = BOT_MOVING
if(!path.len)
if(!length(path))
soft_reset()

if(path.len > 0 && target_fire)
if(length(path))
if(!bot_move(path[path.len]))
old_target_fire = target_fire
old_target_fire_ref = target_fire_ref
soft_reset()
return

// We got a target but it's too far away from us
if(path.len > 8 && target_fire)
if(length(path) > 8)
frustration++

if(auto_patrol && !target_fire)
if(mode == BOT_IDLE || mode == BOT_START_PATROL)
start_patrol()

if(mode == BOT_PATROL)
bot_patrol()


//Look for burning people or turfs around the bot
/mob/living/simple_animal/bot/firebot/process_scan(atom/scan_target)
Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-2364.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: MarkSuckerberg
delete-after: true
changes:
- tweak: Firebots now extinguish turf fires.
8 changes: 0 additions & 8 deletions html/changelogs/AutoChangeLog-pr-2368.yml

This file was deleted.

7 changes: 7 additions & 0 deletions html/changelogs/archive/2023-09.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,10 @@
2023-09-23:
Apogee-dev:
- tweak: Removed RnD from the Colossus and updated its looks
2023-09-25:
retlaw34, Ebin-Halcyon, triplezeta:
- rscadd: IRMG Pointman hardsuit, admin only at the moment
- rscadd: Resprites and reworks the Cybersun hardsuit a little
- rscadd: Cybersun Medical technician hardsuit
- rscdel: Old cybersun hardsuit, It was unused anyways
- tweak: Extremely minor Blood red hardsuit sprite tweaks

0 comments on commit c432494

Please sign in to comment.