Refactor: Floorbot Overlay + Sprite Reduction (#23081)

* test

* good

* floorbot rename

* normal + layers done

* UPDATE_OVERLAY

* Sprites done

* indentation

* color gone

* fix

* spacing

* Spacing
This commit is contained in:
Deniz
2023-11-04 18:07:33 +00:00
committed by GitHub
parent c7fcee6f50
commit f01e3de488
3 changed files with 15 additions and 13 deletions
@@ -133,7 +133,7 @@
on = TRUE
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, "depowered")
set_light(initial(light_range))
update_icon(UPDATE_ICON_STATE)
update_icon(UPDATE_ICON_STATE | UPDATE_OVERLAYS)
update_controls()
diag_hud_set_botstat()
return 1
@@ -143,7 +143,7 @@
ADD_TRAIT(src, TRAIT_IMMOBILIZED, "depowered")
set_light(0)
bot_reset() //Resets an AI's call, should it exist.
update_icon(UPDATE_ICON_STATE)
update_icon(UPDATE_ICON_STATE | UPDATE_OVERLAYS)
update_controls()
/mob/living/simple_animal/bot/Initialize(mapload)
@@ -3,7 +3,7 @@
name = "\improper Floorbot"
desc = "A little floor repairing robot, he looks so excited!"
icon = 'icons/obj/aibots.dmi'
icon_state = "floorbot0"
icon_state = "floorbot"
density = FALSE
anchored = FALSE
health = 25
@@ -300,13 +300,13 @@
if(isspaceturf(target_turf)) //If we are fixing an area not part of pure space, it is
visible_message("<span class='notice'>[src] begins to repair the hole.</span>")
mode = BOT_REPAIRING
update_icon(UPDATE_ICON_STATE)
update_icon(UPDATE_OVERLAYS)
addtimer(CALLBACK(src, PROC_REF(make_bridge_plating), target_turf), 5 SECONDS)
else
var/turf/simulated/floor/F = target_turf
mode = BOT_REPAIRING
update_icon(UPDATE_ICON_STATE)
update_icon(UPDATE_OVERLAYS)
visible_message("<span class='notice'>[src] begins repairing the floor.</span>")
addtimer(CALLBACK(src, PROC_REF(make_bridge_plating), F), 5 SECONDS)
@@ -319,7 +319,7 @@
F.ChangeTurf(/turf/simulated/floor/plasteel)
mode = BOT_IDLE
amount--
update_icon(UPDATE_ICON_STATE)
update_icon(UPDATE_OVERLAYS)
anchored = FALSE
target = null
@@ -339,7 +339,7 @@
target_turf.ChangeTurf(/turf/simulated/floor/plating)
mode = BOT_IDLE
amount--
update_icon(UPDATE_ICON_STATE)
update_icon(UPDATE_OVERLAYS)
anchored = FALSE
target = null
@@ -364,7 +364,7 @@
qdel(T)
target = null
mode = BOT_IDLE
update_icon(UPDATE_ICON_STATE)
update_icon(UPDATE_OVERLAYS)
/mob/living/simple_animal/bot/floorbot/proc/start_maketile(obj/item/stack/sheet/metal/M)
if(!istype(M, /obj/item/stack/sheet/metal))
@@ -389,13 +389,15 @@
mode = BOT_IDLE
/mob/living/simple_animal/bot/floorbot/update_icon_state()
return
/mob/living/simple_animal/bot/floorbot/update_overlays()
. = ..()
if(mode == BOT_REPAIRING)
icon_state = "[toolbox_color]floorbot-c"
return
if(amount > 0)
icon_state = "[toolbox_color]floorbot[on]"
. += "floorbot_work"
else
icon_state = "[toolbox_color]floorbot[on]e"
. += "floorbot_[on ? "on" : "off"]"
. += "floorbot_[amount > 0 ? "metal" : ""]"
/mob/living/simple_animal/bot/floorbot/explode()
on = FALSE