forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Пишите **НИЖЕ** заголовков и **ВЫШЕ** комментариев, иначе что то может пойти не так. --> <!-- Вы можете прочитать Contributing.MD, если хотите узнать больше. --> ## Что этот PR делает Добавляет платформы (2 варианта), которые можно скрафтить. Работают по принципу с railing. ПР был взят отсюда. Спрайты были перекрашены, код малость дополнен Helixis#787 ## Почему это хорошо для игры Больше декоративных решений ## Изображения изменений (Примеры использования) ![image](https://github.com/ss220club/Paradise-SS220/assets/20109643/17690f12-b7e1-46f9-a7bd-072197463e76) ![image](https://github.com/ss220club/Paradise-SS220/assets/20109643/84e06745-48e1-44bb-95f1-326f6fd9ec52) ![image](https://github.com/ss220club/Paradise-SS220/assets/20109643/95ac559d-5743-4bfa-b1cd-07473f1b683a) ![image](https://github.com/ss220club/Paradise-SS220/assets/20109643/981f681f-f53c-42b8-a17e-6c6b0be5d6f4) ## Тестирование Проверял в игре ## Changelog :cl: add: Платформы /:cl: <!-- Оба :cl:'а должны быть на месте, что-бы чейнджлог работал! Вы можете написать свой ник справа от первого :cl:, если хотите. Иначе будет использован ваш ник на ГитХабе. --> <!-- Вы можете использовать несколько записей с одинаковым префиксом (Они используются только для иконки в игре) и удалить ненужные. Помните, что чейнджлог должен быть понятен обычным игроком. --> <!-- Если чейнджлог не влияет на игроков(например, это рефактор), вы можете исключить всю секцию. -->
- Loading branch information
Showing
5 changed files
with
228 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/datum/modpack/objects | ||
name = "Объекты" | ||
desc = "В основном включает в себя портированные объекты и всякие мелочи, которым не нужен отдельный модпак." | ||
author = "dj-34" | ||
|
||
// Maybe it would be better, if i didn't make it modular, because i can't change order in the recipe list :catDespair: | ||
/datum/modpack/objects/initialize() | ||
GLOB.metal_recipes += list( | ||
new /datum/stack_recipe("metal platform", /obj/structure/platform, 4, time = 30,one_per_turf = TRUE, on_floor = TRUE), | ||
new /datum/stack_recipe("metal platform corner", /obj/structure/platform/corner, 2, time = 20, one_per_turf = TRUE, on_floor = TRUE) | ||
) | ||
|
||
GLOB.plasteel_recipes += list( | ||
new /datum/stack_recipe("reinforced plasteel platform", /obj/structure/platform/reinforced, 4, time = 40,one_per_turf = TRUE, on_floor = TRUE), | ||
new /datum/stack_recipe("reinforced plasteel platform corner", /obj/structure/platform/reinforced/corner, 2, time = 30,one_per_turf = TRUE, on_floor = TRUE) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "_objects.dm" | ||
|
||
#include "code/platform.dm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
// Platform Code by Danaleja2005 | ||
/obj/structure/platform | ||
name = "platform" | ||
icon = 'modular_ss220/objects/icons/platform.dmi' | ||
icon_state = "metal" | ||
desc = "A metal platform." | ||
flags = ON_BORDER | ||
anchored = FALSE | ||
climbable = TRUE | ||
max_integrity = 200 | ||
armor = list("melee" = 10, "bullet" = 10, "laser" = 10, "energy" = 50, "bomb" = 20, "bio" = 0, "rad" = 0, "fire" = 30, "acid" = 30) | ||
var/corner = FALSE | ||
var/material_type = /obj/item/stack/sheet/metal | ||
var/material_amount = 4 | ||
var/decon_speed | ||
|
||
/obj/structure/platform/proc/CheckLayer() | ||
if(dir == SOUTH) | ||
layer = ABOVE_MOB_LAYER | ||
else if(corner || dir == NORTH) | ||
layer = BELOW_MOB_LAYER | ||
|
||
/obj/structure/platform/setDir(newdir) | ||
. = ..() | ||
CheckLayer() | ||
|
||
/obj/structure/platform/Initialize() | ||
. = ..() | ||
CheckLayer() | ||
|
||
/obj/structure/platform/New() | ||
..() | ||
if(corner) | ||
decon_speed = 20 | ||
density = FALSE | ||
climbable = FALSE | ||
else | ||
decon_speed = 30 | ||
CheckLayer() | ||
|
||
/obj/structure/platform/examine(mob/user) | ||
. = ..() | ||
. += span_notice("[src] is [anchored == TRUE ? "screwed" : "unscrewed"] [anchored == TRUE ? "to" : "from"] the floor.") | ||
|
||
/obj/structure/platform/verb/rotate() | ||
set name = "Rotate Platform Counter-Clockwise" | ||
set category = "Object" | ||
set src in oview(1) | ||
|
||
if(usr.incapacitated()) | ||
return | ||
|
||
if(anchored) | ||
to_chat(usr, span_warning("[src] cannot be rotated while it is screwed to the floor!")) | ||
return FALSE | ||
|
||
var/target_dir = turn(dir, 90) | ||
|
||
setDir(target_dir) | ||
air_update_turf(1) | ||
add_fingerprint(usr) | ||
return TRUE | ||
|
||
/obj/structure/platform/verb/revrotate() | ||
set name = "Rotate Platform Clockwise" | ||
set category = "Object" | ||
set src in oview(1) | ||
|
||
if(usr.incapacitated()) | ||
return | ||
|
||
if(anchored) | ||
to_chat(usr, span_warning("[src] cannot be rotated while it is screwed to the floor!")) | ||
return FALSE | ||
|
||
var/target_dir = turn(dir, 270) | ||
|
||
setDir(target_dir) | ||
air_update_turf(1) | ||
add_fingerprint(usr) | ||
return TRUE | ||
|
||
/obj/structure/platform/AltClick(mob/user) | ||
rotate() | ||
|
||
// Construction | ||
/obj/structure/platform/screwdriver_act(mob/user, obj/item/I) | ||
. = TRUE | ||
to_chat(user, span_notice("You begin [anchored == TRUE ? "unscrewing" : "screwing"] [src] [anchored == TRUE ? "from" : "to"] the floor.")) | ||
if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume)) | ||
return | ||
to_chat(user, span_notice("You [anchored == TRUE ? "unscrew" : "screw"] [src] [anchored == TRUE ? "from" : "to"] the floor.")) | ||
anchored = !anchored | ||
|
||
/obj/structure/platform/wrench_act(mob/user, obj/item/I) | ||
if(user.a_intent != INTENT_HELP) | ||
return | ||
. = TRUE | ||
if(anchored) | ||
to_chat(user, span_notice("You cannot disassemble [src], unscrew it first!")) | ||
return | ||
TOOL_ATTEMPT_DISMANTLE_MESSAGE | ||
if(!I.use_tool(src, user, decon_speed, volume = I.tool_volume)) | ||
return | ||
var/obj/item/stack/sheet/G = new material_type(user.loc, material_amount) | ||
G.add_fingerprint(user) | ||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1) | ||
TOOL_DISMANTLE_SUCCESS_MESSAGE | ||
qdel(src) | ||
|
||
|
||
/obj/structure/platform/CheckExit(atom/movable/O, turf/target) | ||
if(!anchored) | ||
CheckLayer() | ||
if(istype(O, /obj/structure/platform)) | ||
return FALSE | ||
if(istype(O, /obj/item/projectile)) | ||
return TRUE | ||
if(corner) | ||
return !density | ||
if(O && O.throwing) | ||
return TRUE | ||
if(((flags & ON_BORDER) && get_dir(loc, target) == dir)) | ||
return FALSE | ||
else | ||
return TRUE | ||
|
||
/obj/structure/platform/CanPass(atom/movable/mover, turf/target) | ||
if(!anchored) | ||
CheckLayer() | ||
if(istype(mover, /obj/structure/platform)) | ||
return FALSE | ||
if(istype(mover, /obj/item/projectile)) | ||
return TRUE | ||
if(corner) | ||
return !density | ||
if(mover && mover.throwing) | ||
return TRUE | ||
var/obj/structure/S = locate(/obj/structure) in get_turf(mover) | ||
if(S && S.climbable && !(S.flags & ON_BORDER) && climbable && isliving(mover))// Climbable objects allow you to universally climb over others | ||
return TRUE | ||
if(!(flags & ON_BORDER) || get_dir(loc, target) == dir) | ||
return FALSE | ||
else | ||
return TRUE | ||
|
||
/obj/structure/platform/do_climb(mob/living/user) | ||
if(!can_touch(user) || !climbable) | ||
return | ||
var/blocking_object = density_check() | ||
if(blocking_object) | ||
to_chat(user, span_warning("You cannot climb over [src], as it is blocked by \a [blocking_object]!")) | ||
return | ||
|
||
var/destination_climb = get_step(src, dir) | ||
if(is_blocked_turf(destination_climb)) | ||
to_chat(user, span_warning("You cannot climb over [src], the path is blocked!")) | ||
return | ||
var/turf/T = src.loc | ||
if(!T || !istype(T)) return | ||
|
||
if(get_turf(user) == get_turf(src)) | ||
usr.visible_message(span_warning("[user] starts climbing over \the [src]!")) | ||
else | ||
usr.visible_message(span_warning("[user] starts getting off \the [src]!")) | ||
climber = user | ||
if(!do_after(user, 50, target = src)) | ||
climber = null | ||
return | ||
|
||
if(!can_touch(user) || !climbable) | ||
climber = null | ||
return | ||
|
||
if(get_turf(user) == get_turf(src)) | ||
usr.loc = get_step(src, dir) | ||
usr.visible_message(span_warning("[user] leaves \the [src]!")) | ||
else | ||
usr.loc = get_turf(src) | ||
usr.visible_message(span_warning("[user] starts climbing over \the [src]!")) | ||
climber = null | ||
|
||
/obj/structure/platform/CanAtmosPass() | ||
return TRUE | ||
|
||
// Platform types | ||
/obj/structure/platform/reinforced | ||
name = "reinforced platform" | ||
desc = "A robust platform made of plasteel, more resistance for hazard sites." | ||
icon_state = "plasteel" | ||
material_type = /obj/item/stack/sheet/plasteel | ||
max_integrity = 300 | ||
armor = list("melee" = 20, "bullet" = 30, "laser" = 30, "energy" = 100, "bomb" = 50, "bio" = 0, "rad" = 75, "fire" = 100, "acid" = 100) | ||
|
||
// Platform corners | ||
/obj/structure/platform/corner | ||
name = "platform corner" | ||
desc = "A metal platform corner." | ||
icon_state = "metalcorner" | ||
corner = TRUE | ||
material_amount = 2 | ||
|
||
/obj/structure/platform/reinforced/corner | ||
name = "reinforced platform corner" | ||
desc = "A robust platform corner made of plasteel, more resistance for hazard sites." | ||
icon_state = "plasteelcorner" | ||
corner = TRUE | ||
material_amount = 2 |
Binary file not shown.