Skip to content

Commit

Permalink
one more small pr fixing purple squares (#17808)
Browse files Browse the repository at this point in the history
* Set valid initial state for some dynamically chosen icons.

* random tool icon

* strange object
  • Loading branch information
moxian authored May 17, 2022
1 parent 80de45f commit e7ced2a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
10 changes: 6 additions & 4 deletions code/game/objects/items/weapons/legcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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.
Expand Down Expand Up @@ -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>")
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/random/random.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,\
Expand Down
1 change: 1 addition & 0 deletions code/modules/research/experimentor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@
name = "strange object"
desc = "What mysteries could this hold?"
icon = 'icons/obj/assemblies.dmi'
icon_state = "prox-radio1" // it is immediately overriden in New, but setting it here makes it show in mapeditor
origin_tech = "combat=1;plasmatech=1;powerstorage=1;materials=1"
var/realName = "defined object"
var/revealed = FALSE
Expand Down
8 changes: 4 additions & 4 deletions code/modules/research/server.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/obj/machinery/r_n_d/server
name = "R&D Server"
icon = 'icons/obj/machines/research.dmi'
icon_state = "RD-server"
icon_state = "RD-server-off"
var/datum/research/files
var/health = 100
var/list/id_with_upload = list() //List of R&D consoles with upload to server access.
Expand Down Expand Up @@ -46,9 +46,9 @@

/obj/machinery/r_n_d/server/update_icon()
if(stat & NOPOWER)
icon_state = "[initial(icon_state)]-off"
return
icon_state = "[initial(icon_state)]-on"
icon_state = "RD-server-off"
else
icon_state = "RD-server-on"

/obj/machinery/r_n_d/server/power_change()
. = ..()
Expand Down
Binary file modified icons/obj/tools.dmi
Binary file not shown.

0 comments on commit e7ced2a

Please sign in to comment.