Skip to content

Commit

Permalink
Platforms (#3687)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Adds Platforms
Sprites by Spooky. 

![image](https://github.com/user-attachments/assets/a4769a47-c96f-4926-ae23-a8931ca09511)

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Good mapping tool/trick. Helps create some of those 3d-ish spaces
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: Platforms. Please use them in maps. they look cool. 
imageadd: Spooky: Platform sprites

/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: Erika Fox <[email protected]>
Signed-off-by: thgvr <[email protected]>
Co-authored-by: thgvr <[email protected]>
  • Loading branch information
Erikafox and thgvr authored Nov 2, 2024
1 parent 1d163ff commit 305cf1b
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 0 deletions.
163 changes: 163 additions & 0 deletions code/game/objects/structures/platforms.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
/obj/structure/platform
name = "platform"
desc = "An elevated platform meant to make someone feel more important."
icon = 'icons/obj/platform.dmi'
icon_state = "platform"
flags_1 = ON_BORDER_1
layer = RAILING_LAYER
pass_flags_self = LETPASSTHROW
density = TRUE
anchored = TRUE
climbable = TRUE

/obj/structure/platform/Initialize()
. = ..()
if(density && flags_1 & ON_BORDER_1)
var/static/list/loc_connections = list(
COMSIG_ATOM_EXIT = PROC_REF(on_exit),
)
AddElement(/datum/element/connect_loc, loc_connections)

/obj/structure/platform/corner
icon_state = "platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/industrial
icon_state = "industrial_platform"

/obj/structure/platform/industrial/corner
icon_state = "ind_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/industrial_alt
icon_state = "industrial2_platform"

/obj/structure/platform/industrial_alt/corner
icon_state = "ind2_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/military
icon_state = "military_platform"

/obj/structure/platform/military/corner
icon_state = "mil_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/ship
icon_state = "ship_platform"

/obj/structure/platform/ship/corner
icon_state = "ship_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/ship_two
icon_state = "ship2_platform"

/obj/structure/platform/ship_two/corner
icon_state = "ship2_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/ship_three
icon_state = "ship3_platform"

/obj/structure/platform/ship_three/corner
icon_state = "ship3_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/ship_four
icon_state = "ship4_platform"

/obj/structure/platform/ship_four/corner
icon_state = "ship4_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/wood
name = "wooden platform"
icon_state = "wood_platform"
resistance_flags = FLAMMABLE

/obj/structure/platform/wood/corner
icon_state = "wood_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/wood_two
name = "wooden platform"
icon_state = "fancy_wood_platform"
resistance_flags = FLAMMABLE

/obj/structure/platform/wood_two/corner
icon_state = "fwood_platform_corners"
density = FALSE
climbable = FALSE

/obj/structure/platform/attackby(obj/item/I, mob/living/user, params)
..()
add_fingerprint(user)

if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP)
if(obj_integrity < max_integrity)
if(!I.tool_start_check(user, amount=0))
return

to_chat(user, span_notice("You begin repairing [src]..."))
if(I.use_tool(src, user, 40, volume=50))
obj_integrity = max_integrity
to_chat(user, span_notice("You repair [src]."))
else
to_chat(user, span_warning("[src] is already in good condition!"))
return

/obj/structure/platform/deconstruct_act(mob/living/user, obj/item/I)
. = ..()
if(!I.tool_start_check(user, amount=0))
return FALSE
if(I.use_tool(src, user, 3 SECONDS, volume=0))
to_chat(user, span_warning("You cut apart the platform."))
deconstruct()
return TRUE

/obj/structure/platform/deconstruct(disassembled)
. = ..()
if(!loc) //quick check if it's qdeleted already.
return
if(!(flags_1 & NODECONSTRUCT_1))
qdel(src)

/obj/structure/platform/CanPass(atom/movable/mover, border_dir)
. = ..()
if(border_dir & dir)
return . || mover.throwing || mover.movement_type & (FLYING | FLOATING)
return TRUE

/obj/structure/platform/proc/on_exit(datum/source, atom/movable/leaving, direction)
SIGNAL_HANDLER

if(leaving == src)
return // Let's not block ourselves.

if(!(direction & dir))
return

if(!density)
return

if(leaving.throwing)
return

if(leaving.movement_type & (PHASING | FLYING | FLOATING))
return

if(leaving.move_force >= MOVE_FORCE_EXTREMELY_STRONG)
return

leaving.Bump(src)
return COMPONENT_ATOM_BLOCK_EXIT
Binary file added icons/obj/platform.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,7 @@
#include "code\game\objects\structures\noticeboard.dm"
#include "code\game\objects\structures\petrified_statue.dm"
#include "code\game\objects\structures\plasticflaps.dm"
#include "code\game\objects\structures\platforms.dm"
#include "code\game\objects\structures\poddoor_assembly.dm"
#include "code\game\objects\structures\printer.dm"
#include "code\game\objects\structures\radioactive.dm"
Expand Down

0 comments on commit 305cf1b

Please sign in to comment.