forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## About The Pull Request Теперь не сквашнимся
- Loading branch information
Showing
129 changed files
with
1,855 additions
and
289 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,52 @@ | ||
name: Discord Discussions | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- labeled | ||
- closed | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: "discord-discussions-${{ github.head_ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
manage-discord-discussion: | ||
name: Manage Discord Discussion | ||
runs-on: ubuntu-latest | ||
if: contains(github.event.pull_request.labels.*.name, 'Discord Discussion') | ||
steps: | ||
- name: Fail if vars.DISCORD_DISCUSSIONS_CHANNEL_ID is unset | ||
if: ${{ vars.DISCORD_DISCUSSIONS_CHANNEL_ID == '' }} | ||
run: | | ||
echo "vars.DISCORD_DISCUSSIONS_CHANNEL_ID (${{ vars.DISCORD_DISCUSSIONS_CHANNEL_ID }}) must be set to use this label!" | ||
exit 1 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 8.0.x | ||
dotnet-quality: ga | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Tgstation.DiscordDiscussions | ||
run: dotnet publish -c Release -o discord_discussions_bins tools/Tgstation.DiscordDiscussions/Tgstation.DiscordDiscussions.csproj | ||
|
||
- name: Generate App Token | ||
id: app-token-generation | ||
uses: getsentry/action-github-app-token@d4b5da6c5e37703f8c3b3e43abb5705b46e159cc | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Run Tgstation.DiscordDiscussions | ||
run: dotnet discord_discussions_bins/Tgstation.DiscordDiscussions.dll ${{ steps.app-token-generation.outputs.token }} ${{ github.repository_owner }} ${{ github.event.repository.name }} ${{ github.event.pull_request.number }} ${{ github.event.pull_request.merged && 'merged' || github.event.pull_request.state }} ${{ secrets.DISCORD_DISCUSSIONS_TOKEN }} ${{ vars.DISCORD_DISCUSSIONS_CHANNEL_ID }} ${{ github.event.action == 'reopened' && 'true' || 'false' }} ${{ vars.DISCORD_JOIN_LINK }} | ||
env: | ||
GITHUB_PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/// This component applies tint to clothing when its exposed to pepperspray, used in /obj/item/clothing/mask/gas. | ||
|
||
/datum/component/clothing_dirt | ||
/// Amount of dirt stacks on the clothing | ||
var/dirtiness = 0 | ||
|
||
/datum/component/clothing_dirt/Initialize() | ||
if(!isclothing(parent)) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
/datum/component/clothing_dirt/RegisterWithParent() | ||
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine)) | ||
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip)) | ||
RegisterSignal(parent, COMSIG_ITEM_DROPPED, PROC_REF(on_drop)) | ||
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, PROC_REF(on_clean)) | ||
RegisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS, PROC_REF(on_expose), TRUE) | ||
|
||
/datum/component/clothing_dirt/UnregisterFromParent() | ||
var/obj/item/clothing/clothing = parent | ||
clothing.tint -= dirtiness | ||
if(iscarbon(clothing.loc)) | ||
var/mob/living/carbon/wearer = clothing.loc | ||
wearer.update_tint() | ||
UnregisterSignal(wearer, COMSIG_ATOM_EXPOSE_REAGENTS) | ||
else | ||
UnregisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS) | ||
UnregisterSignal(parent, list( | ||
COMSIG_ATOM_EXAMINE, | ||
COMSIG_ITEM_EQUIPPED, | ||
COMSIG_MOB_UNEQUIPPED_ITEM, | ||
COMSIG_COMPONENT_CLEAN_ACT, | ||
)) | ||
return ..() | ||
|
||
/datum/component/clothing_dirt/proc/on_equip(datum/source, mob/user, slot) | ||
SIGNAL_HANDLER | ||
var/obj/item/clothing/clothing = parent | ||
if (!(slot & clothing.slot_flags)) | ||
return | ||
UnregisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS) | ||
RegisterSignal(user, COMSIG_ATOM_EXPOSE_REAGENTS, PROC_REF(on_expose), TRUE) | ||
|
||
/datum/component/clothing_dirt/proc/on_drop(datum/source, mob/holder) | ||
SIGNAL_HANDLER | ||
UnregisterSignal(holder, COMSIG_ATOM_EXPOSE_REAGENTS) | ||
RegisterSignal(parent, COMSIG_ATOM_EXPOSE_REAGENTS, PROC_REF(on_expose), TRUE) | ||
|
||
/datum/component/clothing_dirt/proc/on_examine(datum/source, mob/user, list/examine_list) | ||
SIGNAL_HANDLER | ||
if (dirtiness > 0) | ||
examine_list += span_warning("It appears to be covered in some oily substance. Won't see much while wearing it until you wash it off.") | ||
|
||
/datum/component/clothing_dirt/proc/on_expose(atom/target, list/reagents, datum/reagents/source, methods) | ||
SIGNAL_HANDLER | ||
|
||
var/mob/living/carbon/wearer | ||
if(iscarbon(target)) | ||
wearer = target | ||
if(is_protected(wearer)) | ||
return | ||
|
||
var/datum/reagent/consumable/condensedcapsaicin/pepper = locate() in reagents | ||
if(isnull(pepper)) | ||
return | ||
|
||
var/obj/item/clothing/clothing = parent | ||
if (methods & (TOUCH | VAPOR)) | ||
clothing.tint -= dirtiness | ||
dirtiness = min(dirtiness + round(reagents[pepper] / 5), 3) | ||
clothing.tint += dirtiness | ||
if(!isnull(wearer)) | ||
wearer.update_tint() | ||
|
||
/datum/component/clothing_dirt/proc/is_protected(mob/living/carbon/wearer) | ||
return wearer.head && (wearer.head.flags_cover & PEPPERPROOF) | ||
|
||
/datum/component/clothing_dirt/proc/on_clean(datum/target, clean_types) | ||
SIGNAL_HANDLER | ||
var/obj/item/clothing/clothing = parent | ||
var/mob/living/carbon/wearer | ||
if(iscarbon(clothing.loc)) | ||
wearer = clothing.loc | ||
|
||
if (clean_types & (CLEAN_WASH|CLEAN_SCRUB)) | ||
clothing.tint -= dirtiness | ||
dirtiness = 0 | ||
if(!isnull(wearer)) | ||
wearer.update_tint() |
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
Oops, something went wrong.