mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-31 00:49:06 +01:00
* Replace SSingulo with SScalamity; processing cleanup
- SScalamity now handles blobs as well as singularity-types.
- Processing subtypes have been simplified to not require a stop_processing definition.
* this is probably important
* Remove cascade disabling SSgarbage
* Fixed a bug where dust() did not qdel the target mob
* Misc fixes
* Fix decals surviving break-to-plating
* Subsystem flag tweaks
* Apparently subsystems are new'd before config is.
* Fix paper icons
* Speculative fix for insane lag
* Better machinery stat
* Make organs not use SSoverlay
* Misc bugfixes & tweaks
* Nightmode fixes
* Changelog for SMC
* Port /tg/'s improved MC crash handling
* Add some more SS Recover() procs
* supply_controller -> SScargo
* More New() -> Initialize()
* pAI and robot construction overlays
* Fix cargo unit tests
* Merge the DMM Suite's atom/New() into atoms_init
* Lighting pre-baking
* Lighting initialization logging
* Fix some bad SS init orders
* Fix SSlighting logging; rename Processes to MC
* Speculative fix for insane GC lag
* Prebaked openturf/icon_smooth & fix lighting prebake
* SS init status; SSatoms LATEQDEL
* Fix bug with MC init stat panel
* Fix parallax
* Misc
* Ignore SS_NO_DISPLAY during init
* apparently this is important
* REEEEEE
* Image GC fixes; broadcaster radio-new sanity
* RCON Cleanup
* Move pAI recruiter into subsystem
* Move global solars list into sun subsystem
* Make chickens not use a global
* Demote SSdisposals to SS_BACKGROUND; garbage-debug cleanup
* Speed up space init a little
* Fix bad timer flags on floor drying
* Subsystem panic-restart verb for mins
* Explosion speedup
* Minor subsystem & MC logging tweaks
* SSopenturf improvements
* Make pipenet actually initialize (whoops)
* Minor tweaks
* Implement lighting rounding
* comments are hard okay
* Minor lattice tweaks
* Fix some timer issues & better closet init
* Timer sanity
* Request console tweaks + Storage init sanity
* Minor SSmachiner RCON improvements
* Further reduce world-start timer count
* Standardize subsystem logging
* Garbage hard delete profiling from /tg/
* Timer hang detection & recovery
* Log machines that sleep in process() and fuck up SSmachinery
* Fix an issue with external airlocks sleeping in process()
* Failsafe logging
* Minor tweaks
* Revert "Request console tweaks + Storage init sanity"
This reverts commit 98d3579e35.
* Re-implement RC changes
* Fix SQL FT saving
* Fix SSmachinery sleep in disposals
* Minor SS tweaks
* Paper fixes
* Blood drying fixes
* Merge gameticker and SSticker
* Minor global list init cleanup
* Lagcheck biogenerator & bags
* Tweak SScargo init order; RIG Initialize()
* Caching tweaks
* Remove rogue comma
* Initialize fixes
* Lighting destroy cleanup
* Fix emagging airlocks
* Initial SSicon implementation
* Tweaks & Fixes
* Fire + Air alarm queued icon updates
* Overlays + Queued icon cleanup
* Runtime & background fixes
* Kill some meaningless set statements
* Kill some image qdels
* Bump up lighting rounding val
* Fix adv. scanner destroy runtimes
* Remove unneeded icon update limiting
* Move icon smoothing into helpers
* Show a warning if DM 510 compiles without memory leak hack enabled
* Re-organize subsystems & MC defines a little
* Airlock SFX
* Log of Changes
* Make SSicon_update disable itself when not doing anything
* Fix respawn verb runtime when used early in server-init
* Add more information to MC's stat_entry()
* Replace direct refernces to gcDestroyed with QDEL* macros
* plant_controller -> SSplants
* More plant tweaks
* Add more humor to changelog
* Move parallax globals into SSparallax
* Lighting responsiveness tweaks
* Fix parallax init order & better MC init panel stat
* Make mobs GC
* More overlays + Remove intercom spawn()
* SSfast_process; make pinpointers not use spawn-recursion to process
Also made the SM Cascade beach process with SSprocessing instead of a spawn loop.
* Update changelog
* Mob GC tweaks
* Del() cleanup
* Fix insomniac ZAS connection edges
* Minor pAI cleanup
* Convert more things to SSoverlay; fix duplicated overlay in field gens
* SM Bluespace turf tweaks
* Update SSgarbage debug globals list
* Human-type qdel tweaks
* Subsystem suspension; stat_entry improvements
* SQL Statistics cleanup
* Fix runtimes with ambrosia
* More disable() -> suspend(); fix nightmode again
* Human qdel fix; minor tweaks
* Update turbolift to work with StonedMC
* Make lifts use timers instead of a subsystem
* Make SSassets start earlier
* Convert the radio controller into a subsystem
* Fix some missing CHECK_TICKs in asteroid generation
* MC stat tweaks; make shouldnt_see a typecache
* Kill some redundant debug-controller entries
* radio_controller -> SSradio
* Better SSgarbage hard-del logging from /tg/ upstream
* Logging tweaks + GELF
* Misc client caching improvements
* Slime SSoverlay
* Oven icon fixes
* Implant fixes
- Death implants will no longer spam Common on death of user.
- Death implants should handle a deleted user better.
* Holder tweaks + Welding tool Initialize()
* Fix some bad subsystem logging
* Fix suit cooling units spawning without cells
* Starlight tweaks
* Gibber infinite gib fix
* More SSoverlay stuff
* Make crates use CUT_OVERLAY_IN
* Make SSarrivals suspend instead of disable
* Make openturf use split/phased tick checks
* Speculative fix for unwet timer runtimes
* Blood overlay tweaks/fixes
* Update crusher to play nice with SMC + SSoverlay
* Openturf improvements and fixes
* Minor turbolift tweaks
* Lighting performance improvements + ChangeTurf tweaks
* this is probably important
* Fix wall weld noises on changeturf
* More ChangeTurf tweaks
* Explosion tweaks
* Pre-game lobby tweaks
* Openturf tweaks
* Prevent admins from starting the game before init finishes
* Fix Travis
* Kill an unused var
* Fix ChangeTurf runtimes on openturfs
* Fixes
* Browser datum fixes, asset caching
* Update changelog
* Changelog
* Lobby tweaks
* Ticker tweaks; kill ticker var
* Further lobby tweaks
* Cascade tweaks
* air_master -> SSair
* Reduce overhead from radio autosay
* alarm_manager -> SSalarm
* bomb_processor -> SSexplosives
* corp_regs -> SSlaw
* ZAS overlay fixes
* Small wall icon optimization
* Fix effects master
* Assembly tweaks
* Megavend fixes
* Shuttle fixes
* Camera alert performance improvements
* Fix some world.log spam from lighting overlays
* Fix some Initialize() procs
* Openspace responsiveness tweaks
* Make HE pipes animate through openturfs
* Kill a spawn
330 lines
8.3 KiB
Plaintext
330 lines
8.3 KiB
Plaintext
////FIELD GEN START //shameless copypasta from fieldgen, powersink, and grille
|
|
/obj/machinery/shieldwallgen
|
|
name = "Shield Generator"
|
|
desc = "A shield generator."
|
|
icon = 'icons/obj/stationobjs.dmi'
|
|
icon_state = "Shield_Gen"
|
|
anchored = 0
|
|
density = 1
|
|
req_access = list(access_engine_equip)
|
|
var/active = 0
|
|
var/power = 0
|
|
var/state = 0
|
|
var/steps = 0
|
|
var/last_check = 0
|
|
var/check_delay = 10
|
|
var/recalc = 0
|
|
var/locked = 1
|
|
var/destroyed = 0
|
|
var/directwired = 1
|
|
// var/maxshieldload = 200
|
|
var/obj/structure/cable/attached // the attached cable
|
|
var/storedpower = 0
|
|
flags = CONDUCT
|
|
//There have to be at least two posts, so these are effectively doubled
|
|
var/power_draw = 30000 //30 kW. How much power is drawn from powernet. Increase this to allow the generator to sustain longer shields, at the cost of more power draw.
|
|
var/max_stored_power = 50000 //50 kW
|
|
use_power = 0 //Draws directly from power net. Does not use APC power.
|
|
|
|
/obj/machinery/shieldwallgen/attack_hand(mob/user as mob)
|
|
if(state != 1)
|
|
user << "\red The shield generator needs to be firmly secured to the floor first."
|
|
return 1
|
|
if(src.locked && !istype(user, /mob/living/silicon))
|
|
user << "\red The controls are locked!"
|
|
return 1
|
|
if(power != 1)
|
|
user << "\red The shield generator needs to be powered by wire underneath."
|
|
return 1
|
|
|
|
if(src.active >= 1)
|
|
src.active = 0
|
|
icon_state = "Shield_Gen"
|
|
|
|
user.visible_message("[user] turned the shield generator off.", \
|
|
"You turn off the shield generator.", \
|
|
"You hear heavy droning fade out.")
|
|
for(var/dir in list(1,2,4,8)) src.cleanup(dir)
|
|
else
|
|
src.active = 1
|
|
icon_state = "Shield_Gen +a"
|
|
user.visible_message("[user] turned the shield generator on.", \
|
|
"You turn on the shield generator.", \
|
|
"You hear heavy droning.")
|
|
src.add_fingerprint(user)
|
|
|
|
/obj/machinery/shieldwallgen/proc/power()
|
|
if(!anchored)
|
|
power = 0
|
|
return 0
|
|
var/turf/T = src.loc
|
|
|
|
var/obj/structure/cable/C = T.get_cable_node()
|
|
var/datum/powernet/PN
|
|
if(C) PN = C.powernet // find the powernet of the connected cable
|
|
|
|
if(!PN)
|
|
power = 0
|
|
return 0
|
|
|
|
var/shieldload = between(500, max_stored_power - storedpower, power_draw) //what we try to draw
|
|
shieldload = PN.draw_power(shieldload) //what we actually get
|
|
storedpower += shieldload
|
|
|
|
//If we're still in the red, then there must not be enough available power to cover our load.
|
|
if(storedpower <= 0)
|
|
power = 0
|
|
return 0
|
|
|
|
power = 1 // IVE GOT THE POWER!
|
|
return 1
|
|
|
|
/obj/machinery/shieldwallgen/process()
|
|
power()
|
|
if(power)
|
|
storedpower -= 2500 //the generator post itself uses some power
|
|
|
|
if(storedpower >= max_stored_power)
|
|
storedpower = max_stored_power
|
|
if(storedpower <= 0)
|
|
storedpower = 0
|
|
// if(shieldload >= maxshieldload) //there was a loop caused by specifics of process(), so this was needed.
|
|
// shieldload = maxshieldload
|
|
|
|
if(src.active == 1)
|
|
if(!src.state == 1)
|
|
src.active = 0
|
|
return
|
|
spawn(1)
|
|
setup_field(1)
|
|
spawn(2)
|
|
setup_field(2)
|
|
spawn(3)
|
|
setup_field(4)
|
|
spawn(4)
|
|
setup_field(8)
|
|
src.active = 2
|
|
if(src.active >= 1)
|
|
if(src.power == 0)
|
|
src.visible_message("\red The [src.name] shuts down due to lack of power!", \
|
|
"You hear heavy droning fade out")
|
|
icon_state = "Shield_Gen"
|
|
src.active = 0
|
|
for(var/dir in list(1,2,4,8)) src.cleanup(dir)
|
|
|
|
/obj/machinery/shieldwallgen/proc/setup_field(var/NSEW = 0)
|
|
var/turf/T = src.loc
|
|
var/turf/T2 = src.loc
|
|
var/obj/machinery/shieldwallgen/G
|
|
var/steps = 0
|
|
var/oNSEW = 0
|
|
|
|
if(!NSEW)//Make sure its ran right
|
|
return
|
|
|
|
if(NSEW == 1)
|
|
oNSEW = 2
|
|
else if(NSEW == 2)
|
|
oNSEW = 1
|
|
else if(NSEW == 4)
|
|
oNSEW = 8
|
|
else if(NSEW == 8)
|
|
oNSEW = 4
|
|
|
|
for(var/dist = 0, dist <= 9, dist += 1) // checks out to 8 tiles away for another generator
|
|
T = get_step(T2, NSEW)
|
|
T2 = T
|
|
steps += 1
|
|
if(locate(/obj/machinery/shieldwallgen) in T)
|
|
G = (locate(/obj/machinery/shieldwallgen) in T)
|
|
steps -= 1
|
|
if(!G.active)
|
|
return
|
|
G.cleanup(oNSEW)
|
|
break
|
|
|
|
if(isnull(G))
|
|
return
|
|
|
|
T2 = src.loc
|
|
|
|
for(var/dist = 0, dist < steps, dist += 1) // creates each field tile
|
|
var/field_dir = get_dir(T2,get_step(T2, NSEW))
|
|
T = get_step(T2, NSEW)
|
|
T2 = T
|
|
var/obj/machinery/shieldwall/CF = new/obj/machinery/shieldwall/(src, G) //(ref to this gen, ref to connected gen)
|
|
CF.loc = T
|
|
CF.set_dir(field_dir)
|
|
|
|
|
|
/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user)
|
|
if(istype(W, /obj/item/weapon/wrench))
|
|
if(active)
|
|
user << "Turn off the field generator first."
|
|
return
|
|
|
|
else if(state == 0)
|
|
state = 1
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
|
user << "You secure the external reinforcing bolts to the floor."
|
|
src.anchored = 1
|
|
return
|
|
|
|
else if(state == 1)
|
|
state = 0
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
|
user << "You undo the external reinforcing bolts."
|
|
src.anchored = 0
|
|
return
|
|
|
|
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
|
if (src.allowed(user))
|
|
src.locked = !src.locked
|
|
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
|
|
else
|
|
user << "\red Access denied."
|
|
|
|
else
|
|
src.add_fingerprint(user)
|
|
visible_message("\red The [src.name] has been hit with \the [W.name] by [user.name]!")
|
|
|
|
/obj/machinery/shieldwallgen/proc/cleanup(var/NSEW)
|
|
var/obj/machinery/shieldwall/F
|
|
var/obj/machinery/shieldwallgen/G
|
|
var/turf/T = src.loc
|
|
var/turf/T2 = src.loc
|
|
|
|
for(var/dist = 0, dist <= 9, dist += 1) // checks out to 8 tiles away for fields
|
|
T = get_step(T2, NSEW)
|
|
T2 = T
|
|
if(locate(/obj/machinery/shieldwall) in T)
|
|
F = (locate(/obj/machinery/shieldwall) in T)
|
|
qdel(F)
|
|
|
|
if(locate(/obj/machinery/shieldwallgen) in T)
|
|
G = (locate(/obj/machinery/shieldwallgen) in T)
|
|
if(!G.active)
|
|
break
|
|
|
|
/obj/machinery/shieldwallgen/Destroy()
|
|
src.cleanup(1)
|
|
src.cleanup(2)
|
|
src.cleanup(4)
|
|
src.cleanup(8)
|
|
return ..()
|
|
|
|
/obj/machinery/shieldwallgen/bullet_act(var/obj/item/projectile/Proj)
|
|
storedpower -= 400 * Proj.get_structure_damage()
|
|
..()
|
|
return
|
|
|
|
|
|
//////////////Containment Field START
|
|
/obj/machinery/shieldwall
|
|
name = "Shield"
|
|
desc = "An energy shield."
|
|
icon = 'icons/effects/effects.dmi'
|
|
icon_state = "shieldwall"
|
|
anchored = 1
|
|
density = 1
|
|
unacidable = 1
|
|
light_range = 3
|
|
var/needs_power = 0
|
|
var/active = 1
|
|
// var/power = 10
|
|
var/delay = 5
|
|
var/last_active
|
|
var/mob/U
|
|
var/obj/machinery/shieldwallgen/gen_primary
|
|
var/obj/machinery/shieldwallgen/gen_secondary
|
|
var/power_usage = 2500 //how much power it takes to sustain the shield
|
|
var/generate_power_usage = 7500 //how much power it takes to start up the shield
|
|
|
|
/obj/machinery/shieldwall/New(var/obj/machinery/shieldwallgen/A, var/obj/machinery/shieldwallgen/B)
|
|
..()
|
|
update_nearby_tiles()
|
|
src.gen_primary = A
|
|
src.gen_secondary = B
|
|
if(A && B && A.active && B.active)
|
|
needs_power = 1
|
|
if(prob(50))
|
|
A.storedpower -= generate_power_usage
|
|
else
|
|
B.storedpower -= generate_power_usage
|
|
else
|
|
qdel(src) //need at least two generator posts
|
|
|
|
/obj/machinery/shieldwall/Destroy()
|
|
update_nearby_tiles()
|
|
return ..()
|
|
|
|
/obj/machinery/shieldwall/attack_hand(mob/user as mob)
|
|
return
|
|
|
|
|
|
/obj/machinery/shieldwall/process()
|
|
if(needs_power)
|
|
if(isnull(gen_primary)||isnull(gen_secondary))
|
|
qdel(src)
|
|
return
|
|
|
|
if(!(gen_primary.active)||!(gen_secondary.active))
|
|
qdel(src)
|
|
return
|
|
|
|
if(prob(50))
|
|
gen_primary.storedpower -= power_usage
|
|
else
|
|
gen_secondary.storedpower -= power_usage
|
|
|
|
|
|
/obj/machinery/shieldwall/bullet_act(var/obj/item/projectile/Proj)
|
|
if(needs_power)
|
|
var/obj/machinery/shieldwallgen/G
|
|
if(prob(50))
|
|
G = gen_primary
|
|
else
|
|
G = gen_secondary
|
|
G.storedpower -= 400 * Proj.get_structure_damage()
|
|
..()
|
|
return
|
|
|
|
|
|
/obj/machinery/shieldwall/ex_act(severity)
|
|
if(needs_power)
|
|
var/obj/machinery/shieldwallgen/G
|
|
switch(severity)
|
|
if(1.0) //big boom
|
|
if(prob(50))
|
|
G = gen_primary
|
|
else
|
|
G = gen_secondary
|
|
G.storedpower -= 120000
|
|
|
|
if(2.0) //medium boom
|
|
if(prob(50))
|
|
G = gen_primary
|
|
else
|
|
G = gen_secondary
|
|
G.storedpower -= 30000
|
|
|
|
if(3.0) //lil boom
|
|
if(prob(50))
|
|
G = gen_primary
|
|
else
|
|
G = gen_secondary
|
|
G.storedpower -= 12000
|
|
return
|
|
|
|
|
|
/obj/machinery/shieldwall/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
|
if(air_group || (height==0)) return 1
|
|
|
|
if(istype(mover) && mover.checkpass(PASSGLASS))
|
|
return prob(20)
|
|
else
|
|
if (istype(mover, /obj/item/projectile))
|
|
return prob(10)
|
|
else
|
|
return !src.density
|