convert to machinery type
This commit is contained in:
@@ -1,27 +1,36 @@
|
||||
/obj/structure/fan_assembly
|
||||
/obj/machinery/fan_assembly
|
||||
name = "fan assembly"
|
||||
desc = "A basic microfan assembly."
|
||||
icon = 'icons/obj/poweredfans.dmi'
|
||||
icon_state = "mfan_assembly"
|
||||
max_integrity = 150
|
||||
use_power = NO_POWER_USE
|
||||
power_channel = ENVIRON
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
max_integrity = 150
|
||||
layer = ABOVE_NORMAL_TURF_LAYER
|
||||
anchored = FALSE
|
||||
density = FALSE
|
||||
CanAtmosPass = ATMOS_PASS_NO
|
||||
var/state = 1
|
||||
var/buildstacktype = /obj/item/stack/sheet/plasteel
|
||||
var/buildstackamount = 5
|
||||
/*
|
||||
1 = Wrenched in place
|
||||
2 = Welded in place
|
||||
3 = Wires attached to it
|
||||
3 = Wires attached to it, this makes it change to the full thing.
|
||||
*/
|
||||
|
||||
/obj/structure/fan_assembly/Initialize(mapload, ndir, building)
|
||||
/obj/machinery/fan_assembly/Initialize(mapload, ndir, building)
|
||||
. = ..()
|
||||
if(building)
|
||||
setDir(ndir)
|
||||
|
||||
/obj/structure/fan_assembly/Destroy()
|
||||
/obj/machinery/fan_assembly/Destroy()
|
||||
return ..()
|
||||
|
||||
/obj/structure/fan_assembly/attackby(obj/item/W, mob/living/user, params)
|
||||
/obj/machinery/fan_assembly/attackby(obj/item/W, mob/living/user, params)
|
||||
switch(state)
|
||||
if(1)
|
||||
// State 1
|
||||
@@ -55,18 +64,7 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/structure/fan_assembly/wirecutter_act(mob/user, obj/item/I)
|
||||
if(state != 3)
|
||||
return FALSE
|
||||
|
||||
new /obj/item/stack/cable_coil(drop_location(), 2)
|
||||
I.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You cut the wires from the circuits.</span>")
|
||||
state = 2
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/fan_assembly/wrench_act(mob/user, obj/item/I)
|
||||
/obj/machinery/fan_assembly/wrench_act(mob/user, obj/item/I)
|
||||
if(state != 1)
|
||||
return FALSE
|
||||
user.visible_message("<span class='warning'>[user] disassembles [src].</span>",
|
||||
@@ -75,7 +73,7 @@
|
||||
deconstruct()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/fan_assembly/proc/weld(obj/item/weldingtool/W, mob/living/user)
|
||||
/obj/machinery/fan_assembly/proc/weld(obj/item/weldingtool/W, mob/living/user)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return FALSE
|
||||
switch(state)
|
||||
@@ -87,16 +85,16 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/structure/fan_assembly/deconstruct(disassembled = TRUE)
|
||||
/obj/machinery/fan_assembly/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
new buildstacktype(loc,buildstackamount)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/fan_assembly/examine(mob/user)
|
||||
/obj/machinery/fan_assembly/examine(mob/user)
|
||||
..()
|
||||
deconstruction_hints(user)
|
||||
|
||||
/obj/structure/fan_assembly/proc/deconstruction_hints(mob/user)
|
||||
/obj/machinery/fan_assembly/proc/deconstruction_hints(mob/user)
|
||||
switch(state)
|
||||
if(1)
|
||||
to_chat(user, "<span class='notice'>The fan assembly seems to be <b>unwelded</b> and loose.</span>")
|
||||
@@ -105,7 +103,7 @@
|
||||
if(3)
|
||||
to_chat(user, "<span class='notice'>The outer plating is <b>wired</b> firmly in place.</span>")
|
||||
|
||||
/obj/structure/fan_assembly/update_icon()
|
||||
/obj/machinery/fan_assembly/update_icon()
|
||||
switch(state)
|
||||
if(1)
|
||||
icon_state = "mfan_assembly"
|
||||
|
||||
@@ -4,13 +4,15 @@
|
||||
name = "micro powered fan"
|
||||
desc = "A handmade fan, releasing a thin gust of air."
|
||||
use_power = ACTIVE_POWER_USE
|
||||
power_channel = ENVIRON
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 10
|
||||
max_integrity = 150
|
||||
layer = ABOVE_NORMAL_TURF_LAYER
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
CanAtmosPass = ATMOS_PASS_NO
|
||||
var/obj/structure/fan_assembly/assembly = null
|
||||
var/obj/machinery/fan_assembly/assembly = null
|
||||
|
||||
/obj/machinery/poweredfans/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
@@ -34,7 +36,7 @@
|
||||
deconstruct()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/poweredfans/Initialize(mapload, obj/structure/fan_assembly/FA)
|
||||
/obj/machinery/poweredfans/Initialize(mapload, obj/machinery/fan_assembly/FA)
|
||||
. = ..()
|
||||
if(FA)
|
||||
assembly = FA
|
||||
|
||||
@@ -179,7 +179,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
|
||||
GLOBAL_LIST_INIT(plasteel_recipes, list ( \
|
||||
new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = TRUE), \
|
||||
new/datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 10, time = 50), \
|
||||
new/datum/stack_recipe("micro powered fan assembly", /obj/structure/fan_assembly, 5, time = 50, one_per_turf = TRUE, on_floor = TRUE), \
|
||||
new/datum/stack_recipe("micro powered fan assembly", /obj/machinery/fan_assembly, 5, time = 50, one_per_turf = TRUE, on_floor = TRUE), \
|
||||
new /datum/stack_recipe_list("crates", list( \
|
||||
new /datum/stack_recipe("gray crate", /obj/structure/closet/crate, 5, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
new /datum/stack_recipe("internals crate", /obj/structure/closet/crate/internals, 5, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
|
||||
Reference in New Issue
Block a user