Refactor stack recipes

- Styling fixes
 - Added post_build() to stack recipes, for any recipes that need to do
   something special
   - Called with two arguments, the stack that it originated from, and the
     new object.
 - Moved stack recipes to their own file

Currently, only two things use post_build
 - Cablecuffs use it to color the cuffs the same as the wire they
   originated from
 - Metal rods use it to call update_icon, in order to display the correct
   sprite for whatever amount of rods you created.
This commit is contained in:
Tigercat2000
2016-07-31 07:20:26 -07:00
parent 8a725eb910
commit 221476ef3b
7 changed files with 273 additions and 229 deletions
+2 -2
View File
@@ -12,9 +12,9 @@
return STATUS_CLOSE
/mob/proc/shared_nano_interaction()
if(src.stat || !client)
if(stat || !client)
return STATUS_CLOSE // no updates, close the interface
else if(restrained() || lying || stat || stunned || weakened)
else if(restrained() || lying || stunned || weakened)
return STATUS_UPDATE // update only (orange visibility)
return STATUS_INTERACTIVE
+5 -4
View File
@@ -24,7 +24,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable
level = 1
anchored =1
anchored = 1
on_blueprints = TRUE
var/datum/powernet/powernet
name = "power cable"
@@ -457,12 +457,13 @@ obj/structure/cable/proc/cableColor(var/colorC)
#define MAXCOIL 30
var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
new/datum/stack_recipe("cable restraints", /obj/item/weapon/restraints/handcuffs/cable, 15), \
)
var/global/list/datum/stack_recipe/cable_coil_recipes = list(
new /datum/stack_recipe/cable_restraints("cable restraints", /obj/item/weapon/restraints/handcuffs/cable, 15),
)
/obj/item/stack/cable_coil
name = "cable coil"
singular_name = "cable"
icon = 'icons/obj/power.dmi'
icon_state = "coil"
item_state = "coil_red"