[READY]Cargo Update: Nanotrasen Supply Drop Pods!

This commit is contained in:
oranges
2018-01-10 12:06:39 +13:00
committed by CitadelStationBot
parent dfe39e7a1d
commit 1f88c0c660
16 changed files with 2308 additions and 1890 deletions
@@ -188,21 +188,33 @@
build_path = /obj/machinery/computer/cargo
var/contraband = FALSE
/obj/item/circuitboard/computer/cargo/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/device/multitool))
if(!emagged)
contraband = !contraband
to_chat(user, "<span class='notice'>Receiver spectrum set to [contraband ? "Broad" : "Standard"].</span>")
else
to_chat(user, "<span class='notice'>The spectrum chip is unresponsive.</span>")
else if(istype(I, /obj/item/card/emag))
if(!emagged)
contraband = TRUE
emagged = TRUE
to_chat(user, "<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
/obj/item/circuitboard/computer/cargo/multitool_act(mob/living/user)
if(!emagged)
contraband = !contraband
to_chat(user, "<span class='notice'>Receiver spectrum set to [contraband ? "Broad" : "Standard"].</span>")
else
return ..()
to_chat(user, "<span class='notice'>The spectrum chip is unresponsive.</span>")
/obj/item/circuitboard/computer/cargo/emag_act(mob/living/user)
if(!emagged)
contraband = TRUE
emagged = TRUE
to_chat(user, "<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
/obj/item/circuitboard/computer/cargo/express
name = "Express Supply Console (Computer Board)"
build_path = /obj/machinery/computer/cargo/express
/obj/item/circuitboard/computer/cargo/express/multitool_act(mob/living/user)
if (!emagged)
to_chat(user, "<span class='notice'>Routing protocols are already set to: \"factory defaults\".</span>")
else
to_chat(user, "<span class='notice'>You reset the routing protocols to: \"factory defaults\".</span>")
emagged = FALSE
/obj/item/circuitboard/computer/cargo/express/emag_act(mob/living/user)
to_chat(user, "<span class='notice'>You change the routing protocols, allowing the Drop Pod to land anywhere on the station.</span>")
emagged = TRUE
/obj/item/circuitboard/computer/cargo/request
name = "Supply Request Console (Computer Board)"
@@ -18,6 +18,7 @@
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
force = 5
w_class = WEIGHT_CLASS_SMALL
tool_behaviour = TOOL_MULTITOOL
throwforce = 0
throw_range = 7
throw_speed = 3
@@ -132,7 +132,7 @@
if(opened || !can_open(user))
return
playsound(loc, open_sound, 15, 1, -3)
opened = 1
opened = TRUE
if(!dense_when_open)
density = FALSE
climb_time *= 0.5 //it's faster to climb onto an open thing
@@ -185,7 +185,7 @@
take_contents()
playsound(loc, close_sound, 15, 1, -3)
climb_time = initial(climb_time)
opened = 0
opened = FALSE
density = TRUE
update_icon()
return 1
@@ -208,6 +208,10 @@
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
if(user in src)
return
if(!src.tool_interact(W,user))
return ..()
/obj/structure/closet/proc/tool_interact(obj/item/W, mob/user)//returns TRUE if attackBy call shouldnt be continued (because tool was used/closet was of wrong type), FALSE if otherwise
if(opened)
if(istype(W, cutting_tool))
if(istype(W, /obj/item/weldingtool))
@@ -217,29 +221,29 @@
playsound(loc, cutting_sound, 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(!opened || !WT.isOn())
return
return TRUE
playsound(loc, cutting_sound, 50, 1)
user.visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [WT].</span>",
"<span class='italics'>You hear welding.</span>")
deconstruct(TRUE)
return 0
return TRUE
else // for example cardboard box is cut with wirecutters
user.visible_message("<span class='notice'>[user] cut apart \the [src].</span>", \
"<span class='notice'>You cut \the [src] apart with \the [W].</span>")
deconstruct(TRUE)
return 0
return TRUE
if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
return 1
return TRUE
else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
var/obj/item/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
return
return TRUE
to_chat(user, "<span class='notice'>You begin [welded ? "unwelding":"welding"] \the [src]...</span>")
playsound(loc, 'sound/items/welder2.ogg', 40, 1)
if(do_after(user, 40*WT.toolspeed, 1, target = src))
if(opened || !WT.isOn())
return
return TRUE
playsound(loc, WT.usesound, 50, 1)
welded = !welded
user.visible_message("<span class='notice'>[user] [welded ? "welds shut" : "unweldeds"] \the [src].</span>",
@@ -248,7 +252,7 @@
update_icon()
else if(istype(W, /obj/item/wrench) && anchorable)
if(isinspace() && !anchored)
return
return TRUE
anchored = !anchored
playsound(src.loc, W.usesound, 75, 1)
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
@@ -257,9 +261,9 @@
else if(user.a_intent != INTENT_HARM && !(W.flags_1 & NOBLUDGEON_1))
if(W.GetID() || !toggle(user))
togglelock(user)
return 1
return TRUE
else
return ..()
return FALSE
/obj/structure/closet/MouseDrop_T(atom/movable/O, mob/living/user)
if(!istype(O) || O.anchored || istype(O, /obj/screen))
@@ -0,0 +1,92 @@
//The "BDPtarget" temp visual is created by the expressconsole, which in turn makes two things: a falling droppod animation, and the droppod itself.
//------------------------------------BLUESPACE DROP POD-------------------------------------//
/obj/structure/closet/bsdroppod
name = "Bluespace Drop Pod"
desc = "A Nanotrasen supply drop pod."
icon = 'icons/obj/2x2.dmi'
icon_state = "BDP"
pixel_x = -16//2x2 sprite
pixel_y = -5
layer = TABLE_LAYER//so that the crate inside doesn't appear underneath
allow_objects = TRUE
allow_dense = TRUE
delivery_icon = null
can_weld_shut = FALSE
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 90, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
anchored = TRUE
anchorable = FALSE
var/datum/supply_order/SupplyOrder
/obj/structure/closet/bsdroppod/Initialize(mapload, datum/supply_order/so)
. = ..()
SupplyOrder = so//uses Supply Order passed from expressconsole into BDPtarget
addtimer(CALLBACK(src, .proc/open), 30)//open 3seconds after appearing
/obj/structure/closet/bsdroppod/update_icon()
cut_overlays()
if (opened)
add_overlay("BDP_open")
else
add_overlay("BDP_door")
/obj/structure/closet/bsdroppod/tool_interact(obj/item/W, mob/user)
return TRUE
/obj/structure/closet/bsdroppod/toggle(mob/living/user)
return
/obj/structure/closet/bsdroppod/open()
var/turf/T = get_turf(src)
opened = TRUE
SupplyOrder.generate(T)//not called during populateContents as supplyorder generation requires a turf
update_icon()
playsound(src, open_sound, 15, 1, -3)
addtimer(CALLBACK(src, .proc/sparks), 30)//3 seconds after opening, make some sparks and delete
/obj/structure/closet/bsdroppod/proc/sparks()//sparks cant be called from addtimer
do_sparks(5, TRUE, src)
qdel(src)//no need for QDEL_IN if we already have a timer
/obj/structure/closet/bsdroppod/Destroy()//make some sparks b4 deletion
QDEL_NULL(SupplyOrder)
return ..()
//------------------------------------FALLING BLUESPACE DROP POD-------------------------------------//
/obj/effect/temp_visual/BDPfall
icon = 'icons/obj/2x2.dmi'
icon_state = "BDP_falling"
pixel_x = -16
pixel_y = -5
pixel_z = 200
name = "Bluespace Drop Pod"
desc = "Get out of the way!"
layer = FLY_LAYER//that wasnt flying, that was falling with style!
randomdir = FALSE
//------------------------------------TEMPORARY_VISUAL-------------------------------------//
/obj/effect/BDPtarget
icon = 'icons/mob/actions/actions_items.dmi'
icon_state = "sniper_zoom"
layer = PROJECTILE_HIT_THRESHHOLD_LAYER
light_range = 2
var/obj/effect/temp_visual/fallingPod
/obj/effect/BDPtarget/Initialize(mapload, datum/supply_order/SO)
. = ..()
addtimer(CALLBACK(src, .proc/beginLaunch, SO), 30)//wait 3 seconds
/obj/effect/BDPtarget/proc/beginLaunch(datum/supply_order/SO)
fallingPod = new /obj/effect/temp_visual/BDPfall(drop_location())
animate(fallingPod, pixel_z = 0, time = 3, easing = LINEAR_EASING)//make and animate a falling pod
addtimer(CALLBACK(src, .proc/endLaunch, SO), 3, TIMER_CLIENT_TIME)//fall 0.3seconds
/obj/effect/BDPtarget/proc/endLaunch(datum/supply_order/SO)
new /obj/structure/closet/bsdroppod(drop_location(), SO)//pod is created
explosion(src,0,0,2, flame_range = 2) //explosion and camshake (shoutout to @cyberboss)
qdel(src)
/obj/effect/BDPtarget/Destroy()
QDEL_NULL(fallingPod)//delete falling pod after animation's over
return ..()