OH GOD YOU CAN BUILD PODS NOW OH GOD

Conflicts:
	code/datums/helper_datums/construction_datum.dm
	code/game/machinery/constructable_frame.dm
	code/game/mecha/mech_fabricator.dm
	code/game/mecha/mecha_construction_paths.dm
	code/game/mecha/mecha_parts.dm
	html/changelog.html
	maps/tgstation.2.1.0.0.1.dmm
This commit is contained in:
Rob Nelson
2014-05-17 19:05:08 -04:00
committed by ZomgPonies
parent bfdf7cc217
commit e7d4c1db14
10 changed files with 468 additions and 71 deletions
@@ -13,6 +13,10 @@
var/list/req_component_names = null
var/state = 1
// For pods
var/list/connected_parts = list()
var/pattern_idx=0
proc/update_desc()
var/D
if(req_components)
@@ -28,6 +32,48 @@
desc = D
/obj/machinery/constructable_frame/machine_frame
proc/find_square()
// This is fucking stupid but what the hell.
// This corresponds to indicies from alldirs.
// 1 2 3 4 5 6 7 8
// var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
var/valid_patterns=list(
list(1,3,5), //SW - NORTH,EAST,NORTHEAST
list(2,3,7), //NW - SOUTH,EAST,SOUTHEAST
list(1,4,6), //SE - NORTH,WEST,NORTHWEST
list(2,4,8) //NE - SOUTH,WEST,SOUTHWEST
)
var/detected_parts[8]
var/tally=0
var/turf/T
var/obj/machinery/constructable_frame/machine_frame/friend
for(var/i=1;i<=8;i++)
T=get_step(src.loc,alldirs[i])
friend = locate() in T
if(friend)
detected_parts[i]=friend
tally++
// Need at least 3 connections to make a square
if(tally<3)
return
// Find stuff in the patterns indicated
for(var/i=1;i<=4;i++)
var/list/scanidxs=valid_patterns[i]
var/list/new_connected=list()
var/allfound=1
for(var/diridx in scanidxs)
if(detected_parts[diridx]==null)
allfound=0
break
new_connected.Add(detected_parts[diridx])
if(allfound)
connected_parts=new_connected
pattern_idx=i
return 1
return 0
attackby(obj/item/P as obj, mob/user as mob)
if(P.crit_fail)
user << "\red This part is faulty, you cannot add this to the machine!"
@@ -46,6 +92,48 @@
user << "\blue You add cables to the frame."
state = 2
icon_state = "box_1"
/*
else if(istype(P, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G=P
if(G.amount<1)
user << "\red How...?"
return
G.use(1)
user << "\blue You add the glass to the frame."
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
new /obj/structure/displaycase_frame(src.loc)
del(src)
return*/
else if(istype(P, /obj/item/stack/rods))
var/obj/item/stack/rods/R=P
if(R.amount<10)
user << "\red You need 10 rods to assemble a pod frame."
return
if(!find_square())
user << "\red You cannot assemble a pod frame without a 2x2 square of machine frames."
return
R.use(10)
for(var/obj/machinery/constructable_frame/machine_frame/F in connected_parts)
qdel(F)
var/turf/T=get_turf(src)
// Offset frame (if needed) so it doesn't look wonky when it spawns.
switch(pattern_idx)
if(2)
T=get_step(T,SOUTH)
if(3)
T=get_step(T,WEST)
if(4)
T=get_step(T,SOUTHWEST)
new /obj/structure/spacepod_frame(T)
user << "\blue You assemble the pod frame."
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
qdel(src)
return
else
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
+3 -4
View File
@@ -129,10 +129,9 @@
/obj/item/borg/upgrade/jetpack
),
"Space Pod" = list(
/obj/item/pod_parts/core
),
"Misc"=list(/obj/item/mecha_parts/mecha_tracking)
)
+1 -66
View File
@@ -2,72 +2,7 @@
///// Construction datums //////
////////////////////////////////
/datum/construction/mecha/custom_action(step, atom/used_atom, mob/user)
if(istype(used_atom, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = used_atom
if (W.remove_fuel(0, user))
playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else
return 0
else if(istype(used_atom, /obj/item/weapon/wrench))
playsound(holder, 'sound/items/Ratchet.ogg', 50, 1)
else if(istype(used_atom, /obj/item/weapon/screwdriver))
playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1)
else if(istype(used_atom, /obj/item/weapon/wirecutters))
playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1)
else if(istype(used_atom, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = used_atom
if(C.amount<4)
user << ("There's not enough cable to finish the task.")
return 0
else
C.use(4)
playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1)
else if(istype(used_atom, /obj/item/stack))
var/obj/item/stack/S = used_atom
if(S.amount < 5)
user << ("There's not enough material in this stack.")
return 0
else
S.use(5)
return 1
/datum/construction/reversible/mecha/custom_action(index as num, diff as num, atom/used_atom, mob/user as mob)
if(istype(used_atom, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = used_atom
if (W.remove_fuel(0, user))
playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else
return 0
else if(istype(used_atom, /obj/item/weapon/wrench))
playsound(holder, 'sound/items/Ratchet.ogg', 50, 1)
else if(istype(used_atom, /obj/item/weapon/screwdriver))
playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1)
else if(istype(used_atom, /obj/item/weapon/wirecutters))
playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1)
else if(istype(used_atom, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = used_atom
if(C.amount<4)
user << ("There's not enough cable to finish the task.")
return 0
else
C.use(4)
playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1)
else if(istype(used_atom, /obj/item/stack))
var/obj/item/stack/S = used_atom
if(S.amount < 5)
user << ("There's not enough material in this stack.")
return 0
else
S.use(5)
return 1
// custom_actions moved to construction_datum - N3X
/datum/construction/mecha/ripley_chassis
steps = list(list("key"=/obj/item/mecha_parts/part/ripley_torso),//1
+4
View File
@@ -479,4 +479,8 @@
name = "Circuit board (Odysseus Central Control module)"
icon_state = "mainboard"
pod
name = "Circuit board (Space Pod Mainboard)"
icon_state = "mainboard"