Icon smoothing and icon update refactor (#17569)

* Atomization

* asdfsadf

* sdfas

---------

Co-authored-by: FluffyGhost <FluffyGhost>
This commit is contained in:
Fluffy
2023-10-12 23:23:28 +02:00
committed by GitHub
parent bb4d89a498
commit 8bb0ecfcd3
7 changed files with 223 additions and 48 deletions
+19 -3
View File
@@ -13,9 +13,15 @@
desc = "A small wrapped package."
w_class = ITEMSIZE_NORMAL
var/power = 1 /*Size of the explosion.*/
///Size of the explosion
var/power = 1
///Used for the icon
var/size = "small" /*Used for the icon, this one will make c-4small_0 for the off state.*/
///The detonator that makes this C4 charge explode
var/obj/item/syndie/c4detonator/detonator = null
/obj/item/syndie/c4explosive/heavy
icon_state = "c-4large_0"
item_state = "c-4large"
@@ -23,15 +29,21 @@
power = 2
size = "large"
/obj/item/syndie/c4explosive/New()
/obj/item/syndie/c4explosive/Initialize()
. = ..()
var/K = rand(1,2000)
K = md5(num2text(K)+name)
K = copytext(K,1,7)
src.desc += "\n You see [K] engraved on \the [src]."
var/obj/item/syndie/c4detonator/detonator = new(src.loc)
detonator = new(src.loc)
detonator.desc += "\n You see [K] engraved on the lighter."
detonator.bomb = src
/obj/item/syndie/c4explosive/Destroy()
. = ..()
QDEL_NULL(detonator)
/obj/item/syndie/c4explosive/proc/detonate()
icon_state = "c-4[size]_1"
spawn(50)
@@ -60,6 +72,10 @@
var/obj/item/syndie/c4explosive/bomb
var/pr_open = 0 /*Is the "What do you want to do?" prompt open?*/
/obj/item/syndie/c4detonator/Destroy()
bomb = null
. = ..()
/obj/item/syndie/c4detonator/attack_self(mob/user as mob)
switch(src.icon_state)
if("c-4detonator_0")
+16 -12
View File
@@ -15,11 +15,27 @@
var/slowdown = 0 //amount that pulling mobs have their movement delayed by
/obj/structure/Initialize(mapload)
. = ..()
if(!isnull(material) && !istype(material))
material = SSmaterials.get_material_by_name(material)
if (!mapload)
updateVisibility(src) // No point checking this before visualnet initializes.
if(climbable)
verbs += /obj/structure/proc/climb_on
if (smoothing_flags)
SSicon_smooth.add_to_queue(src)
SSicon_smooth.add_to_queue_neighbors(src)
/obj/structure/Destroy()
if(parts)
new parts(loc)
if (smoothing_flags)
SSicon_smooth.remove_from_queues(src)
SSicon_smooth.add_to_queue_neighbors(src)
climbers = null
return ..()
/obj/structure/attack_hand(mob/user)
@@ -65,18 +81,6 @@
. = ..()
bullet_ping(P)
/obj/structure/Initialize(mapload)
. = ..()
if(!isnull(material) && !istype(material))
material = SSmaterials.get_material_by_name(material)
if (!mapload)
updateVisibility(src) // No point checking this before visualnet initializes.
if(climbable)
verbs += /obj/structure/proc/climb_on
if (smoothing_flags)
SSicon_smooth.add_to_queue(src)
SSicon_smooth.add_to_queue_neighbors(src)
/obj/structure/proc/climb_on()
set name = "Climb structure"