mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Added supply beacon.
This commit is contained in:
@@ -401,6 +401,7 @@
|
||||
#include "code\game\machinery\status_display_ai.dm"
|
||||
#include "code\game\machinery\suit_storage_unit.dm"
|
||||
#include "code\game\machinery\supply_display.dm"
|
||||
#include "code\game\machinery\supplybeacon.dm"
|
||||
#include "code\game\machinery\syndicatebeacon.dm"
|
||||
#include "code\game\machinery\teleporter.dm"
|
||||
#include "code\game\machinery\turret_control.dm"
|
||||
|
||||
117
code/game/machinery/supplybeacon.dm
Normal file
117
code/game/machinery/supplybeacon.dm
Normal file
@@ -0,0 +1,117 @@
|
||||
// Used to deploy the bacon.
|
||||
/obj/item/supply_beacon
|
||||
name = "inactive supply beacon"
|
||||
icon = 'icons/obj/supplybeacon.dmi'
|
||||
icon_state = "beacon"
|
||||
var/deploy_path = /obj/machinery/power/supply_beacon
|
||||
var/deploy_time = 30
|
||||
|
||||
/obj/item/supply_beacon/supermatter
|
||||
name = "inactive supermatter supply beacon"
|
||||
deploy_path = /obj/machinery/power/supply_beacon/supermatter
|
||||
|
||||
/obj/item/supply_beacon/attack_self(var/mob/user)
|
||||
user.visible_message("<span class='notice'>\The [user] begins setting up \the [src].</span>")
|
||||
if(!do_after(user, deploy_time))
|
||||
return
|
||||
var/obj/S = new deploy_path(get_turf(user))
|
||||
user.visible_message("<span class='notice'>\The [user] deploys \the [S].</span>")
|
||||
user.unEquip(src)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/power/supply_beacon
|
||||
name = "supply beacon"
|
||||
desc = "A bulky moonshot supply beacon. Someone has been messing with the wiring."
|
||||
icon = 'icons/obj/supplybeacon.dmi'
|
||||
icon_state = "beacon"
|
||||
|
||||
anchored = 0
|
||||
density = 1
|
||||
layer = MOB_LAYER - 0.1
|
||||
stat = 0
|
||||
|
||||
var/target_drop_time
|
||||
var/drop_delay = 450
|
||||
var/expended
|
||||
var/drop_type
|
||||
|
||||
/obj/machinery/power/supply_beacon/New()
|
||||
..()
|
||||
if(!drop_type) drop_type = pick(supply_drop_random_loot_types)
|
||||
|
||||
/obj/machinery/power/supply_beacon/supermatter
|
||||
name = "supermatter supply beacon"
|
||||
drop_type = "supermatter"
|
||||
|
||||
/obj/machinery/power/supply_beacon/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
if(!use_power && istype(W, /obj/item/weapon/wrench))
|
||||
if(!anchored && !connect_to_network())
|
||||
user << "<span class='warning'>This device must be placed over an exposed cable.</span>"
|
||||
return
|
||||
anchored = !anchored
|
||||
user.visible_message("<span class='notice'>\The [user] [anchored ? "secures" : "unsecures"] \the [src].")
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/supply_beacon/attack_hand(var/mob/user)
|
||||
|
||||
if(expended)
|
||||
use_power = 0
|
||||
user << "<span class='warning'>\The [src] has used up its charge.</span>"
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
return use_power ? deactivate(user) : activate(user)
|
||||
else
|
||||
user << "<span class='warning'>You need to secure the beacon with a wrench first!</span>"
|
||||
return
|
||||
|
||||
/obj/machinery/power/supply_beacon/attack_ai(var/mob/user)
|
||||
if(user.Adjacent(src))
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/power/supply_beacon/proc/activate(var/mob/user)
|
||||
if(expended)
|
||||
return
|
||||
if(surplus() < 500)
|
||||
if(user) user << "<span class='notice'>The connected wire doesn't have enough current.</span>"
|
||||
return
|
||||
set_light(3, 3, "#00CCAA")
|
||||
icon_state = "beacon_active"
|
||||
use_power = 1
|
||||
machines |= src
|
||||
if(user) user << "<span class='notice'>You activate the beacon. The supply drop will be dispatched soon.</span>"
|
||||
|
||||
/obj/machinery/power/supply_beacon/proc/deactivate(var/mob/user, var/permanent)
|
||||
if(permanent)
|
||||
expended = 1
|
||||
icon_state = "beacon_depleted"
|
||||
else
|
||||
icon_state = "beacon"
|
||||
set_light(0)
|
||||
use_power = 0
|
||||
target_drop_time = null
|
||||
if(user) user << "<span class='notice'>You deactivate the beacon.</span>"
|
||||
|
||||
/obj/machinery/power/supply_beacon/Destroy()
|
||||
if(use_power)
|
||||
deactivate()
|
||||
..()
|
||||
|
||||
/obj/machinery/power/supply_beacon/process()
|
||||
if(!use_power || expended)
|
||||
return PROCESS_KILL
|
||||
if(draw_power(500) < 500)
|
||||
deactivate()
|
||||
return
|
||||
if(!target_drop_time)
|
||||
target_drop_time = world.time + drop_delay
|
||||
else if(world.time >= target_drop_time)
|
||||
deactivate(permanent = 1)
|
||||
var/drop_x = src.x-2
|
||||
var/drop_y = src.y-2
|
||||
var/drop_z = src.z
|
||||
command_announcement.Announce("Nyx Rapid Fabrication priority supply request #[rand(1000,9999)]-[rand(100,999)] recieved. Shipment dispatched via ballistic supply pod for immediate delivery. Have a nice day.", "Thank You For Your Patronage")
|
||||
spawn(rand(100,300))
|
||||
new /datum/random_map/droppod/supply(null, drop_x, drop_y, drop_z, supplied_drop = drop_type) // Splat.
|
||||
@@ -41,3 +41,5 @@
|
||||
..(newloc,"voxalloy")
|
||||
/turf/simulated/wall/voxshuttle/attackby()
|
||||
return
|
||||
/turf/simulated/wall/titanium/New(var/newloc)
|
||||
..(newloc,"titanium")
|
||||
|
||||
@@ -346,6 +346,14 @@ var/list/name_to_material
|
||||
stack_origin_tech = list(TECH_MATERIAL = 2)
|
||||
composite_material = list(DEFAULT_WALL_MATERIAL = 3750, "platinum" = 3750) //todo
|
||||
|
||||
/material/plasteel/titanium
|
||||
name = "titanium"
|
||||
stack_type = null
|
||||
icon_base = "metal"
|
||||
door_icon_base = "metal"
|
||||
icon_colour = "#D1E6E3"
|
||||
icon_reinf = "reinf_metal"
|
||||
|
||||
/material/glass
|
||||
name = "glass"
|
||||
stack_type = /obj/item/stack/material/glass
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#define SD_DOOR_TILE 2
|
||||
#define SD_EMPTY_TILE 3
|
||||
#define SD_SUPPLY_TILE 7
|
||||
|
||||
var/global/list/supply_drop_random_loot_types = list(
|
||||
"guns",
|
||||
"seeds",
|
||||
@@ -23,15 +24,17 @@ var/global/list/supply_drop_random_loot_types = list(
|
||||
limit_y = 3
|
||||
preserve_map = 0
|
||||
|
||||
wall_type = /turf/simulated/wall/voxshuttle
|
||||
wall_type = /turf/simulated/wall/titanium
|
||||
floor_type = /turf/simulated/floor/engine
|
||||
var/list/supplied_drop_types = list()
|
||||
var/door_type = /obj/structure/droppod_door
|
||||
var/drop_type = /mob/living/simple_animal/parrot
|
||||
|
||||
var/has_pod_doors
|
||||
var/auto_open_doors
|
||||
|
||||
var/placement_explosion_dev = 2
|
||||
var/placement_explosion_heavy = 4
|
||||
var/placement_explosion_dev = 1
|
||||
var/placement_explosion_heavy = 2
|
||||
var/placement_explosion_light = 6
|
||||
var/placement_explosion_flash = 4
|
||||
|
||||
@@ -96,7 +99,6 @@ var/global/list/supply_drop_random_loot_types = list(
|
||||
if(istype(T))
|
||||
explosion(T, placement_explosion_dev, placement_explosion_heavy, placement_explosion_light, placement_explosion_flash)
|
||||
sleep(5) // Let the explosion finish proccing before we ChangeTurf(), otherwise it might destroy our spawned objects.
|
||||
sleep(-1)
|
||||
return ..()
|
||||
|
||||
/datum/random_map/droppod/get_appropriate_path(var/value)
|
||||
@@ -104,6 +106,8 @@ var/global/list/supply_drop_random_loot_types = list(
|
||||
return floor_type
|
||||
else if(value == SD_WALL_TILE)
|
||||
return wall_type
|
||||
else if(value == SD_DOOR_TILE && !has_pod_doors)
|
||||
return wall_type
|
||||
return null
|
||||
|
||||
// Pods are circular. Get the direction this object is facing from the center of the pod.
|
||||
@@ -132,7 +136,7 @@ var/global/list/supply_drop_random_loot_types = list(
|
||||
qdel(A)
|
||||
|
||||
// Also spawn doors and loot.
|
||||
if(value == SD_DOOR_TILE)
|
||||
if(value == SD_DOOR_TILE && has_pod_doors)
|
||||
var/obj/structure/S = new door_type(T, auto_open_doors)
|
||||
S.set_dir(spawn_dir)
|
||||
|
||||
@@ -242,4 +246,4 @@ var/global/list/supply_drop_random_loot_types = list(
|
||||
else
|
||||
return
|
||||
|
||||
new /datum/random_map/droppod(null, usr.x-2, usr.y-2, usr.z, supplied_drops = spawned_mobs, automated = automatic_pod)
|
||||
new /datum/random_map/droppod(null, usr.x-1, usr.y-1, usr.z, supplied_drops = spawned_mobs, automated = automatic_pod)
|
||||
@@ -3,8 +3,6 @@
|
||||
limit_x = 5
|
||||
limit_y = 5
|
||||
|
||||
placement_explosion_dev = 3
|
||||
placement_explosion_heavy = 5
|
||||
placement_explosion_light = 7
|
||||
placement_explosion_flash = 5
|
||||
|
||||
@@ -28,6 +26,10 @@
|
||||
drop_type = pick(supply_drop_random_loot_types)
|
||||
|
||||
switch(drop_type)
|
||||
|
||||
if("supermatter")
|
||||
new /obj/machinery/power/supermatter(T)
|
||||
|
||||
if("lasers")
|
||||
var/obj/structure/largecrate/C = new(T)
|
||||
new /obj/item/weapon/gun/energy/laser(C)
|
||||
|
||||
BIN
icons/obj/supplybeacon.dmi
Normal file
BIN
icons/obj/supplybeacon.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
Reference in New Issue
Block a user