everything involved in this is awful

This commit is contained in:
Joan Lung
2016-10-07 18:11:00 -04:00
parent fccd45e279
commit fe2d77b43f

View File

@@ -1,9 +1,8 @@
#define UNANCHORED_CORE 0 #define EMPTY_CORE 0
#define ANCHORED_CORE 1 #define CIRCUIT_CORE 1
#define CIRCUIT_CORE 2 #define SCREWED_CORE 2
#define SCREWED_CORE 3 #define CABLED_CORE 3
#define CABLED_CORE 4 #define GLASS_CORE 4
#define GLASS_CORE 5
/obj/structure/AIcore /obj/structure/AIcore
density = 1 density = 1
@@ -21,17 +20,19 @@
laws.set_laws_config() laws.set_laws_config()
/obj/structure/AIcore/attackby(obj/item/P, mob/user, params) /obj/structure/AIcore/attackby(obj/item/P, mob/user, params)
switch(state) if(istype(A, /obj/item/weapon/wrench))
if(UNANCHORED_CORE)
if(istype(P, /obj/item/weapon/wrench))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "<span class='notice'>You start wrenching the frame into place...</span>" user.visible_message("[user] [anchored ? "fastens" : "unfastens"] [src].", \
if(do_after(user, 20/P.toolspeed, target = src)) "<span class='notice'>You start to [anchored ? "unfasten [src] from" : "fasten [src] to"] the floor...</span>")
user << "<span class='notice'>You wrench the frame into place.</span>" if(do_after(user, 20, target = src))
anchored = 1 user << "<span class='notice'>You [anchored ? "unfasten [src] from" : "fasten [src] to"] the floor.</span>"
state = ANCHORED_CORE anchored = !anchored
return return
if(!anchored)
if(istype(P, /obj/item/weapon/weldingtool)) if(istype(P, /obj/item/weapon/weldingtool))
if(state != EMPTY_CORE)
user << "<span class='warning'>The core must be empty to deconstruct it!</span>"
return
var/obj/item/weapon/weldingtool/WT = P var/obj/item/weapon/weldingtool/WT = P
if(!WT.isOn()) if(!WT.isOn())
user << "<span class='warning'>The welder must be on for this task!</span>" user << "<span class='warning'>The welder must be on for this task!</span>"
@@ -45,15 +46,9 @@
new /obj/item/stack/sheet/plasteel( loc, 4) new /obj/item/stack/sheet/plasteel( loc, 4)
qdel(src) qdel(src)
return return
if(ANCHORED_CORE) else
if(istype(P, /obj/item/weapon/wrench)) switch(state)
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) if(EMPTY_CORE)
user << "<span class='notice'>You start to unfasten the frame...</span>"
if(do_after(user, 20/P.toolspeed, target = src))
user << "<span class='notice'>You unfasten the frame.</span>"
anchored = 0
state = UNANCHORED_CORE
return
if(istype(P, /obj/item/weapon/circuitboard/aicore)) if(istype(P, /obj/item/weapon/circuitboard/aicore))
if(!user.drop_item()) if(!user.drop_item())
return return
@@ -74,7 +69,7 @@
if(istype(P, /obj/item/weapon/crowbar)) if(istype(P, /obj/item/weapon/crowbar))
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
user << "<span class='notice'>You remove the circuit board.</span>" user << "<span class='notice'>You remove the circuit board.</span>"
state = ANCHORED_CORE state = EMPTY_CORE
icon_state = "0" icon_state = "0"
circuit.forceMove(loc) circuit.forceMove(loc)
circuit = null circuit = null
@@ -200,15 +195,8 @@
state = GLASS_CORE state = GLASS_CORE
/obj/structure/AIcore/deactivated/attackby(obj/item/A, mob/user, params) /obj/structure/AIcore/deactivated/attackby(obj/item/A, mob/user, params)
if(istype(A, /obj/item/device/aicard))//Is it? if(istype(A, /obj/item/device/aicard) && state == GLASS_CORE)
A.transfer_ai("INACTIVE","AICARD",src,user) A.transfer_ai("INACTIVE","AICARD",src,user)
else if(istype(A, /obj/item/weapon/wrench))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message("[user] [anchored ? "fastens" : "unfastens"] [src].", \
"<span class='notice'>You start to [anchored ? "unfasten [src] from" : "fasten [src] to"] the floor...</span>")
if(do_after(user, 20, target = src))
user << "<span class='notice'>You [anchored ? "unfasten [src] from" : "fasten [src] to"] the floor.</span>"
anchored = !anchored
else else
return ..() return ..()