Lavaland Lag Fix (#51)
lavaland lag fix motion trackers salvaging hardsuits
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
new /datum/data/mining_equipment("Stabilizing Serum", /obj/item/weapon/hivelordstabilizer , 400),
|
||||
new /datum/data/mining_equipment("Fulton Beacon", /obj/item/fulton_core , 400),
|
||||
new /datum/data/mining_equipment("Shelter Capsule", /obj/item/weapon/survivalcapsule , 400),
|
||||
new /datum/data/mining_equipment("Motion Tracker", /obj/item/device/t_scanner/motionTracker , 400),
|
||||
new /datum/data/mining_equipment("GAR scanners", /obj/item/clothing/glasses/meson/gar, 500),
|
||||
new /datum/data/mining_equipment("Explorer's Webbing", /obj/item/weapon/storage/belt/mining, 500),
|
||||
new /datum/data/mining_equipment("Survival Medipen", /obj/item/weapon/reagent_containers/hypospray/medipen/survival, 500),
|
||||
@@ -159,33 +160,38 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/proc/RedeemVoucher(obj/item/weapon/mining_voucher/voucher, mob/redeemer)
|
||||
var/items = list("Survival Capsule and Explorer's Webbing", "Resonator and Advanced Scanner", "Mining Drone", "Medivac Kit", "Extraction Kit", "Crusher Kit")
|
||||
var/items = list("Crusher Kit", "Extraction Kit", "Hunter Kit", "Medivac Kit", "Mining Drone", "Resonator and Advanced Scanner", "Survival Capsule and Explorer's Webbing")//Alphabetical, please.
|
||||
|
||||
var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") as null|anything in items
|
||||
if(!selection || !Adjacent(redeemer) || qdeleted(voucher) || voucher.loc != redeemer)
|
||||
return
|
||||
switch(selection)
|
||||
if("Survival Capsule and Explorer's Webbing")
|
||||
new /obj/item/weapon/storage/belt/mining/vendor(src.loc)
|
||||
if("Resonator and Advanced Scanner")
|
||||
new /obj/item/weapon/resonator(src.loc)
|
||||
new /obj/item/device/t_scanner/adv_mining_scanner(src.loc)
|
||||
if("Mining Drone")
|
||||
new /mob/living/simple_animal/hostile/mining_drone(src.loc)
|
||||
new /obj/item/weapon/weldingtool/hugetank(src.loc)
|
||||
switch(selection)//Alphabetical, please.
|
||||
if("Crusher Kit")
|
||||
new /obj/item/weapon/twohanded/required/mining_hammer(loc)
|
||||
new /obj/item/weapon/storage/belt/mining/alt(loc)
|
||||
new /obj/item/weapon/extinguisher/mini(loc)
|
||||
if("Extraction Kit")
|
||||
new /obj/item/stack/sheet/metal/five(loc)
|
||||
new /obj/item/weapon/extraction_pack(loc)
|
||||
new /obj/item/fulton_core(loc)
|
||||
if("Hunter Kit")
|
||||
new /obj/item/weapon/storage/belt/mining(loc)
|
||||
new /obj/item/device/t_scanner/motionTracker(loc)
|
||||
new /obj/item/weapon/stock_parts/cell/high/plus(loc)
|
||||
new /obj/item/weapon/screwdriver(loc)
|
||||
if("Medivac Kit")
|
||||
new /obj/item/stack/sheet/metal/five(loc)
|
||||
new /obj/item/fulton_core(loc)
|
||||
new /obj/item/weapon/extraction_pack/medivac(loc)
|
||||
new /obj/item/weapon/reagent_containers/hypospray/medipen/survival(loc)
|
||||
if("Extraction Kit")
|
||||
new /obj/item/stack/sheet/metal/five(loc)
|
||||
new /obj/item/weapon/extraction_pack(loc)
|
||||
new /obj/item/fulton_core(loc)
|
||||
if("Crusher Kit")
|
||||
new /obj/item/weapon/twohanded/required/mining_hammer(loc)
|
||||
new /obj/item/weapon/storage/belt/mining/alt(loc)
|
||||
new /obj/item/weapon/extinguisher/mini(loc)
|
||||
if("Mining Drone")
|
||||
new /mob/living/simple_animal/hostile/mining_drone(loc)
|
||||
new /obj/item/weapon/weldingtool/hugetank(loc)
|
||||
if("Resonator and Advanced Scanner")
|
||||
new /obj/item/weapon/resonator(src.loc)
|
||||
new /obj/item/device/t_scanner/adv_mining_scanner(loc)
|
||||
if("Survival Capsule and Explorer's Webbing")
|
||||
new /obj/item/weapon/storage/belt/mining/vendor(loc)
|
||||
|
||||
feedback_add_details("mining_voucher_redeemed", selection)
|
||||
qdel(voucher)
|
||||
|
||||
@@ -492,3 +492,150 @@
|
||||
anchored = 1
|
||||
layer = BELOW_MOB_LAYER
|
||||
density = 0
|
||||
|
||||
//////////////////////
|
||||
////MOTION TRACKER////
|
||||
//////////////////////
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker
|
||||
name = "motion tracker"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "tracker"
|
||||
desc = "A nifty handheld motion tracker. Requires meson scanners to function properly."
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
var/cooldown = 35
|
||||
var/on_cooldown = 0
|
||||
var/range = 7
|
||||
var/meson = FALSE
|
||||
var/obj/item/weapon/stock_parts/cell/cell = new
|
||||
var/cellcharge
|
||||
var/cellmaxcharge
|
||||
var/soundDetect = 'sound/effects/trackFull.ogg'
|
||||
var/soundNoDetect = 'sound/effects/trackHalf.ogg'
|
||||
var/soundToggle = 'sound/effects/switch.ogg'
|
||||
var/powerReq = 10
|
||||
origin_tech = "engineering=3;magnets=4"
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker/New()
|
||||
cellcharge = cell.charge
|
||||
cellmaxcharge = cell.maxcharge
|
||||
updateicon()
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker/process()
|
||||
updateicon()
|
||||
if(!on || !cell)
|
||||
on = 0
|
||||
SSobj.processing.Remove(src)
|
||||
return
|
||||
if(cell.charge > powerReq)
|
||||
scan()
|
||||
cell.charge -= powerReq
|
||||
if(cell.charge < powerReq)
|
||||
playsound(get_turf(src),'sound/machines/twobeep.ogg', 15, 0 , -5)
|
||||
on = 0
|
||||
SSobj.processing.Remove(src)
|
||||
if(cell.charge <= 0)//In the event we have negative energy, somehow.
|
||||
cell.charge = 0
|
||||
updateicon()
|
||||
cellcharge = cell.charge
|
||||
cellmaxcharge = cell.maxcharge
|
||||
cell.updateicon()
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker/attack_self(mob/user)
|
||||
add_fingerprint(usr)
|
||||
updateicon()
|
||||
if(!cell)
|
||||
user << text("<span class='warning'>[src] has no power supply.</span>")
|
||||
return
|
||||
playsound(get_turf(src), soundToggle, 100, 0, -5)
|
||||
if(cell.charge < powerReq)
|
||||
user << text("<span class='warning'>The power light on [src] flashes.</span>")
|
||||
return
|
||||
else if(cell.charge > powerReq)
|
||||
on = !on
|
||||
if(on)
|
||||
user << text("<span class='notice'>You turn on [src].</span>")
|
||||
SSobj.processing |= src
|
||||
if(!on)
|
||||
user << text("<span class='notice'>You turn off [src].</span>")
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker/proc/updateicon()
|
||||
if(cell && cellcharge)
|
||||
if(cell && cell.charge < (cell.maxcharge/5))
|
||||
icon_state = "trackerLow"
|
||||
else if(cell && cell.charge < (cell.maxcharge/2))
|
||||
icon_state = "trackerHalf"
|
||||
else if(cell && cell.charge > (cell.maxcharge/2))
|
||||
icon_state = "trackerFull"
|
||||
if(!cellcharge || !cell || cellcharge < powerReq)
|
||||
icon_state = "trackerEmpty"
|
||||
..()
|
||||
/obj/item/device/t_scanner/motionTracker/scan(mob/living/carbon/user)
|
||||
if(!on_cooldown)
|
||||
on_cooldown = 1
|
||||
spawn(cooldown)
|
||||
on_cooldown = 0
|
||||
var/turf/t = get_turf(src)
|
||||
var/list/mobs = recursive_mob_check(t, 1,0,0)
|
||||
if(!mobs.len)
|
||||
return
|
||||
motionTrackScan(mobs, range)
|
||||
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker/proc/motionTrackScan(var/list/mobs, var/range)
|
||||
var/mobsfar = 0
|
||||
for(var/turf/T in range(7, get_turf(src)) )
|
||||
for(var/mob/O in T.contents)
|
||||
var/mob/living/L = locate() in T
|
||||
if(L && (get_turf(L) != get_turf(src)) && !L.stat)
|
||||
flick_blip(O.loc)
|
||||
mobsfar = 1
|
||||
if(mobsfar)
|
||||
playsound(get_turf(src),'sound/effects/trackFull.ogg', 15, 0, -5)
|
||||
if(!mobsfar)
|
||||
playsound(get_turf(src),'sound/effects/trackHalf.ogg', 10, 0, -5)
|
||||
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker/proc/flick_blip(turf/T)
|
||||
var/image/B = image('icons/obj/mining.dmi', T, icon_state = "blip")
|
||||
var/list/nearby = list()
|
||||
for(var/mob/M in viewers(T))
|
||||
if(M.client)
|
||||
nearby |= M.client
|
||||
flick_overlay(B,nearby, 8)
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/screwdriver) && cell)
|
||||
user << text("<span class='notice'>You detach [cell] from [src].</span>")
|
||||
cell.loc = get_turf(src)
|
||||
cell = null
|
||||
cellcharge = 0
|
||||
cellmaxcharge = 0
|
||||
if(on)
|
||||
on = 0
|
||||
updateicon()
|
||||
cell.updateicon()
|
||||
if(istype(I, /obj/item/weapon/stock_parts/cell))
|
||||
if(cell)
|
||||
user << text("<span class='notice'>[src] already has a power supply installed.</span>")
|
||||
else
|
||||
if(!user.drop_item())//This is dumb. You should be able to move a held object without having to drop it.
|
||||
return
|
||||
I.loc = src
|
||||
cell = I
|
||||
user.visible_message(\
|
||||
"[user.name] has inserted the power cell into [src.name].",\
|
||||
"<span class='notice'>You install [cell.name] into [src]</span>")
|
||||
cellcharge = cell.charge
|
||||
cellmaxcharge = cell.maxcharge
|
||||
updateicon()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/device/t_scanner/motionTracker/examine(mob/user)
|
||||
..()
|
||||
if(cell)
|
||||
user << text("<span class='notice'>[src] has [cellcharge]/[cellmaxcharge] charge remaining.</span>")
|
||||
else
|
||||
user << text("<span class='notice'>[src] has no power supply installed.</span>")
|
||||
@@ -339,7 +339,7 @@
|
||||
new turf_type(T)
|
||||
/turf/open/floor/plating/asteroid/airless/cave/proc/SpawnMonster(turf/T)
|
||||
if(prob(30))
|
||||
if(istype(loc, /area/mine/explored) || istype(loc, /area/lavaland/surface/outdoors/explored))
|
||||
if(istype(loc, /area/mine/explored))
|
||||
return
|
||||
for(var/atom/A in urange(12,T))//Lowers chance of mob clumps
|
||||
if(istype(A, /mob/living/simple_animal/hostile/asteroid))
|
||||
@@ -619,15 +619,14 @@
|
||||
|
||||
/turf/open/floor/plating/asteroid/basalt/lava_land_surface
|
||||
initial_gas_mix = "o2=14;n2=23;TEMP=300"
|
||||
planetary_atmos = TRUE
|
||||
baseturf = /turf/open/floor/plating/lava/smooth/lava_land_surface
|
||||
|
||||
/turf/open/chasm/straight_down/lava_land_surface
|
||||
initial_gas_mix = "o2=14;n2=23;TEMP=300"
|
||||
planetary_atmos = TRUE
|
||||
baseturf = /turf/open/chasm/straight_down/lava_land_surface
|
||||
|
||||
/turf/open/chasm/straight_down/lava_land_surface/normal_air
|
||||
initial_gas_mix = "o2=22;n2=82;TEMP=293.15"
|
||||
|
||||
/turf/open/chasm/straight_down/lava_land_surface/drop(atom/movable/AM)
|
||||
if(!AM.invisibility)
|
||||
AM.visible_message("<span class='boldwarning'>[AM] falls into [src]!</span>", "<span class='userdanger'>You stumble and stare into an abyss before you. It stares back, and you fall \
|
||||
@@ -677,6 +676,7 @@
|
||||
|
||||
/turf/open/floor/plating/lava/smooth/lava_land_surface
|
||||
initial_gas_mix = "o2=14;n2=23;TEMP=300"
|
||||
planetary_atmos = TRUE
|
||||
baseturf = /turf/open/chasm/straight_down/lava_land_surface
|
||||
|
||||
/turf/closed/mineral/gibtonite/volcanic
|
||||
@@ -762,6 +762,7 @@
|
||||
baseturf = /turf/open/floor/plating/ash //I assume this will be a chasm eventually, once this becomes an actual surface
|
||||
slowdown = 1
|
||||
initial_gas_mix = "o2=14;n2=23;TEMP=300"
|
||||
planetary_atmos = TRUE
|
||||
|
||||
/turf/open/floor/plating/ash/New()
|
||||
pixel_y = -4
|
||||
|
||||
Reference in New Issue
Block a user