Lavaland Lag Fix (#51)

lavaland lag fix
motion trackers
salvaging hardsuits
This commit is contained in:
TalkingCactus
2016-09-22 06:57:19 -04:00
committed by GitHub
parent 829604cdb8
commit 0b21154be4
41 changed files with 8097 additions and 75520 deletions
@@ -30,6 +30,8 @@
var/datum/gas_mixture/air
var/obj/effect/hotspot/active_hotspot
var/atmos_cooldown = 0
var/planetary_atmos = FALSE //air will revert to initial_gas_mix over time
var/list/atmos_overlay_types = list() //gas IDs of current active gas overlays
@@ -129,6 +131,9 @@
var/list/adjacent_turfs = atmos_adjacent_turfs
var/datum/excited_group/our_excited_group = excited_group
var/adjacent_turfs_length = adjacent_turfs.len
atmos_cooldown++
if (planetary_atmos)
adjacent_turfs_length++
for(var/t in adjacent_turfs)
var/turf/open/enemy_tile = t
@@ -179,6 +184,18 @@
/******************* GROUP HANDLING FINISH *********************************************************************/
if (planetary_atmos) //share our air with the "atmosphere" "above" the turf
var/datum/gas_mixture/G = new
G.copy_from_turf(src)
G.archive()
if(air.compare(G))
if(!our_excited_group)
var/datum/excited_group/EG = new
EG.add_turf(src)
our_excited_group = excited_group
air.share(G, adjacent_turfs_length)
last_share_check()
air.react()
update_visuals()
@@ -193,9 +210,12 @@
if(consider_superconductivity(starting = 1))
remove = 0
if (atmos_cooldown > EXCITED_GROUP_DISMANTLE_CYCLES*2)
SSair.remove_from_active(src)
if(!our_excited_group && remove == 1)
SSair.remove_from_active(src)
/turf/open/proc/share_air(turf/open/T, fire_count, adjacent_turfs_length)
if(T.current_cycle < fire_count)
var/difference = air.share(T.air, adjacent_turfs_length)
@@ -217,8 +237,10 @@
/turf/open/proc/last_share_check()
if(air.last_share > MINIMUM_AIR_TO_SUSPEND)
excited_group.reset_cooldowns()
atmos_cooldown = 0
else if(air.last_share > MINIMUM_MOLES_DELTA_TO_MOVE)
excited_group.dismantle_cooldown = 0
atmos_cooldown = 0
/turf/open/proc/high_pressure_movements()
for(var/atom/movable/M in src)
@@ -295,6 +317,7 @@
for(var/t in turf_list)
var/turf/open/T = t
T.air.copy_from(A)
T.atmos_cooldown = 0
T.update_visuals()
breakdown_cooldown = 0
@@ -422,4 +445,4 @@
(heat_capacity*sharer.heat_capacity/(heat_capacity+sharer.heat_capacity))
temperature -= heat/heat_capacity
sharer.temperature += heat/sharer.heat_capacity
sharer.temperature += heat/sharer.heat_capacity
+24 -18
View File
@@ -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)
+147
View File
@@ -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>")
+5 -4
View File
@@ -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
+21
View File
@@ -0,0 +1,21 @@
//Salvaging hardsuit
/obj/item/clothing/head/helmet/space/hardsuit/salvaging
name = "salvaging hardsuit helmet"
desc = "A hardsuit helmet worn by salvaging teams during EVA. Features three viewing ports, a mounted flashlight, adaptive padding, and UV shielding. Also, has radiation and explosion shielding."
icon_state = "hardsuit0-salvage"
item_state = "salvage_helm"
armor = list(melee = 5, bullet = 5, laser = 5, energy = 5, bomb = 80, bio = 100, rad = 40)
item_color = "salvage"
/obj/item/clothing/suit/space/hardsuit/salvaging
name = "salvaging hardsuit"
desc = "A hardsuit worn by salvaging teams during EVA. Features a robust, orange chassis, stylish leather, and comfortable gloves. Also, has radiation and explosion shielding."
icon_state = "hardsuit_salvage"
item_state = "hardsuit_salvage"
armor = list(melee = 5, bullet = 5, laser = 5, energy = 5, bomb = 80, bio = 100, rad = 40)
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/salvaging
/obj/machinery/suit_storage_unit/salvaging
suit_type = /obj/item/clothing/suit/space/hardsuit/salvaging
mask_type = /obj/item/clothing/mask/breath
storage_type = /obj/item/clothing/shoes/magboots
+117
View File
@@ -0,0 +1,117 @@
//Salvaging ship. Large ship used to navigate debris fields. Capable of basic collection, sorting, and refining of scrap.
/obj/mecha/ship
name = "ship"
desc = "A space ship, or something."
//Ship itself
/obj/mecha/ship/salvage
desc = "Powered Space Junk Recycler, revision 1A1, designated \"Scrapper\" by NT and approved for use on their stations. While it doesn't quite roll off the tongue, \
these tough ships are typically used in groups to clear debris fields of precious metals, artifacts, equipment, hardware, and other valuables. They're fitted \
with advanced absorbant armor plates to protect the contents, both living and not, from explosions; a common hazard considering the munitions and fuel used on \
most ships and stations."
name = "\improper PSJR-1A1 \"Scrapper\""
icon_state = "scrapper"
icon = 'icons/salvaging/scrapper.dmi'
step_in = 4
max_temperature = 1000
health = 200
lights_power = 8
deflect_chance = 20
damage_absorption = list("brute"=0.7,"fire"=0.9,"bullet"=0.9,"laser"=0.9,"energy"=1,"bomb"=0.4)
max_equip = 6
wreckage = /obj/structure/mecha_wreckage/scrapper
// bound_height = 64
// bound_width = 96
pixel_x = -48
pixel_y = -48
turnsound = null
stepsound = null
/obj/mecha/ship/salvage/GrantActions(mob/living/user, human_occupant = 0)
..()
thrusters_action.Grant(user, src)
/obj/mecha/ship/salvage/RemoveActions(mob/living/user, human_occupant = 0)
..()
thrusters_action.Remove(user)
/obj/mecha/mechturn()
..()
updatebounds()
/obj/mecha/proc/updatebounds()
/* switch(dir)
if(1)
bound_height = initial(bound_height)
bound_width = initial(bound_width)
if(2)
bound_height = initial(bound_height)
bound_width = initial(bound_width)
if(4)
bound_height = initial(bound_width)
bound_width = initial(bound_height)
if(8)
bound_height = initial(bound_width)
bound_width = initial(bound_height)
*/
//Wreckage
/obj/structure/mecha_wreckage/scrapper
name = "scrapper wreckage"
icon_state = "scrapper-broken"
icon = 'icons/salvaging/scrapper.dmi'
/obj/structure/mecha_wreckage/scrapper/New()
..()
var/list/parts = list(/obj/item/mecha_parts/chassis/scrapper,
/obj/item/mecha_parts/part/cockpit,
/obj/item/mecha_parts/part/engine,
/obj/item/mecha_parts/part/lifesupport,
/obj/item/mecha_parts/part/storage,
/obj/item/mecha_parts/part/scrap_refinery)
for(var/i = 0; i < 2; i++)
if(parts.len && prob(40))
var/part = pick(parts)
welder_salvage += part
parts -= part
//Parts
/obj/item/mecha_parts/chassis/scrapper/New()
..()
construct = new /datum/construction/mecha/ripley_chassis(src)
/obj/item/mecha_parts/chassis/scrapper
name = "\improper Scrapper chassis"
icon_state = "scrapper_chassis"
/obj/item/mecha_parts/part/cockpit
name = "shipcockpit"
desc = "The cockpit of a small space ship."
icon_state = "cockpit"
origin_tech = "programming=2;materials=2;biotech=2;engineering=2"
/obj/item/mecha_parts/part/engine
name = "engine"
desc = "The main source of thrust for small space ships."
icon_state = "shipthruster"
origin_tech = "programming=1;materials=3;engineering=3"
/obj/item/mecha_parts/part/lifesupport
name = "life support systems"
gender = PLURAL
desc = "A series of systems to be installed in a small vessel. Ensures your ship will be nice and toasty, every time."
icon_state = "shiplifesupport"
origin_tech = "programming=1;materials=2;engineering=2;biotech=3"
/obj/item/mecha_parts/part/storage
name = "storage compartments"
gender = PLURAL
desc = "A series of storage compartments that are typically installed on the sides of small ships."
icon_state = "shipstorage"
origin_tech = "materials=2;engineering=2"
/obj/item/mecha_parts/part/scrap_refinery
name = "scrap refinery"
desc = "A ship-mounted refinery used to turn unsorted scrap metals into useful raw materials."
icon_state = "shiprefinery"
origin_tech = "materials=2;engineering=3"
+3
View File
@@ -0,0 +1,3 @@
//Master file for the salvaging module. Documentation, helpers, procs, credits, and other unsorted stuff will be placed here.
//Credits: Skorpio @ http://opengameart.org/users/skorpio for their sprite work.