one more small pr fixing purple squares (#17808)

* Set valid initial state for some dynamically chosen icons.

* random tool icon

* strange object
This commit is contained in:
moxian
2022-05-17 15:39:44 +01:00
committed by GitHub
parent 80de45f161
commit e7ced2a0c3
5 changed files with 13 additions and 10 deletions
+6 -4
View File
@@ -15,7 +15,7 @@
name = "bear trap"
throw_speed = 1
throw_range = 1
icon_state = "beartrap"
icon_state = "beartrap0"
desc = "A trap used to catch bears and other legged creatures."
origin_tech = "engineering=4"
var/armed = 0
@@ -25,7 +25,9 @@
/obj/item/restraints/legcuffs/beartrap/New()
..()
icon_state = "[initial(icon_state)][armed]"
/obj/item/restraints/legcuffs/beartrap/update_icon()
icon_state = "beartrap[armed]"
/obj/item/restraints/legcuffs/beartrap/Destroy()
QDEL_NULL(IED)
@@ -41,7 +43,7 @@
..()
if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed
icon_state = "[initial(icon_state)][armed]"
update_icon()
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/restraints/legcuffs/beartrap/attackby(obj/item/I, mob/user) //Let's get explosive.
@@ -93,7 +95,7 @@
if( (iscarbon(AM) || isanimal(AM)) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/hostile/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator))
var/mob/living/L = AM
armed = 0
icon_state = "[initial(icon_state)][armed]"
update_icon()
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \
"<span class='userdanger'>You trigger \the [src]!</span>")
+2 -2
View File
@@ -29,8 +29,8 @@
/obj/random/tool
name = "Random Tool"
desc = "This is a random tool"
icon = 'icons/obj/items.dmi'
icon_state = "welder"
icon = 'icons/obj/tools.dmi'
icon_state = "random_tool"
/obj/random/tool/item_to_spawn()
return pick(/obj/item/screwdriver,\