Files
Aurora.3/code/game/objects/structures.dm
Matt Atlas 99b4033ca5 Aurora 2: The 3/4thening (#17186)
* after dark

* FIXES

* breakin

* butt

* Update code/game/objects/items/devices/floor_painter.dm

Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>

* Update code/game/objects/items/devices/floor_painter.dm

Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>

* Update code/game/objects/structures/lattice.dm

Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>

* testing 1

* a

* FUCK THIS PRESET!!!

* allah

* OTEMACHI

* tis' done

* Project Exorcism : Sneed's Snairs (Formerly Chuck's)

* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm

* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm

* Update stools.dm

* Update code/game/objects/structures/stool_bed_chair_nest/stools.dm

* Update code/game/objects/structures/stool_bed_chair_nest/stools.dm

* Update stools.dm

* Update chairs.dm

* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm

* inhand fixes

* airlocks (matt has cooked)

fuck

* my cody plays the mamba

* fuck

* fixes layering issue

* airlocks and everything else Please fucking kill me

* underlays

* unfuck blending

* finished replacing old ass shit

* your ass is geass

* conflicts die now

* public fat'wa

* progress on walls and windows

* more mapping

* baltimore accents be like

* minor progress

* monitors

* fire alarms and apc adjustments

* apcs pixel adjustments, final airlock look

* also grilles

* shuttle wall start plus shuttle windows

* starting consoles

* table outlines

* I love broke ass sprites

* fixing the stupid ass exterior walls

* light fuckery

* terminal directionals, external airlocks, table fixes, blahblahblah

* fix 1

* fix 2

* some more fixes

* fix chairs

* basic untested railings and updating colors from atteria

* bridge and some fixes

* removing some artifacts on the new walls

* breaking wood tables and adding 4 wall materials

* fix

* compile & wood fixes

* make the horizon compile again

* railings, firedoors, ATMs, intercomms and tables again

* mapping begins also some tweaks to map view of icons

* full tile steel walls

* i sure hope nothing bad happens

* airlock updates (untested)

* reverts most wall machinery

* skull

* wall coloring

* makes the tg wood chill out

* work on airlocks

* hull consistency

* cause you live forever in the lights you make

* whoops can't show that in a christian manga

* terminals should be on walls and everything's hunky dory now

also i changed the wood stuff as per atteria's suggestion

* fixing airlocks

* fixes

* window resprite, coloring adjustments

* scc hull resprite

* new grilles, frame edits, and borosilicate

* greyscale wood palette improvement

* shuttle windows

* window frame fix

* apc update

* refit and reshaded fire alarms

* mapping icon fixes

* table fixes

* map fixes, platforms and stairs

* updates cutter, new walls and terminals

* mapping fixes

* fix preview

* preview fix stone

* stairs

* initial work for the map

* railing and windowpane fuckery

* new external airlocks

* a

* fix the maps in preparation

* wall object pixel offsets

* air alarms D1

* extinguisher cabinets

* APC DESTROYED MISSION ACCOMPLISHED GOOD WORK

* deck 3: floor decals, APCs, air alarms, fire extinguisher cabinets

* deck 3: fireaxe cabinet

* /shuttle_landmark/distress/blue, move base_turf from map to obj def

* intercom presets

* formatting

* deck 1: floor decals

* deck 2: named area fix (LMAO), signs to use single quotes

* deck 2: floor decals, APCs, air alarms, fire extinguisher cabinets, fireaxe cabinets

* Platforms and stairs!

* grates and bugfixes

* Angled ship walls + grate color fix

* corrects apc anim overlay

* deck 2 and away site fixes

# Conflicts:
#	maps/sccv_horizon/sccv_horizon-2_deck_2.dmm

* deck 2 missing grate

* warning stripes

* railings and ledges

* windows and fixtures

* windoorsagain

* airlocks pt1

* windows de-seamed and transparent

* airlocks and pixel offsets

* fixes for airlocks

* more airlock fixes

* presets for ringer, request console and newscaster

* 132

* asfsaf

* kitchen tiling

* thicker freezer tile bevels

* More angled walls

* New shutters and blast doors

* directional corrections

* ops railing fixes

* updated window map things and shutters

* value changes and blast door changes

* Ledges and platforms galore (D2/D3)

* all decks: fix door dirs

* all decks: newscasters, intercoms, requests consoles, ringer consoles

* helm light blue decals to dark blue

* supermatter door dir fix

* fix directional presets (dirs/offsets): newscaster, intercom, requests console, ringer console

* firedoor changes

* deck 3: overlapping wall mountables fixes

* map changes

* airlock changes

* map tweaks

* airlock & stair icons

* various mapping modifications

* Double airlocks + fixing denied states + fixing airlocks on all levels

* Rebase

* directional terminals buttons and lights again, platform tweaks

terminal north facing sprites, atm/food terminal directionals
proper door control and lightswitch directionals (presets still need to be set up, mapping)
re-adds new light tube sprites, again
new sprites for floor lights and the other stuff that got added
adjusted platforms to be recolorable, added light and dark versions, fixed some shading

* missing ERT outfit thingy fix

* floor lights fixed

* deck 3: various small fixes

* deck 1: various small fixes

* deck 2: various small fixes

* fixes

* d2 fixes & multitile door fix

* d2 fixes, remove unused airlock files, button icon fixes, window icon fixes

* make it actually compile, oops!

* make it actually compile, pt2

* CE office camera

* pew pew pew

* pew pew pew 2

* fixes

* deck 3: buttons fixes

* deck 3: button and other fixes

* deck 3: fixes and stuff

* D1 fixes & skrell airlocks

* minor D2 tweaks

* a lot of airlock-related fixes, glass tables, paint sprayer fixes, decal fixes, changelog

* maintenance hatch sprites

* fixing double doors

* flips multi-tiles, fixes multi-tiles, adds desk windoors

* new plastic flaps

* deck 2: a few buttons

* side + middle doors

* created paths for 3-tiles doors

* apply to map the 3 tiles airlocks

* some fixes, windoor alpha

* remove this random ass potted plant

* more map fixes

* holodeck disposal pipe fix

* secure airlock sprites

no code or obj definitions yet

* vault airlock

* vault door fixes

* scc window alpha

* adjusts double door glass, firedoor open state

* adjusts construction states for doors

* remove some defunct icons and fix anims

* assembly stuff

* pharma fixes

* vault door dir

* firedoor smart generation moved to its own proc

* lift doors, d1 fixes

* firedoor smart generation: adjacent wall check

* firedoor smart generation: adjacent firedoor check

* all decks: missing firedoor and other fixes

* deck 2: weird maint stairs fix

* oops

* diona airlock fix

* the shuttle wall gigadeath

* fixes

* some fixes for leftover map item paths, and double lattices

* new diona walls

* more fixes

* and more

* deck 1: fix out of bounds keys

* deck 3: fix out of bounds keys

* runtime 3: duplicate APCs fix

* all decks: make all 3 tile wide doors glass

---------

Co-authored-by: Wezzy <wowzewow@gmail.com>
Co-authored-by: Wowzewow (Wezzy) <42310821+alsoandanswer@users.noreply.github.com>
Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>
Co-authored-by: kyres1 <noodle.buster31@gmail.com>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: atteria <tarkona@protonmail.com>
Co-authored-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com>
Co-authored-by: DreamySkrell <107256943+DreamySkrell@users.noreply.github.com>
Co-authored-by: naut <nautilussplat@gmail.com>
Co-authored-by: naut <55491249+nauticall@users.noreply.github.com>
2023-08-30 21:18:10 +00:00

232 lines
6.4 KiB
Plaintext

/obj/structure
icon = 'icons/obj/structures.dmi'
w_class = ITEMSIZE_IMMENSE
layer = OBJ_LAYER - 0.01
var/material_alteration = MATERIAL_ALTERATION_ALL // Overrides for material shit. Set them manually if you don't want colors etc. See wood chairs/office chairs.
var/climbable
var/breakable
var/parts
var/list/climbers
var/list/footstep_sound //footstep sounds when stepped on
var/material/material
var/build_amt = 2 // used by some structures to determine into how many pieces they should disassemble into or be made with
var/slowdown = 0 //amount that pulling mobs have their movement delayed by
/obj/structure/Destroy()
if(parts)
new parts(loc)
if (smooth)
queue_smooth_neighbors(src)
return ..()
/obj/structure/attack_hand(mob/user)
if(breakable)
if(HAS_FLAG(user.mutations, HULK))
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
attack_generic(user,1,"smashes")
else if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(H.species.can_shred(user))
attack_generic(user,1,"slices")
if(LAZYLEN(climbers) && !(user in climbers))
user.visible_message("<span class='warning'>[user] shakes \the [src].</span>", \
"<span class='notice'>You shake \the [src].</span>")
structure_shaken()
return ..()
/obj/structure/ex_act(severity)
switch(severity)
if(1.0)
qdel(src)
return
if(2.0)
if(prob(50))
qdel(src)
return
if(3.0)
return
/obj/structure/proc/dismantle()
var/material/dismantle_material
if(!get_material())
dismantle_material = SSmaterials.get_material_by_name(DEFAULT_WALL_MATERIAL) //if there is no defined material, it will use steel
else
dismantle_material = get_material()
for(var/i = 1 to build_amt)
dismantle_material.place_sheet(loc)
qdel(src)
/obj/structure/bullet_act(obj/item/projectile/P, def_zone)
. = ..()
bullet_ping(P)
/obj/structure/Initialize(mapload)
. = ..()
if(!isnull(material) && !istype(material))
material = SSmaterials.get_material_by_name(material)
if (!mapload)
updateVisibility(src) // No point checking this before visualnet initializes.
if(climbable)
verbs += /obj/structure/proc/climb_on
if (smooth)
queue_smooth(src)
queue_smooth_neighbors(src)
/obj/structure/proc/climb_on()
set name = "Climb structure"
set desc = "Climbs onto a structure."
set category = "Object"
set src in oview(1)
if(can_climb(usr))
do_climb(usr)
/obj/structure/handle_middle_mouse_click(mob/user)
if(can_climb(user))
do_climb(usr)
return TRUE
return FALSE
/obj/structure/MouseDrop_T(mob/target, mob/user)
var/mob/living/H = user
if(istype(H) && can_climb(H) && target == user)
do_climb(target)
else
return ..()
/obj/structure/proc/can_climb(var/mob/living/user, post_climb_check=0)
if (!climbable || !can_touch(user) || (!post_climb_check && (user in climbers)))
return FALSE
if (!user.Adjacent(src))
to_chat(user, SPAN_WARNING("You must be next to \the [src] to climb it."))
return FALSE
var/obj/occupied = turf_is_crowded()
if(occupied)
to_chat(user, SPAN_WARNING("There's \a [occupied] in the way."))
return FALSE
return TRUE
/obj/structure/proc/turf_is_crowded(var/exclude_self = FALSE)
var/turf/T = get_turf(src)
if(!T || !istype(T))
return 0
for(var/obj/O in T.contents)
if(istype(O,/obj/structure))
var/obj/structure/S = O
if(S.climbable)
continue
if(O && O.density && !(O.flags & ON_BORDER)) //ON_BORDER structures are handled by the Adjacent() check.
if(exclude_self && O == src)
continue
return O
return 0
/obj/structure/proc/do_climb(var/mob/living/user)
if (!can_climb(user))
return
user.visible_message(SPAN_WARNING("[user] starts [flags & ON_BORDER ? "leaping over" : "climbing onto"] \the [src]!"))
LAZYADD(climbers, user)
if(!do_after(user,50))
LAZYREMOVE(climbers, user)
return
if (!can_climb(user, post_climb_check=1))
LAZYREMOVE(climbers, user)
return
var/turf/TT = get_turf(src)
if(flags & ON_BORDER)
TT = get_step(get_turf(src), dir)
if(user.loc == TT)
TT = get_turf(src)
user.visible_message("<span class='warning'>[user] [flags & ON_BORDER ? "leaps over" : "climbs onto"] \the [src]!</span>")
user.forceMove(TT)
LAZYREMOVE(climbers, user)
/obj/structure/proc/structure_shaken()
for(var/mob/living/M in climbers)
M.Weaken(1)
to_chat(M, "<span class='danger'>You topple as you are shaken off \the [src]!</span>")
LAZYREMOVE(climbers, M)
for(var/mob/living/M in get_turf(src))
if(M.lying) return //No spamming this on people.
M.Weaken(3)
to_chat(M, "<span class='danger'>You topple as \the [src] moves under you!</span>")
if(prob(25))
var/damage = rand(15,30)
var/mob/living/carbon/human/H = M
if(!istype(H))
to_chat(H, "<span class='danger'>You land heavily!</span>")
M.adjustBruteLoss(damage)
return
var/obj/item/organ/external/affecting
switch(pick(list("ankle","wrist",BP_HEAD,"knee","elbow")))
if("ankle")
affecting = H.get_organ(pick(BP_L_FOOT, BP_R_FOOT))
if("knee")
affecting = H.get_organ(pick(BP_L_LEG, BP_R_LEG))
if("wrist")
affecting = H.get_organ(pick(BP_L_HAND, BP_R_HAND))
if("elbow")
affecting = H.get_organ(pick(BP_L_ARM, BP_R_ARM))
if(BP_HEAD)
affecting = H.get_organ(BP_HEAD)
if(affecting)
to_chat(M, "<span class='danger'>You land heavily on your [affecting.name]!</span>")
affecting.take_damage(damage, 0)
if(affecting.parent)
affecting.parent.add_autopsy_data("Misadventure", damage)
else
to_chat(H, "<span class='danger'>You land heavily!</span>")
H.adjustBruteLoss(damage)
H.UpdateDamageIcon()
H.updatehealth()
return
/obj/structure/proc/can_touch(var/mob/user)
if (!user)
return 0
if(!Adjacent(user))
return 0
if (user.restrained() || user.buckled_to)
to_chat(user, "<span class='notice'>You need your hands and legs free for this.</span>")
return 0
if (user.stat || user.paralysis || user.sleeping || user.lying || user.weakened)
return 0
if (issilicon(user))
to_chat(user, "<span class='notice'>You need hands for this.</span>")
return 0
return 1
/obj/structure/attack_generic(var/mob/user, var/damage, var/attack_verb, var/wallbreaker)
if(!breakable || !damage || !wallbreaker)
return 0
visible_message("<span class='danger'>[user] [attack_verb] the [src] apart!</span>")
user.do_attack_animation(src)
spawn(1)
qdel(src)
return 1
/obj/structure/get_material()
return material