Drone Eye Fixes (#10741)

This commit is contained in:
Geeves
2020-12-09 12:01:16 +02:00
committed by GitHub
parent 45b93691d7
commit 7a0f88305b
5 changed files with 34 additions and 12 deletions

View File

@@ -10,6 +10,8 @@
req_access = list(access_mining, access_robotics) req_access = list(access_mining, access_robotics)
id_card_type = /obj/item/card/id/minedrone id_card_type = /obj/item/card/id/minedrone
speed = -1 speed = -1
hat_x_offset = 1
hat_y_offset = -12
var/seeking_player = FALSE var/seeking_player = FALSE
var/health_upgrade var/health_upgrade
var/ranged_upgrade var/ranged_upgrade

View File

@@ -76,6 +76,7 @@
// Hats! // Hats!
var/obj/item/hat var/obj/item/hat
var/image/hat_overlay
var/hat_x_offset = 0 var/hat_x_offset = 0
var/hat_y_offset = -13 var/hat_y_offset = -13
@@ -111,6 +112,7 @@
if(hat) if(hat)
hat.forceMove(get_turf(src)) hat.forceMove(get_turf(src))
hat = null hat = null
QDEL_NULL(hat_overlay)
return ..() return ..()
/mob/living/silicon/robot/drone/construction /mob/living/silicon/robot/drone/construction
@@ -157,7 +159,6 @@
C.max_damage = 10 C.max_damage = 10
verbs -= /mob/living/silicon/robot/verb/Namepick verbs -= /mob/living/silicon/robot/verb/Namepick
update_icon()
density = FALSE density = FALSE
/mob/living/silicon/robot/drone/init() /mob/living/silicon/robot/drone/init()
@@ -181,15 +182,24 @@
real_name = "maintenance drone ([rand(100,999)])" real_name = "maintenance drone ([rand(100,999)])"
name = real_name name = real_name
/mob/living/silicon/robot/drone/update_icon() /mob/living/silicon/robot/drone/setup_icon_cache()
cut_overlays() cached_eye_overlays = list(
if(stat == CONSCIOUS && isturf(loc)) I_HELP = image(icon, "eyes-[icon_state]-help", layer = EFFECTS_ABOVE_LIGHTING_LAYER),
if(!emagged) I_HURT = image(icon, "eyes-[icon_state]-harm", layer = EFFECTS_ABOVE_LIGHTING_LAYER),
add_overlay("eyes-[icon_state]") "emag" = image(icon, "eyes-[icon_state]-emag", layer = EFFECTS_ABOVE_LIGHTING_LAYER)
else )
add_overlay("eyes-[icon_state]-emag") if(eye_overlay)
if(hat) // Let the drones wear hats. cut_overlay(eye_overlay)
add_overlay(get_hat_icon(hat, hat_x_offset, hat_y_offset)) eye_overlay = cached_eye_overlays[a_intent]
if(!stat)
add_overlay(eye_overlay)
/mob/living/silicon/robot/drone/set_intent(var/set_intent)
a_intent = set_intent
cut_overlay(eye_overlay)
if(!stat)
eye_overlay = cached_eye_overlays[emagged ? "emag" : set_intent]
add_overlay(eye_overlay)
/mob/living/silicon/robot/drone/choose_icon() /mob/living/silicon/robot/drone/choose_icon()
return return
@@ -202,7 +212,8 @@
return return
hat = new_hat hat = new_hat
new_hat.forceMove(src) new_hat.forceMove(src)
update_icon() hat_overlay = get_hat_icon(hat, hat_x_offset, hat_y_offset)
add_overlay(hat_overlay)
//Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..(). //Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..().
/mob/living/silicon/robot/drone/attackby(var/obj/item/W, var/mob/user) /mob/living/silicon/robot/drone/attackby(var/obj/item/W, var/mob/user)
@@ -271,7 +282,7 @@
to_chat(src, "<b>Obey these laws:</b>") to_chat(src, "<b>Obey these laws:</b>")
laws.show_laws(src) laws.show_laws(src)
to_chat(src, SPAN_DANGER("ALERT: [user.real_name] is your new master. Obey your new laws and their commands.")) to_chat(src, SPAN_DANGER("ALERT: [user.real_name] is your new master. Obey your new laws and their commands."))
update_icon() set_intent(I_HURT) // force them to hurt to update the eyes, they can swap to and fro if they wish, though - geeves
return TRUE return TRUE
/mob/living/silicon/robot/drone/proc/ai_hack(var/mob/user) /mob/living/silicon/robot/drone/proc/ai_hack(var/mob/user)

View File

@@ -31,6 +31,8 @@
H.put_in_hands(hat) H.put_in_hands(hat)
H.visible_message(SPAN_WARNING("\The [H] removes \the [src]'s [hat].")) H.visible_message(SPAN_WARNING("\The [H] removes \the [src]'s [hat]."))
hat = null hat = null
cut_overlay(hat_overlay)
QDEL_NULL(hat_overlay)
update_icon() update_icon()
else else
return ..() return ..()

View File

@@ -0,0 +1,7 @@
author: Geeves
delete-after: True
changes:
- bugfix: "Fixed maintenance-, mining-, and construction drones having weird lit up eyes. They should now update correctly."
- bugfix: "Fixed the hat overlay of mining drones."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 KiB

After

Width:  |  Height:  |  Size: 509 KiB