Construction restructuring.

Absolute pathed construction.dm.
Fixed issues.
Changed the way reversible works, to give more flexibility.
This commit is contained in:
ComicIronic
2015-03-08 21:11:18 +00:00
parent 4d41a7ddf2
commit 8f42a1af6b
4 changed files with 954 additions and 801 deletions

View File

@@ -15,210 +15,189 @@
bound_width = 64
bound_height = 64
construct = new /datum/construction/reversible2/pod(src)
construct = new /datum/construction/reversible/pod(src)
dir = EAST
/obj/structure/spacepod_frame/attackby(obj/item/W as obj, mob/user as mob)
if(!construct || !construct.action(W, user))
..()
return
return ..()
return 1
/obj/structure/spacepod_frame/attack_hand()
return
/////////////////////////////////
// CONSTRUCTION STEPS
/////////////////////////////////
/datum/construction/reversible2/pod
/datum/construction/reversible/pod
result = /obj/spacepod/civilian
base_icon="pod"
//taskpath = /datum/job_objective/make_pod
steps = list(
// 1. Initial state
// 12. Bolted-down armor
list(
"desc" = "An empty pod frame.",
state_next = list(
"key" = /obj/item/stack/cable_coil,
"vis_msg" = "{USER} wires the {HOLDER}.",
"self_msg" = "You wire the {HOLDER}."
)
),
// 2. Crudely Wired
list(
"desc" = "A crudely-wired pod frame.",
state_prev = list(
"key" = /obj/item/weapon/wirecutters,
"vis_msg" = "{USER} cuts out the {HOLDER}'s wiring.",
"self_msg" = "You remove the {HOLDER}'s wiring."
Co_DESC = "A space pod with unsecured armor.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/wrench,
Co_VIS_MSG = "{USER} unsecure{s} {HOLDER}'s armor."
),
state_next = list(
"key" = /obj/item/weapon/screwdriver,
"vis_msg" = "{USER} adjusts the wiring.",
"self_msg" = "You adjust the {HOLDER}'s wiring."
)
),
// 3. Cleanly wired
list(
"desc" = "A wired pod frame.",
state_prev = list(
"key" = /obj/item/weapon/screwdriver,
"vis_msg" = "{USER} unclips {HOLDER}'s wiring harnesses.",
"self_msg" = "You unclip {HOLDER}'s wiring harnesses."
),
state_next = list(
"key" = /obj/item/weapon/circuitboard/mecha/pod,
"vis_msg" = "{USER} inserts the mainboard into the {HOLDER}.",
"self_msg" = "You insert the mainboard into the {HOLDER}.",
"delete" = 1
)
),
// 4. Circuit added
list(
"desc" = "A wired pod frame with a loose mainboard.",
state_prev = list(
"key" = /obj/item/weapon/crowbar,
"vis_msg" = "{USER} pries out the mainboard.",
"self_msg" = "You pry out the mainboard.",
"spawn" = /obj/item/weapon/circuitboard/mecha/pod,
"amount" = 1
),
state_next = list(
"key" = /obj/item/weapon/screwdriver,
"vis_msg" = "{USER} secures the mainboard.",
"self_msg" = "You secure the mainboard."
)
),
// 5. Circuit secured
list(
"desc" = "A wired pod frame with a secured mainboard.",
state_prev = list(
"key" = /obj/item/weapon/screwdriver,
"vis_msg" = "{USER} unsecures the mainboard.",
"self_msg" = "You unscrew the mainboard from the {HOLDER}."
),
state_next = list(
"key" = /obj/item/pod_parts/core,
"vis_msg" = "{USER} inserts the core into the {HOLDER}.",
"self_msg" = "You carefully insert the core into the {HOLDER}.",
"delete" = 1
)
),
// 6. Core inserted
list(
"desc" = "A naked space pod with a loose core.",
state_prev = list(
"key" = /obj/item/weapon/crowbar,
"vis_msg" = "{USER} delicately removes the core from the {HOLDER} with a crowbar.",
"self_msg" = "You delicately remove the core from the {HOLDER} with a crowbar.",
"spawn" = /obj/item/pod_parts/core,
"amount" = 1
),
state_next = list(
"key" = /obj/item/weapon/wrench,
"vis_msg" = "{USER} secures the core's bolts.",
"self_msg" = "You secure the core's bolts."
)
),
// 7. Core secured
list(
"desc" = "A naked space pod with an exposed core. How lewd.",
state_prev = list(
"key" = /obj/item/weapon/wrench,
"vis_msg" = "{USER} unsecures the {HOLDER}'s core.",
"self_msg" = "You unsecure the {HOLDER}'s core."
),
state_next = list(
"key" = /obj/item/stack/sheet/metal,
"amount" = 5,
"vis_msg" = "{USER} frabricates a pressure bulkhead for the {HOLDER}.",
"self_msg" = "You frabricate a pressure bulkhead for the {HOLDER}."
)
),
// 8. Bulkhead added
list(
"desc" = "A space pod with loose bulkhead panelling exposed.",
state_prev = list(
"key" = /obj/item/weapon/crowbar,
"vis_msg" = "{USER} pops the {HOLDER}'s bulkhead panelling loose.",
"self_msg" = "You pop the {HOLDER}'s bulkhead panelling loose.",
"spawn" = /obj/item/stack/sheet/metal,
"amount" = 5,
),
state_next = list(
"key" = /obj/item/weapon/wrench,
"vis_msg" = "{USER} secures the {HOLDER}'s bulkhead panelling.",
"self_msg" = "You secure the {HOLDER}'s bulkhead panelling."
)
),
// 9. Bulkhead secured with bolts
list(
"desc" = "A space pod with unwelded bulkhead panelling exposed.",
state_prev = list(
"key" = /obj/item/weapon/wrench,
"vis_msg" = "{USER} unbolts the {HOLDER}'s bulkhead panelling.",
"self_msg" = "You unbolt the {HOLDER}'s bulkhead panelling."
),
state_next = list(
"key" = /obj/item/weapon/weldingtool,
"vis_msg" = "{USER} seals the {HOLDER}'s bulkhead panelling with a weld.",
"self_msg" = "You seal the {HOLDER}'s bulkhead panelling with a weld."
)
),
// 10. Welded bulkhead
list(
"desc" = "A space pod with sealed bulkhead panelling exposed.",
state_prev = list(
"key" = /obj/item/weapon/weldingtool,
"vis_msg" = "{USER} cuts the {HOLDER}'s bulkhead panelling loose.",
"self_msg" = "You cut the {HOLDER}'s bulkhead panelling loose."
),
state_next = list(
"key" = /obj/item/pod_parts/armor,
"vis_msg" = "{USER} installs the {HOLDER}'s armor plating.",
"self_msg" = "You install the {HOLDER}'s armor plating.",
"delete" = 1
Co_NEXTSTEP = list(
Co_KEY = /obj/item/weapon/weldingtool,
Co_VIS_MSG = "{USER} weld{s} {HOLDER}'s armor."
)
),
// 11. Loose armor
list(
"desc" = "A space pod with unsecured armor.",
state_prev = list(
"key" = /obj/item/weapon/crowbar,
"vis_msg" = "{USER} pries off {HOLDER}'s armor.",
"self_msg" = "You pry off {HOLDER}'s armor.",
"spawn" = /obj/item/pod_parts/armor,
"amount" = 1
Co_DESC = "A space pod with unsecured armor.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/crowbar,
Co_VIS_MSG = "{USER} prie{s} off {HOLDER}'s armor."
),
state_next = list(
"key" = /obj/item/weapon/wrench,
"vis_msg" = "{USER} bolts down the {HOLDER}'s armor.",
"self_msg" = "You bolt down the {HOLDER}'s armor."
Co_NEXTSTEP = list(
Co_KEY = /obj/item/weapon/wrench,
Co_VIS_MSG = "{USER} bolt{s} down {HOLDER}'s armor."
)
),
// 12. Bolted-down armor
// 10. Welded bulkhead
list(
"desc" = "A space pod with unsecured armor.",
state_prev = list(
"key" = /obj/item/weapon/wrench,
"vis_msg" = "{USER} unsecures the {HOLDER}'s armor.",
"self_msg" = "You unsecure the {HOLDER}'s armor."
Co_DESC = "A space pod with sealed bulkhead panelling exposed.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/weldingtool,
Co_VIS_MSG = "{USER} cut{s} {HOLDER}'s bulkhead panelling loose.",
Co_AMOUNT = 3
),
state_next = list(
"key" = /obj/item/weapon/weldingtool,
"vis_msg" = "{USER} welds the {HOLDER}'s armor.",
"self_msg" = "You weld the {HOLDER}'s armor."
Co_NEXTSTEP = list(
Co_KEY = /obj/item/pod_parts/armor,
Co_VIS_MSG = "{USER} install{s} {HOLDER}'s armor plating.",
Co_AMOUNT = 1,
Co_KEEP
)
),
// 9. Bulkhead secured with bolts
list(
Co_DESC = "A space pod with unwelded bulkhead panelling exposed.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/wrench,
Co_VIS_MSG = "{USER} unbolt{s} {HOLDER}'s bulkhead panelling.",
),
Co_NEXTSTEP = list(
Co_KEY = /obj/item/weapon/weldingtool,
Co_VIS_MSG = "{USER} seal{s} {HOLDER}'s bulkhead panelling with a weld.",
Co_AMOUNT = 3
)
),
// 8. Bulkhead added
list(
Co_DESC = "A space pod with loose bulkhead panelling exposed.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/crowbar,
Co_VIS_MSG = "{USER} pop{s} {HOLDER}'s bulkhead panelling loose.",
),
Co_NEXTSTEP = list(
Co_KEY = /obj/item/weapon/wrench,
Co_VIS_MSG = "{USER} secure{s} {HOLDER}'s bulkhead panelling."
)
),
// 7. Core secured
list(
Co_DESC = "A naked space pod with an exposed core. How lewd.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/wrench,
Co_VIS_MSG = "{USER} unsecure{s} {HOLDER}'s core."
),
Co_NEXTSTEP = list(
Co_KEY = /obj/item/stack/sheet/metal,
Co_AMOUNT = 5,
Co_VIS_MSG = "{USER} fabricate{s} a pressure bulkhead for {HOLDER}.",
)
),
// 6. Core inserted
list(
Co_DESC = "A naked space pod with a loose core.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/crowbar,
Co_VIS_MSG = "{USER} delicately remove{s} the core from {HOLDER} with a crowbar."
),
Co_NEXTSTEP = list(
Co_KEY = /obj/item/weapon/wrench,
Co_VIS_MSG = "{USER} secure{s} the core's bolts."
)
),
// 5. Circuit secured
list(
Co_DESC = "A wired pod frame with a secured mainboard.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/screwdriver,
Co_VIS_MSG = "{USER} unsecure{s} the mainboard."
),
Co_NEXTSTEP = list(
Co_KEY = /obj/item/pod_parts/core,
Co_VIS_MSG = "{USER} insert{s} the core into {HOLDER}.",
Co_AMOUNT = 1,
Co_KEEP
)
),
// 4. Circuit added
list(
Co_DESC = "A wired pod frame with a loose mainboard.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/crowbar,
Co_VIS_MSG = "{USER} prie{s} out the mainboard."
),
Co_NEXTSTEP = list(
Co_KEY = /obj/item/weapon/screwdriver,
Co_VIS_MSG = "{USER} secure{s} the mainboard."
)
),
// 3. Cleanly wired
list(
Co_DESC = "A wired pod frame.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/screwdriver,
Co_VIS_MSG = "{USER} unclip{s} {HOLDER}'s wiring harnesses."
),
Co_NEXTSTEP = list(
Co_KEY = /obj/item/weapon/circuitboard/mecha/pod,
Co_VIS_MSG = "{USER} insert{s} the mainboard into {HOLDER}.",
Co_AMOUNT = 1,
Co_KEEP
)
),
// 2. Crudely Wired
list(
Co_DESC = "A crudely-wired pod frame.",
Co_BACKSTEP = list(
Co_KEY = /obj/item/weapon/wirecutters,
Co_VIS_MSG = "{USER} cut{s} out {HOLDER}'s wiring."
),
Co_NEXTSTEP = list(
Co_KEY = /obj/item/weapon/screwdriver,
Co_VIS_MSG = "{USER} adjust{s} the wiring."
)
),
// 1. Initial state
list(
Co_DESC = "An empty pod frame.",
Co_NEXTSTEP = list(
Co_KEY = /obj/item/stack/cable_coil,
Co_VIS_MSG = "{USER} wire{s} {HOLDER}.",
Co_AMOUNT = 10
)
)
// EOF
)
spawn_result(mob/user as mob)
..()
feedback_inc("spacepod_created",1)
return
/datum/construction/reversible/pod/spawn_result(mob/user as mob)
..()
feedback_inc("spacepod_created",1)
return
/datum/construction/reversible/pod/custom_action(index, diff, atom/used_atom, mob/user)
if(!..())
return 0
holder.icon_state = "pod_[steps.len - index + 1 - diff]"
return 1
/datum/construction/reversible/pod/action(atom/used_atom,mob/user)
return check_step(used_atom,user)