Files
Aurora.3/code/game/turfs/simulated/wall_attacks.dm
Lohikar f6dc33a465 Newmap - SMC, Openturf, Arrivals Controller, and Mine Turf Improvements (#1958)
* 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
2017-05-02 14:40:40 -04:00

345 lines
11 KiB
Plaintext

//Interactions
/turf/simulated/wall/proc/toggle_open(var/mob/user)
if(can_open == WALL_OPENING)
return
if(density)
can_open = WALL_OPENING
//flick("[material.icon_base]fwall_opening", src)
sleep(15)
density = 0
set_opacity(0)
update_icon()
set_light(0)
else
can_open = WALL_OPENING
//flick("[material.icon_base]fwall_closing", src)
density = 1
set_opacity(1)
update_icon()
sleep(15)
set_light(1)
can_open = WALL_CAN_OPEN
update_icon()
/turf/simulated/wall/proc/fail_smash(var/mob/user, var/multiplier = 1)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*2.5)
user << "<span class='danger'>You smash against the wall!</span>"
user.do_attack_animation(src)
take_damage(rand(60,135)*multiplier)
return 1
/turf/simulated/wall/proc/success_smash(var/mob/user)
user << "<span class='danger'>You smash through the wall!</span>"
user.do_attack_animation(src)
spawn(1)
dismantle_wall(1)
return 1
/turf/simulated/wall/proc/try_touch(var/mob/user, var/rotting)
if(rotting)
if(reinf_material)
user << "<span class='danger'>\The [reinf_material.display_name] feels porous and crumbly.</span>"
else
user << "<span class='danger'>\The [material.display_name] crumbles under your touch!</span>"
dismantle_wall()
return 1
if(..()) return 1
if(!can_open)
user << "<span class='notice'>You push the wall, but nothing happens.</span>"
playsound(src, 'sound/weapons/Genhit.ogg', 25, 1)
else
toggle_open(user)
return 0
/turf/simulated/wall/attack_hand(var/mob/user)
radiate()
add_fingerprint(user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
var/rotting = (locate(/obj/effect/overlay/wallrot) in src)
if (HULK in user.mutations)
if (rotting || !prob(material.hardness))
success_smash(user)
else
fail_smash(user, 2)
return 1
try_touch(user, rotting)
/turf/simulated/wall/attack_generic(var/mob/user, var/damage, var/attack_message, var/wallbreaker)
radiate()
var/rotting = (locate(/obj/effect/overlay/wallrot) in src)
if(!damage || !wallbreaker)
try_touch(user, rotting)
return
if(rotting)
return success_smash(user)
if(reinf_material)
if((wallbreaker == 2) && (damage >= max(material.hardness,reinf_material.hardness)))
return success_smash(user)
else if(damage >= material.hardness)
return success_smash(user)
return fail_smash(user, wallbreaker)
/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if (!user.)
user << "<span class='warning'>You don't have the dexterity to do this!</span>"
return
//get the user's location
if(!istype(user.loc, /turf)) return //can't do this stuff whilst inside objects and such
if(W)
radiate()
if(is_hot(W))
burn(is_hot(W))
if(locate(/obj/effect/overlay/wallrot) in src)
if(istype(W, /obj/item/weapon/weldingtool) )
var/obj/item/weapon/weldingtool/WT = W
if( WT.remove_fuel(0,user) )
user << "<span class='notice'>You burn away the fungi with \the [WT].</span>"
playsound(src, 'sound/items/Welder.ogg', 10, 1)
for(var/obj/effect/overlay/wallrot/WR in src)
qdel(WR)
return
else if(!is_sharp(W) && W.force >= 10 || W.force >= 20)
user << "<span class='notice'>\The [src] crumbles away under the force of your [W.name].</span>"
src.dismantle_wall(1)
return
//THERMITE related stuff. Calls src.thermitemelt() which handles melting simulated walls and the relevant effects
if(thermite)
if( istype(W, /obj/item/weapon/weldingtool) )
var/obj/item/weapon/weldingtool/WT = W
if( WT.remove_fuel(0,user) )
thermitemelt(user)
return
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
thermitemelt(user)
return
else if( istype(W, /obj/item/weapon/melee/energy/blade) )
var/obj/item/weapon/melee/energy/blade/EB = W
spark(EB, 5)
user << "<span class='notice'>You slash \the [src] with \the [EB]; the thermite ignites!</span>"
playsound(src, "sparks", 50, 1)
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
thermitemelt(user)
return
var/turf/T = user.loc //get user's location for delay checks
if(damage && istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.isOn())
return
if(WT.remove_fuel(0,user))
user << "<span class='notice'>You start repairing the damage to [src].</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
if(do_after(user, max(5, damage / 5)) && WT && WT.isOn())
user << "<span class='notice'>You finish repairing the damage to [src].</span>"
take_damage(-damage)
else
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
return
// Basic dismantling.
if(isnull(construction_stage) || !reinf_material)
var/cut_delay = 60 - material.cut_delay
var/dismantle_verb
var/dismantle_sound
if(istype(W,/obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.isOn())
return
if(!WT.remove_fuel(0,user))
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
dismantle_verb = "cutting"
dismantle_sound = 'sound/items/Welder.ogg'
cut_delay *= 0.7
else if(istype(W,/obj/item/weapon/melee/energy))
var/obj/item/weapon/melee/energy/WT = W
if(WT.active)
dismantle_sound = "sparks"
dismantle_verb = "slicing"
cut_delay *= 0.5
else
user << "<span class='notice'>You need to activate the weapon to do that!</span>"
return
else if(istype(W,/obj/item/weapon/melee/energy/blade))
dismantle_sound = "sparks"
dismantle_verb = "slicing"
cut_delay *= 0.5
else if(istype(W,/obj/item/weapon/melee/chainsword))
var/obj/item/weapon/melee/chainsword/WT = W
if(WT.active)
dismantle_sound = "sound/weapons/chainsawhit.ogg"
dismantle_verb = "slicing"
cut_delay *= 0.8
else
user << "<span class='notice'>You need to activate the weapon to do that!</span>"
return
else if(istype(W,/obj/item/weapon/pickaxe))
var/obj/item/weapon/pickaxe/P = W
dismantle_verb = P.drill_verb
dismantle_sound = P.drill_sound
cut_delay -= P.digspeed
if(dismantle_verb)
user << "<span class='notice'>You begin [dismantle_verb] through the outer plating.</span>"
if(dismantle_sound)
playsound(src, dismantle_sound, 100, 1)
if(cut_delay<0)
cut_delay = 0
if(!do_after(user,cut_delay))
return
//This prevents runtime errors if someone clicks the same wall more than once
if (!istype(src, /turf/simulated/wall))
return
user << "<span class='notice'>You remove the outer plating.</span>"
dismantle_wall()
user.visible_message("<span class='warning'>The wall was torn open by [user]!</span>")
return
//Reinforced dismantling.
else
switch(construction_stage)
if(6)
if (istype(W, /obj/item/weapon/wirecutters))
playsound(src, 'sound/items/Wirecutter.ogg', 100, 1)
construction_stage = 5
new /obj/item/stack/rods( src )
user << "<span class='notice'>You cut the outer grille.</span>"
update_icon()
return
if(5)
if (istype(W, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You begin removing the support lines.</span>"
playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
if(!do_after(user,40) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
return
construction_stage = 4
update_icon()
user << "<span class='notice'>You remove the support lines.</span>"
return
else if( istype(W, /obj/item/stack/rods) )
var/obj/item/stack/O = W
if(O.get_amount()>0)
O.use(1)
construction_stage = 6
update_icon()
user << "<span class='notice'>You replace the outer grille.</span>"
return
if(4)
var/cut_cover
if(istype(W,/obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.isOn())
return
if(WT.remove_fuel(0,user))
cut_cover=1
else
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
else if (istype(W, /obj/item/weapon/gun/energy/plasmacutter))
cut_cover = 1
if(cut_cover)
user << "<span class='notice'>You begin slicing through the metal cover.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
if(!do_after(user, 60) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
return
construction_stage = 3
update_icon()
user << "<span class='notice'>You press firmly on the cover, dislodging it.</span>"
return
if(3)
if (istype(W, /obj/item/weapon/crowbar))
user << "<span class='notice'>You struggle to pry off the cover.</span>"
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
if(!do_after(user,100) || !istype(src, /turf/simulated/wall) || construction_stage != 3)
return
construction_stage = 2
update_icon()
user << "<span class='notice'>You pry off the cover.</span>"
return
if(2)
if (istype(W, /obj/item/weapon/wrench))
user << "<span class='notice'>You start loosening the anchoring bolts which secure the support rods to their frame.</span>"
playsound(src, 'sound/items/Ratchet.ogg', 100, 1)
if(!do_after(user,40) || !istype(src, /turf/simulated/wall) || construction_stage != 2)
return
construction_stage = 1
update_icon()
user << "<span class='notice'>You remove the bolts anchoring the support rods.</span>"
return
if(1)
var/cut_cover
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if( WT.remove_fuel(0,user) )
cut_cover=1
else
user << "<span class='notice'>You need more welding fuel to complete this task.</span>"
return
else if(istype(W, /obj/item/weapon/gun/energy/plasmacutter))
cut_cover = 1
if(cut_cover)
user << "<span class='notice'>You begin slicing through the support rods.</span>"
playsound(src, 'sound/items/Welder.ogg', 100, 1)
if(!do_after(user,70) || !istype(src, /turf/simulated/wall) || construction_stage != 1)
return
construction_stage = 0
update_icon()
new /obj/item/stack/rods(src)
user << "<span class='notice'>The support rods drop out as you cut them loose from the frame.</span>"
return
if(0)
if(istype(W, /obj/item/weapon/crowbar))
user << "<span class='notice'>You struggle to pry off the outer sheath.</span>"
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
sleep(100)
if(!istype(src, /turf/simulated/wall) || !user || !W || !T ) return
if(user.loc == T && user.get_active_hand() == W )
user << "<span class='notice'>You pry off the outer sheath.</span>"
dismantle_wall()
return
if(istype(W,/obj/item/frame))
var/obj/item/frame/F = W
F.try_build(src)
return
else if(!istype(W,/obj/item/weapon/rcd) && !istype(W, /obj/item/weapon/reagent_containers))
return attack_hand(user)