forked from TauCetiStation/TauCetiClassic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'TauCetiStation:master' into master
- Loading branch information
Showing
16 changed files
with
128 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Разрушаемость | ||
|
||
Фреймворк разрушаемости был портирован в https://github.com/TauCetiStation/TauCetiClassic/pull/9835, но еще не все предметы переписаны под него. | ||
|
||
## Как включить для предмета | ||
|
||
Необходимый минимум - переопределить ``max_integrity`` и ``resistance_flags`` у объекта, например | ||
|
||
``` | ||
max_integrity = 100 // "hp" предмета | ||
resistance_flags = CAN_BE_HIT // включает возможность ударить предмет | ||
``` | ||
|
||
При инициализации объект выставит ``atom_integrity`` соответствующе с ``max_integrity``, при получении урона и достижении ``atom_integrity`` нуля будет вызвана процедура разрушения. | ||
|
||
Ниже перечислены опциональные возможности и твики системы. | ||
|
||
### integrity_failure и atom_break()/atom_fix() | ||
|
||
До достижения полного разрушения можно добавить объекту промежуточную стадию сломанности - объект еще существует, но может уже не работать, или работать не корректно. | ||
|
||
``integrity_failure`` - процентное соотношение от ``max_integrity``, на котором объект "ломается". Значение от 0 до 1, где 0.5 это 50% от ``max_integrity``. | ||
|
||
``/atom_break()`` - процедура, которая будет вызвана при достижении объектом ``integrity_failure``, и в которой вы должны прописать соответствующее поведение поломки (утрату функционала и тому подобное). | ||
|
||
``/atom_fix()`` - если объект можно починить (вернуть потерянное integrity), то это процедура, которая будет вызвана при достижении объектом integrity выше ``integrity_failure``, и в которой вы должны прописать соответствующее поведение починки (возвращение функционала и тому подобное). | ||
|
||
|
||
### atom_destruction(), deconstruct(), burn() и Destroy() | ||
|
||
Когда ``atom_integrity`` достигает 0, вызывается ряд процедур в следующем порядке: | ||
|
||
``atom_destruction()`` -> (обработчики в зависимости от типа урона, уничтожившего объект: ``burn()`` или ``deconstruct()``) -> ``Destroy()`` | ||
|
||
Вы можете переопределить их и на любом уровне подцепить свои эффекты, например, звук разрушения или спавн обломков. | ||
|
||
``Destroy()`` вызывается всегда при уничтожении или разбора атома и более низкоуровневая процедура, про него можно почитать в [``/.github/wiki/HARDDELETES.md``](/.github/wiki/HARDDELETES.md). | ||
|
||
### Armor и damage_deflection | ||
|
||
``armor`` - список сопротивляемости предмета к определенным типам урона. Например, | ||
|
||
``` | ||
armor = list(MELEE = 50, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 100, ACID = 100) | ||
``` | ||
|
||
будет значить, что объект будет игнорировать 50% от полученного урона от ударов в ручную, 100% от огня и кислоты. | ||
|
||
Технически, вы можете использовать отрицательный коэффициент, но это не рекомендуется из-за плохой читаемости. | ||
|
||
``damage_deflection`` - "порог" урона, который вовсе игнорируется. Например, если вы не хотите, чтобы кто-то мог расковырять металлическую стену ручкой. | ||
|
||
``` | ||
damage_deflection = 5 | ||
``` | ||
|
||
Будет значить, что любой урон меньше 5 игнорируется и не влияет на объект, юзер получит соответствующее сообщение о тщетности своих попыток. | ||
|
||
Стоит учесть, что атом сначала проверяет урон на ``damage_deflection``, и уже только потом применяет коэффициент брони. | ||
|
||
### Другие resistance_flags | ||
|
||
Более полный и актуальный список флагов всегда можно посмотреть в [``/code/__DEFINES/flags.dm``](/code/__DEFINES/flags.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
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
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
3 changes: 2 additions & 1 deletion
3
code/modules/events/roundstart_events/area/replace/med_storage.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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/datum/event/feature/area/replace/med_storage | ||
special_area_types = list(/area/station/medical/storage) | ||
replace_types = list( | ||
/obj/item/weapon/storage/firstaid = null | ||
/obj/item/weapon/storage/firstaid = null, | ||
/obj/machinery/vending/firstaid = null | ||
) |
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.