Compare commits

...

429 Commits

Author SHA1 Message Date
comasqw
a20f2ba6a3 refactor Prototype class init 2024-11-19 17:12:42 +04:00
comasqw
c00de7fd09 refactor 2024-11-19 17:09:14 +04:00
Ed
ef6f23e4b8 Remove demiplan fun (#587)
* disable roomfills

* demiplan examination random disable
2024-11-16 17:37:06 +03:00
Ed
06308961ed Revert "Revert "Added personal signature system"" (#586)
* Revert "Revert "Added personal signature system (#382)" (#471)"

This reverts commit 9f93931057.

* Update pen.yml
2024-11-16 17:30:38 +03:00
Ed
7a0fb9fc15 fix wallmounted (#585) 2024-11-15 23:54:58 +03:00
Ed
5bcc378bbe Clean up, increase build stability (#583)
* Update base.yml

* bandit -> sociopath

* some fixes

* syringe

* vaults

* Update ContentAudioSystem.CP14AmbientLoop.cs
2024-11-13 17:56:07 +03:00
Ed
df4900e148 Demiplan examination (#578)
* demiplan examining

* cargo demiplanes update

* Update positions_buy.ftl

* Update crates.yml
2024-11-12 13:33:19 +03:00
Ed
b106554cfe Prototypes work (#579)
* wrench

* station crates

* bottles

* barrel openable

* Update crates.yml

* mop fix

* broom fix

* crossbolt size fix

* bottles fix

* Update closets.yml

* Update anvil.yml

* Update crates.yml
2024-11-12 12:42:45 +03:00
Ed
0196f6158a update (#577) 2024-11-11 12:05:23 +03:00
Ed
ae4fa34b90 New demiplan location, MORE ZOMBIES (#576)
* new location, increase zombie spawnrate

* new caves demiplan location
2024-11-10 22:59:02 +03:00
Psycrow
45dc4739fd Update drinks_cups.yml (#570)
* Update drinks_cups.yml

* Testing

* Revert "не то жмал"

* Пришлось мне пройти через это

* mug -> vial

* test

* Делаем мир легче
2024-11-10 22:08:24 +03:00
Jaraten
caee7c1f97 stone & wooden decals (#574)
* stone & wooden decals

* typo

* fucken github
2024-11-10 22:07:13 +03:00
Ed
6f0bb473d2 Simple resurrection spell (#575)
* resurrection spell

* Update spawners.yml
2024-11-10 19:17:04 +03:00
Ed
84e07c1ded Next spellStorage experiment (#572)
* scroll spells

* refactor magic system

* Update spawners.yml

* safe use

* Update magic-spells.ftl

* fix magic containers

* fix mole

* all scrolls

* remove shadow step ring

* fix scrolls
2024-11-10 16:15:08 +03:00
Ed
c8ab937cf0 Spell scrolls (#571)
* scroll spells

* refactor magic system

* Update spawners.yml

* safe use

* Update magic-spells.ftl
2024-11-09 17:55:16 +03:00
Ed
6147740f3e Try fix master constantly fails (#567)
* try to fix

* Update entities.ftl

* Update entities.ftl

* Update entities.ftl

* Update entities.ftl

* Update entities.ftl

* Update entities.ftl
2024-11-09 13:07:12 +03:00
Psycrow
2f91247fa2 Fix stone breeds (#559)
* Fix Stone Breeds

* Fix 1

* FIx 2

* Fix 3

* Round 4

* Final Fix
2024-11-08 21:33:19 +03:00
Psycrow
8013b883c1 Add throwing tomatoes and fix (#548)
* Add throwing tomatoes and fix

Tomatoes like in real life

* Update produce.yml

* Update produce.yml
2024-11-08 14:15:45 +03:00
Psycrow
682b0f7b78 Delete structures on workbench (#549)
* Transfer of crafting barrels

* Sorry, error fix

* Come on, Work!
2024-11-08 13:29:02 +03:00
Nim
c7b230857f Royal pumpkin (#547)
* royal pumpkin

* Secret zombie fix

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
2024-11-08 10:26:08 +03:00
Nim
e062d386fc Herbal bandages and gauze (#545)
* gauze and bandage

* fix

* spawn

* dele

* doAfter buff

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
Co-authored-by: Ed <edwardxperia2000@gmail.com>
2024-11-08 09:26:31 +03:00
Ed
87dc3f9fa5 Order board (#546)
* orders board! work for the Witcher

* stamps

* wtf

* Update closets.yml
2024-11-08 00:10:59 +03:00
Nim
12a838ac8e Zombies on style (#531)
* zombie styl

* random

* randomrandom

* random3

* random4

* random5

* Random6

* random7

* mega zombie nerf

* Update zombie.yml

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
Co-authored-by: Ed <edwardxperia2000@gmail.com>
2024-11-07 23:20:03 +03:00
Ed
ab7296ff4a Demiplan ruins (#544)
* ruins

* Update spawners.yml
2024-11-07 17:45:21 +03:00
Ed
ebac4a2eec Spellcasting upgrade (#543)
* move to gurps magic types

* spell traits, categorize spells

* Update TraitSystem.cs

* magic spells item provider

* Update twoHandedStaffs.yml

* Update CP14MagicManacostModifySystem.cs

* Update CP14SpellStorageSystem.cs

* some funny shit

* fix problems 1

* FIX

* more funny broken shit

* predict slowdown, fixes funny

* EntityTarget action

* fixes

* Update T1_sphere_of_light.yml

* fix demiplan loot centering

* predict movement!
2024-11-07 16:04:49 +03:00
Ed
7e4fb90e02 Spell T0 traits, recategorize magic (#540)
* move to gurps magic types

* spell traits, categorize spells

* Update TraitSystem.cs

* magic spells item provider

* Update twoHandedStaffs.yml

* Update CP14MagicManacostModifySystem.cs

* Update CP14SpellStorageSystem.cs
2024-11-06 18:02:37 +03:00
Ed
0f091b4cdf Merge pull request #542 from crystallpunk-14/ed-06-11-2024-upstream
Ed 06 11 2024 upstream
2024-11-06 17:06:40 +03:00
Ed
955145a9a5 Merge remote-tracking branch 'upstream/master' into ed-06-11-2024-upstream
# Conflicts:
#	Resources/Changelog/Changelog.yml
#	Resources/Credits/GitHub.txt
#	Resources/Prototypes/Entities/Mobs/Player/silicon.yml
2024-11-06 16:53:24 +03:00
Ed
ae27cf7e08 Revert "Merge remote-tracking branch 'upstream/master' into ed-06-11-2024-upstream"
This reverts commit 1579da881a, reversing
changes made to a9bdab0705.
2024-11-06 16:52:08 +03:00
Ed
1579da881a Merge remote-tracking branch 'upstream/master' into ed-06-11-2024-upstream 2024-11-06 16:51:42 +03:00
PJBot
24e6b9f42c Automatic changelog update 2024-11-06 13:21:12 +00:00
slarticodefast
8ddc5435a6 remove wanted list cartridge from captain PDA (#33084)
remove wanted list from captain PDA
2024-11-06 14:20:05 +01:00
Ed
a9bdab0705 Magic types, magic clothing (#539)
* magic types + auto magic spell description

* manacost calculation event

* manacost ffect clothing

* Update orbs.yml

* magic type not required
2024-11-06 08:44:03 +03:00
PJBot
d18dba982b Automatic changelog update 2024-11-06 03:30:07 +00:00
Baptr0b0t
bcfacec287 Fix AI in Intelicard can see through walls (#33177)
setdrawfov added
2024-11-05 21:28:58 -06:00
slarticodefast
1ded8e7f03 fix artifact debug assert (#33171)
* fix artifact debug assert

* do the same for EffectBigIron

* 1 tab less
2024-11-05 23:12:35 +01:00
PJBot
2382162d72 Automatic changelog update 2024-11-05 18:19:35 +00:00
Errant
da19abdc76 Don't show Reinforcement codewords on round end (#33181)
Don't show unused codeword sets
2024-11-05 19:18:28 +01:00
PJBot
564606a532 Automatic changelog update 2024-11-05 16:59:31 +00:00
Kirus59
cb59826dcb Hunger and thirst huds fix (#32832)
* Hunger and thirst huds fix

* delete poor caching
2024-11-05 17:58:23 +01:00
Ed
b5df675187 Spellcaster slowdown, mole nerf, new shoulder slot, healing staff (#538)
* healing staff sprite

* new back slot and move all big things to whis slot

* replace ring to staff

* caster sowdown! Mole rebalance

* loadouts fix

* fix weapon rotation

* Update spawners.yml
2024-11-05 19:05:40 +03:00
Ed
c3d4303270 directional windows fix (#537) 2024-11-05 13:26:34 +03:00
Ed
120386bb2d Windows + weapon shiny (#536)
* add wooden window crafting

* weapon resprite

* Update anvil.yml

* Update walls.yml
2024-11-05 12:12:21 +03:00
PJBot
aef7dd514b Automatic changelog update 2024-11-05 00:13:37 +00:00
DrSmugleaf
8f87bad83c Fix DisplayVotes doing nothing for a vote (#33170) 2024-11-05 01:12:29 +01:00
Nim
26cf6dc01a petting (#535) 2024-11-04 18:35:56 +03:00
Ed
54c7a40967 Blacksmith role (#534)
* disable crowbar door prying

* blacksmith role

* finish role

* map update

* more recipes to anvil

* Update arenas.yml

* glass!

* ores rebalance
2024-11-04 16:25:19 +03:00
PJBot
01ac967640 Automatic changelog update 2024-11-04 11:24:18 +00:00
Zachary Higgs
a3f10ccfbb Add Silicon Law cues to Every method a Silicon can have their laws change (#32887)
* Silicon Law Sound cue refactor

- Added CueEntityMind to Silicon Law system to more uniformally
send sounds to minds

- Switch all previous MindPlaySound to instead call to the new method

* Change SiliconLawEui to cue the mind

* CR: TryGetComponent and Change the Documentation

- Remove GetComponentOrNull for  _entityManager.TryGetComponent

- Change SiliconLawProviderComponent.LawUploadSound to be more general
rather than just referencing lawboards

* Update Content.Server/Silicons/Laws/SiliconLawEui.cs

* Update Content.Shared/Silicons/Laws/Components/SiliconLawProviderComponent.cs

* Silicon-law-cue-refactor - CR:

- Roll the cuing into NotifyLawsChanged via an optional variable for the
cue

- Modify "SetLaws" to take in an optional soundProvider for the cue

- modify Emagged, Ion, Eui and SetLaws to instead send the sound cue via
NotifyLawsChanged

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-11-04 12:23:12 +01:00
Ed
c21dd891f3 Endscreen message + command objectives updadte (#533)
* add simple end screen common goals

* finish common objectives endscreen

* personal objectives endscreen

* Update personal_objectives.yml

* new empire objectives
2024-11-04 13:41:09 +03:00
PJBot
4ba8e351fe Automatic changelog update 2024-11-04 03:34:57 +00:00
Preston Smith
5b4f4237a3 Fix: Web Clothing Butcher Issues (#33121)
* Make boot web cost equal to one cloth

* Make boots and coat butcher into web

* Remove unneeded default
2024-11-03 21:33:51 -06:00
PJBot
75dd790aa6 Automatic changelog update 2024-11-04 03:25:28 +00:00
Boolean-Buckeye
ad78b30ca3 make emergency lights (de)constructable (#32945)
* add an emergency light node to the LightFixture construction graph
* add a recipe entry to the construction menu for emergency light
* make emergency light entity at the emergency light node on the graph
* Make emergency light destroy to 1 steel and 1 glass shard to match
  the construction recipe

Co-authored-by: BooleanBuckeye <booleanbuckeye@gmail.com>
2024-11-03 21:24:22 -06:00
Tr1bute
f5fac7c5f2 Made the SpeciesChange mutation no longer transfer with Sterile Swabs. (#33126)
Made the SpeciesChange mutation no longer persist.

There was an issue where swabbing a mutated plant species: I.e Blood Tomato to a regular Tomato sapling would transfer the species mutation. It would not actually get the effect, which is probably why it went under the radar. This change makes it so that the SpeciesChange mutation cannot be transferred via swabbing.
2024-11-03 21:09:07 -06:00
Michael Krebs
5d9acb7643 fix: Remove duplicate light blue towel from misc loadout (#33145)
remove duplicate towel from misc loadout
2024-11-03 21:06:52 -06:00
PJBot
b8b958dfdb Automatic changelog update 2024-11-04 00:57:47 +00:00
Tr1bute
83f7d3f3df Added Popup for the Ligneous plant mutation when using hands. (#33136)
* Added Popup for the Ligneous plant mutation when using hands.

There was some confusion for players with the Ligneous mutation which makes the plant harvestable only with sharp tools. Adding a popup with the message "The plant is too tough." to give them a hint to use something other than just their hands.

I decided to only put the message when attempting to harvest using hands, as the intent is clear that the player just wanted to harvest, but wasn't able to. Using any other tools like a crowbar or a screwdriver will not trigger the popup.

* Update Resources/Locale/en-US/botany/components/plant-holder-component.ftl

Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>

---------

Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
2024-11-04 01:56:41 +01:00
PJBot
9a5152832a Automatic changelog update 2024-11-04 00:50:49 +00:00
MilenVolf
cc3a19c212 Collapsible ghost roles menu (#32717)
* Make ghost roles collapsible

* Save `BodyVisible` state of each `Collapsible` box

* Make ghost role collapsible only when group has more than 1 role

* Make it a little prettier

* Make only ghost role buttons collapsible

* Apply requested changes

* Typo

* Small cleanup

* Store in list, instead of iterating

* Make unique ids more unique

* Move it out of the cycle

* Make _collapsibleBoxes into dictionary and use key instead of Collapsible boxes names

Added TODO. So after the problem will be fixed in `GhostRolesEui`, it should be mirrored and fixed here too.

* Put TODO in GhostRolesEui. I guess Issue must be made for this

* Use HashSet instead of Dictionary as suggested. Invert the HashSet, so being present means it uncollapsed

I decided to invert HashSet to _uncollapsedStates, because players surely will have more collapsed buttons than opened, so we optimise memory usage a little bit.

* Remove extra space from ghost roles window

* Add buttons stretching. Size 3:1
2024-11-04 01:49:42 +01:00
Ed
16a0b99daf Magic crystal lanterns + Aftertest balance (#532)
* lamp visual update

* deleete ice floor spell

* mana gift spell

* magic lantern

* wallmount crystal lamps

* QoL

* crafting

* Update StyleNano.cs

* examining simplify

* rings name

* remove snakes modifier

* trinkets update

* remove snakes, add boars and rabbits to demiplans

* Update flashlight.yml

* fix

* Update test.yml

* Update migration.yml

* ыы
2024-11-04 00:55:15 +03:00
Nim
98854c01d7 Mole and small hydra (#527)
* mobs

* fix sprite

* fix f
2024-11-03 19:39:33 +03:00
Ed
53df2848c4 Demiplan polishing v4 (#530)
* Wizden PR copy

* sync

* Update DungeonJob.PostGenBiome.cs

* Update DungeonJob.PostGenBiome.cs

* some rebalance

* required exits and enters!

* room fill fix

* snakes nerf

* enable En-US localization for playtest

* guidebook update

* hotfix!!!

* anchoring deletion

* trying fix caves

* Update RoomFillSystem.cs

* disable locations for test

* Update CP14SpawnRandomDemiplaneJob.cs

* Update required_layers.yml

* Revert "Update required_layers.yml"

This reverts commit 2dd33db282.

* finally

* Update ContentLocalizationManager.cs

* Update spawners.yml

* Update test.yml

* fix
2024-11-03 14:40:21 +03:00
PJBot
a0ef431255 Automatic changelog update 2024-11-03 11:26:38 +00:00
Plykiya
912ac2c069 Bugfix: Wielding now uses identity system. (#33134)
Make wielding system use identity
2024-11-03 12:25:30 +01:00
github-actions[bot]
d2a487dc9e Update Credits (#33125)
Co-authored-by: PJBot <pieterjan.briers+bot@gmail.com>
2024-11-03 02:21:44 +01:00
Flareguy
d993582d00 Fix broken computer white shadows (#33103)
fix broken computer white shadows
2024-11-03 00:16:18 +01:00
Flareguy
4a39341e46 Delete conveyor_old.rsi (#33102) 2024-11-02 23:23:40 +01:00
RiceMar1244
0ba3350c7e Combat and survival knife storage/inhand sprites (#33111)
* Adds storage sprites for combat knife and survival knife. Replaces inhand sprites.

* Fixes meta.json copyright
2024-11-02 14:55:15 -05:00
Milon
6f1eeba191 change ShowHealthBars and ShowHealthIcons to use protoId (#32355)
use protoId
2024-11-02 17:59:38 +01:00
Scribbles0
65462d8ca5 Cardboard Box Capacity 4 -> 5 (#32743)
* capacity upgrade

* comment update
2024-11-02 17:21:35 +01:00
PJBot
a3ce9b0db4 Automatic changelog update 2024-11-02 15:13:31 +00:00
joshepvodka
8c1281adf7 Adds headphones to loadouts (#33067)
added headphones to trinkets
2024-11-02 16:12:25 +01:00
PJBot
db4b2e0a6f Automatic changelog update 2024-11-02 15:05:28 +00:00
Centronias
e7ca4b8f2f Intercoms and Radios both pick up proximate speech (#32737)
* Deduping of recent messages should consider the channel it's being sent to

* rerun actions
2024-11-02 16:04:22 +01:00
Ed
51f4ec84d5 Demiplan polishing v3 (#529)
* Wizden PR copy

* sync

* Update DungeonJob.PostGenBiome.cs

* Update DungeonJob.PostGenBiome.cs

* some rebalance

* required exits and enters!

* room fill fix

* snakes nerf

* enable En-US localization for playtest

* guidebook update

* hotfix!!!
2024-11-02 17:46:19 +03:00
PJBot
7614c2fba7 Automatic changelog update 2024-11-02 13:25:14 +00:00
deltanedas
11f0dc420f clean up tools lathe recipes (#31521)
* clean up tools lathe recipes

* add medical and cooking tools

* add result

* add result to others

* review

* engine

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-11-02 14:24:08 +01:00
PJBot
131e492e6f Automatic changelog update 2024-11-02 13:22:16 +00:00
nikthechampiongr
9520e829de Allow for the ai's laws to be changed from its core and eye (#32461)
* Allow for the ai's laws to be changed from its core and eye

* Address reviews
2024-11-02 14:21:10 +01:00
PJBot
d1ab60f7bb Automatic changelog update 2024-11-02 13:20:40 +00:00
AftrLite
4f68315584 Adds a new AME sound effect! (#33097)
* Changes the AME sound effect to not be the default MetalThud.

* Was told on discord to make a minor change to autorerun the tests due to the Build & Test Debug failing!

* Attribution and licensing, as requsted by deathride58

* Fixes the high-pitched squeak audible to some people!

* Audio file tweaked by SlamBamActionMan to eliminate a weird squeak they were still able to hear. Thanks!
2024-11-02 14:19:33 +01:00
PJBot
2a6314bf90 Automatic changelog update 2024-11-02 10:08:58 +00:00
Ubaser
1c2fd6a11b Service workers antagonist fix. (#31359)
* add

* Revert "add"

This reverts commit 25da34b0fead5812fe5800c9bf5dd7b10ef48d7d.

* antagonism allowed™️
2024-11-02 05:07:51 -05:00
PJBot
fcbf515203 Automatic changelog update 2024-11-02 09:54:25 +00:00
K-Dynamic
b000a3e387 Hasten handcraft gauze recipe & decrease techfab gauze cost (#32744)
* med lathe gauze price reduction

* gauze craft doafter time

* 3 second doafter craft
2024-11-02 10:53:18 +01:00
PJBot
7276fff9c1 Automatic changelog update 2024-11-02 09:52:51 +00:00
K-Dynamic
05ae40400c Pills are explosion resistant (partially reverts #15851) (#32458)
* idk how to revert a pr so I just deleted some lines

* pill destructible with explosion resistance

* comment for explosion resist

* "and" to "but"

---------

Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
2024-11-02 20:51:44 +11:00
PJBot
51b8101dc2 Automatic changelog update 2024-11-02 09:30:23 +00:00
metalgearsloth
1c8eed8b45 Add on-call functionality for adminning (#30443)
* Add on-call functionality for adminning

The first time an ahelp gets SOS it gets relayed to the specified channel with the specified ping. Every time after that it doesn't until it gets a non-SOS response received.

* Remove redundant name

Pretty sure this already gets chucked on the name of the msg itself I think it just didn't show in screenshot because they were subsequent.

* Update Content.Server/Administration/Systems/BwoinkSystem.cs

Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>

---------

Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
Co-authored-by: deathride58 <deathride58@users.noreply.github.com>
2024-11-02 10:29:16 +01:00
PJBot
2537bff7ba Automatic changelog update 2024-11-02 01:34:34 +00:00
Vasilis
957b8de89b Add cvars to votekick to customize requirements for the initiator. (#32490) 2024-11-01 21:34:23 -04:00
Brandon Li
26194e2f41 Fix ItemSlotSystem popup Logic (#28856)
* move popup call out of `CanInsert` into `OnInteractUsing`

* im stupid and `reason` is completely unnecessary

Signed-off-by: Brandon Li <sirbrandonthenerd@gmail.com>

* return early when `itemSlots.Slots.Count == 0`

* tweak logic for triggering popups

* change popup logic again

* Consolidate whitelist check

* Get any popup message not just last failed slot

* Apply suggestions from code review

Co-authored-by: chromiumboy <50505512+chromiumboy@users.noreply.github.com>

* yoink

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>

---------

Signed-off-by: Brandon Li <sirbrandonthenerd@gmail.com>
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Co-authored-by: chromiumboy <50505512+chromiumboy@users.noreply.github.com>
2024-11-01 20:33:26 -05:00
Preston Smith
146ae8a6a6 Give Nukies a Hand Labeler (#33053)
* Add hand-labeler to nukie planet

* Rearrange nukie chem table
2024-11-02 01:44:15 +01:00
UBlueberry
3382743086 Minor antagonist guidebook changes (#32824)
* took a two month nap. accidentally pushed too many buttons. let's try this again. added thieves to antagonists.xml

* even after that nap, i don't feel well-rested at all.

* please don't kill me for using webedit

* capitalization, typo

* Apply suggestions from code review (more period moving)

Thanks Evan, very cool

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* guess you could say im not pro-proper noun

* typo

* Update Resources/ServerInfo/Guidebook/Antagonist/Nuclear Operatives.xml

* ok

Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Co-authored-by: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
2024-11-02 01:42:20 +01:00
Ed
2b9d949eea Demiplan polishing 2 (#528)
* wizden PR copy

* starter rooms

* grass geode location, new modifiers
2024-11-02 00:59:55 +03:00
Ed
3b520ac69c Demiplan modifiers (#526)
* simple modifiers

* modifier tag filtering

* Update CP14DemiplanSystem.Generation.cs

* Update rocks.yml

* move loot to modifier

* move enemies to modificators

* fix filtering

* modifier rariry

* reward and difficulty limits

* rebalance and optimize calculation

* Update test.yml

* wizden PR copy

* move all alchemy reagents to modifiers
2024-11-01 18:08:57 +03:00
Jaraten
7124eb5335 galasass (#525) 2024-11-01 14:45:53 +03:00
Nim
ac732c6180 Pig and boar (#507)
* pig and boar

* boar

* speed

* tweak
2024-11-01 10:48:50 +03:00
PJBot
844a92026f Automatic changelog update 2024-11-01 06:23:45 +00:00
Ed
f9fea9e6ed Demiplan polishing (#524)
* 10 -> 20 sharpening stone durability

* auto destroy demiplans try 2 (better)

* start demiplan protection time

* buying demiplan key

* increase island size
2024-11-01 09:23:22 +03:00
Minemoder5000
b8a98de784 Remove CargoPallet component from the cargo pallet (#33022)
* Change cargo shuttle pallets to catwalks.

* Remove CargoPallet component from the cargo pallet.

* Undo cargo shuttle changes.
2024-11-01 09:22:38 +03:00
metalgearsloth
d7a1753c7d Add CanLoad for biomes (#33050)
CPUJob to come later.
2024-10-31 23:18:06 -04:00
deltanedas
c9cd778133 add IsMemberOfAny to faction system (#32975)
* add IsMemberOfAny to faction system

* pro

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-10-31 21:34:27 -05:00
PJBot
c8259c6c0f Automatic changelog update 2024-11-01 02:33:34 +00:00
ScarKy0
e17d152838 Borgs can no longer see mindshield + AI can no longer toggle off seeing job icons (#33069)
* :(

* Removed the sprite + updated RSI
2024-10-31 21:32:28 -05:00
PJBot
b1a8eee52f Automatic changelog update 2024-11-01 02:07:53 +00:00
RumiTiger
6ce80d914d Muffins (#29318)
* Update meta.json

* Add files via upload

* Update misc.yml

* Update meal_recipes.yml

* Update meta.json

* Add files via upload

* Update plate.yml

* Update food_baked_single.yml

* Update dinnerware.yml

* Update cooking.yml

* Update misc.yml

* Add files via upload

* Delete Resources/Textures/Objects/Consumable/Food/Baked/misc.rsi/muffin-cherry.png

* Add files via upload

* Update meta.json

* Update misc.yml

* Update meal_recipes.yml

* Update meta.json

* Fix meta.json

* Fix meta.json again

* Update misc.yml

* Update misc.yml

* Update misc.yml

* Update misc.yml

* Update meta.json

* Update meta.json

* Update misc.yml

* Update meal_recipes.yml

* Update Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/misc.yml

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update dinnerware.yml

* Delete cherry

* Add files via upload

* Delete banana

* Add banana

* Delete chocolate

* Add chocolate

* lathe recipe fix

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-31 22:06:46 -04:00
PJBot
25b3898b28 Automatic changelog update 2024-11-01 02:05:15 +00:00
PopGamer46
d708a150e1 Fixes bolt lights of previously unpowered bolted doors (#33063)
fix
2024-10-31 22:04:08 -04:00
PJBot
973aeb1aaa Automatic changelog update 2024-11-01 01:54:01 +00:00
SlamBamActionman
06da4fcc60 Allow votekicks to be initiated in the lobby (#32528)
Initial commit
2024-10-31 21:52:55 -04:00
SlamBamActionman
b3190b8935 Lower in-round votekick requirements (#32953)
Initial commit
2024-10-31 21:47:59 -04:00
PJBot
59f1287aa3 Automatic changelog update 2024-11-01 01:44:18 +00:00
Khoa Nguyen
835d0b4d4a Fixed trash not being spawned when throwing pies (#33013)
* Fixed trash not being spawned when throwing pies

* Completely removed trash component flag check prior to the spawn loop
2024-10-31 21:43:11 -04:00
Moomoobeef
cf0d6c482e ExaminableDamage now puts its message at the bottom and in color (#32820)
* the examineableDamage component now puts its messages at the bottom, and in color

* god help us if something is priority -100 :godo:
2024-11-01 01:21:05 +01:00
PJBot
45aa782ec4 Automatic changelog update 2024-10-31 21:32:04 +00:00
deathride58
56d62311b1 Fixes tailthump breaking positional audio by making it mono (#33092) 2024-10-31 22:30:58 +01:00
Vasilis
2282e3c352 Revert #28358 (#33090) 2024-10-31 19:51:44 +01:00
PJBot
d2baf18759 Automatic changelog update 2024-10-31 18:47:26 +00:00
SlamBamActionman
4626904fa8 [#20285 fix] Carp Plush and Rehydratables can now be put into mop bucket (#33079)
* Make shark plush janitor-bucketable

* fix bucketed grey shark texture

* Make sprites less shiny and adapt copyright notice

* Made shark way way less shiny

* Allow carp plush and rehydratables in mop bucket.

* Remove old mop bucket shark sprites

* Fix post-merge bugs

* Fix errors

* Move ReactiveContainer stuff to shared

That should mean it is now predicted.

* Custom eject verb for the mop bucket

* Fixes OnSolutionChange, removes pop-up as there already is one.

* .ftl is not necessary as the custom pop-up was removed

* Review fixes

* Update Content.Shared/Chemistry/Components/ReactiveContainerComponent.cs

* Update Content.Shared/Chemistry/EntitySystems/ReactiveContainerSystem.cs

---------

Co-authored-by: Psychpsyo <psychpsyo@gmail.com>
Co-authored-by: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-31 19:46:19 +01:00
SpaceLizard
1c2a96590b Fixed spelling mistake in water blaster description. (#33087)
Fixed minor spelling mistake
2024-10-31 19:07:29 +01:00
Ed
5c4b5d1572 Demiplans expeditions (#523)
* simple expedition generation

* add simple test key

* expedition map component

* some funny procedural testing

* refactor expeditions from planetbiome to islanddungeons

* some work

* fix: grid dungeon, not map planet dungeon

* unhardcode map components

* finish T1 expedition generation

* Update preset.yml

* indestructable stone

* mob water occlusion

* caves T1 expedition

* Update CP14SpawnExpeditionJob.cs

* Delete shared MissionParams

* rename to demiplans

* pass mapid into job

* demiplan connections

* demiplan exits

* random entry points

* Update config.yml

* some cleanup and renaming

* radius one-time teleport

* rename connections to exitPoint

* merge entry and exit point into rift component

* demipan closing - all rifts deletion

* demiplanEEEEEE

* fixes

* delete floating visuals

* Update CP14DemiplaneTravelingSystem.cs

* intro and outro demiplan music

* rift cores and flashing

* pulling support

* pulling fix + generatordata fix?

* auto destrot demiplans??
2024-10-31 19:13:44 +03:00
Vasilis
d446a3e8e9 Potencially fix approved labeler (#33083) 2024-10-31 16:05:42 +01:00
PJBot
bca8d95191 Automatic changelog update 2024-10-31 14:54:44 +00:00
BramvanZijp
a08da9d31f More pda space (#32601)
* Rebalance the max programs that a PDA can hold

* Give Caps PDA more programs too.

* Make the max programs a static 8

* I forgor sec and med

* CaseCase

* Empty commit to re-run checks

* The final change, I hope.
2024-10-31 15:53:38 +01:00
PJBot
872adb5c93 Automatic changelog update 2024-10-31 14:13:33 +00:00
SlamBamActionman
55861b4fcf [#28722 fix] Add notification for dependent wearables being dropped (#33078)
* add notification for dependent wearables being dropped

* fix dropped item popup redundancy
- did a check to see if any item was dropped, instead of making a notification for each item being dropped.

* change popup to client-only variant

* fix redundant messages, add plural locale string

* fix conventions, fix locale input to be more intuitive

---------

Co-authored-by: Justin <justinbrick1@gmail.com>
2024-10-31 15:12:26 +01:00
PJBot
a875bf3c64 Automatic changelog update 2024-10-31 13:27:53 +00:00
Jarmer123
4261698371 Add a spare bible to PietyVend (#32363)
Update chapel.yml
2024-10-31 14:26:45 +01:00
AJCM-git
f5e5646400 New workflow to apply the pr approved label (#28358)
* New workflow to apply the pr approved label

* Maybe fix permissions
2024-10-31 12:22:13 +01:00
PJBot
826bd1ab45 Automatic changelog update 2024-10-31 10:57:15 +00:00
Boaz1111
a3dc0eb75a Pill Bottles can only store pills now (#33074)
* no longer absurd

* Update Resources/Prototypes/Entities/Objects/Specific/chemistry.yml

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-31 11:56:07 +01:00
PJBot
fdd713a0f0 Automatic changelog update 2024-10-30 09:16:36 +00:00
Alzore
4b467685b2 Nukie med bundle now costs 24 tc and contains a unique defibrillator (#32720)
* a-few-injectors

* comment

* defib-ops-when
2024-10-30 10:15:30 +01:00
PJBot
827d00eb18 Automatic changelog update 2024-10-30 07:42:56 +00:00
Alzore
6834bc1fbd Add 3 bottle boxes to nanomed plus (#33018)
three bottle boxes in nanomed plus
2024-10-30 01:41:51 -06:00
PJBot
0f1e11c356 Automatic changelog update 2024-10-30 07:41:40 +00:00
Alzore
010638d0e9 Make the security belt contain more useful items by default (#32291)
* replace tear gas and flashbang with holobarrier and sec radio

* holobarrier-belt-fix
2024-10-30 01:40:33 -06:00
PJBot
d4db338ec6 Automatic changelog update 2024-10-30 07:39:27 +00:00
Alzore
0aa46f6a2a Give proto-kinetic crushers, glaives, and daggers better inhands. Update the crusher and glaive icons. (#32212)
* inhands

* better inhands

* indent
2024-10-30 01:38:19 -06:00
Flareguy
3d70cdf23c Various Vaugely Connected Sprite Updates™: Encryption Keys, Station Map, Brig Timer (#32786)
* various resprites (encryption keys + signal screens + station map)

* brig timer update

* fixes n shit
2024-10-30 14:12:49 +11:00
Milon
440da3c640 fix chameleon projector bot whitelist (#33055)
fix
2024-10-30 02:03:06 +01:00
Preston Smith
907a9cef10 Fix: Make Plushie Damage Unexaminable (#33061)
Set hidden to true
2024-10-30 01:52:43 +01:00
Ed
16e23098db Merge pull request #520 from crystallpunk-14/ed-29-10-2024-upstream
Stable upstream sync
2024-10-29 15:15:14 +03:00
Ed
4e2af32ebe Merge pull request #522 from crystallpunk-14/ed-29-10-2024-guides-and-skills
Ed 29 10 2024 guides and skills
2024-10-29 14:55:50 +03:00
Ed
60f8c2c56f remove cvar! 2024-10-29 14:41:41 +03:00
Ed
df53f9a01f remove ship target point 2024-10-29 14:18:27 +03:00
Ed
2f57f11771 Cargo namespace 2024-10-29 12:18:35 +03:00
Ed
e6bbc3900f Delete CP14ExpeditionSystem 2024-10-29 12:15:16 +03:00
Ed
f5503352b9 add GuideHelp to alchemy equipment 2024-10-29 12:06:23 +03:00
Ed
817c53d98f Merge branch 'master' into ed-29-10-2024-upstream 2024-10-29 11:51:03 +03:00
Ed
cc80518d2f World minor changes (#519)
* x2 weather time

* remove alchemy test and battle royale maps, add simple island map

* island map + ocean parallax

* map floor occluder sys

* undercliff test

* update sand and ocean sprite

* Revert "undercliff test"

This reverts commit c484fe630a.

* more experiments

* Revert "more experiments"

This reverts commit a7f30fd608.

* Update default.yml

* Update debug.yml
2024-10-29 11:48:52 +03:00
Ed
ae3cbd6092 Merge remote-tracking branch 'upstream/stable' into ed-29-10-2024-upstream
# Conflicts:
#	Content.Server/Chat/Managers/ChatSanitizationManager.cs
#	Content.Server/Temperature/Systems/TemperatureSystem.cs
#	Content.Shared/Localizations/ContentLocalizationManager.cs
2024-10-29 11:16:56 +03:00
PJBot
a8c512c769 Automatic changelog update 2024-10-29 05:09:03 +00:00
metalgearsloth
94e686ca9c Fix separated game screen bumping (#33046)
I don't really understand why RecordedSplitContainer exists but removing it looks identical and fixes the panel bumping occasionally.
2024-10-29 16:07:57 +11:00
PJBot
a5a5840ee0 Automatic changelog update 2024-10-29 05:01:37 +00:00
deltanedas
63f8aba359 fix lava expeds (#33042)
Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-10-29 00:00:28 -05:00
Moomoobeef
6236d1abb3 Updated an incorrect sprite in the smite menu (#33043)
changed the synth sprite used in the icon for the instrumentify smite out for the more accurate supersynth sprite
2024-10-28 23:35:48 +01:00
lzk
dc3a2f6d28 add StartDelay bool to actions (#33026)
* add StartDelay bool to actions

* forgot summary
2024-10-28 23:21:14 +01:00
joshepvodka
7ac2d9a8bd Adds beacon to core station's vox box (#33004)
* added vox beacon

* changed name to vox break room

* added vox box station beacon

* fixes messed up diff
2024-10-28 16:05:01 -06:00
joshepvodka
dbef6cbecc Adds beacon to oasis station's vox box (#33003)
* added vox beacon

* changed name to vox break room

* added vox box station beacon
2024-10-28 16:04:49 -06:00
joshepvodka
e900ad7742 Adds beacon to bagel station's vox box (#33002)
* added vox beacon

* changed name to vox break room

* added voxbox station beacon
2024-10-28 16:04:37 -06:00
joshepvodka
93315d4695 Adds beacon to box station's vox box (#33001)
* added vox beacon

* changed name to vox break room

* added vox box station beacon
2024-10-28 16:04:10 -06:00
joshepvodka
30017bc2d8 Adds beacon to cog station vox box (#33000)
* added vox beacon

* changed name to vox break room

* added vox box station beacon
2024-10-28 16:03:13 -06:00
PJBot
1ef5b2226a Automatic changelog update 2024-10-28 21:26:41 +00:00
August Sun
67332502c1 Extends the minimum round time for meteor swarm events (#32876)
* adjusted minimum timers in meteorswarms.yml

* Updated timer minimum from 20 to 15 minutes

* Reduced minimum timer to 10 minutes as a result of other meteor changes

---------

Co-authored-by: august-sun <45527070+august.sun@users.noreply.github.com>
2024-10-28 22:25:33 +01:00
PJBot
f86798792b Automatic changelog update 2024-10-28 18:01:10 +00:00
Stalen
0468c0f6bb Fix playtime formatting (#32974) 2024-10-28 19:00:37 +01:00
Stalen
24f79c3ecc Fix playtime formatting (#32974) 2024-10-28 19:00:00 +01:00
BramvanZijp
a4717556e1 Fix loneop spawnrate by reverting it to not use the shuttle event system. (#32942)
Fix loneop spawnrate by reverting it to not use the custom shuttle event system.
2024-10-28 18:52:21 +01:00
Theodore Lukin
ee445c4938 make ai speak robotically (#33025) 2024-10-28 18:36:35 +01:00
FluffMe
08d0077719 Fix TestSuicideByHeldItem and TestSuicideByHeldItemSpreadDamage (#33030) 2024-10-28 11:52:49 +01:00
Ed
b14c75390c biological weapon (#518) 2024-10-28 13:05:01 +03:00
Vasilis
7e526da521 Fix Bug With Uppercase Radio Keys (#32997) (master) (#33031)
Co-authored-by: Thomas <87614336+Aeshus@users.noreply.github.com>
2024-10-28 00:35:23 +01:00
Thomas
4fbe50ab28 Fix Bug With Uppercase Radio Keys (#32997) 2024-10-27 11:41:29 -07:00
Ed
3e43d0695f Some tile update + dayflin resprite (#517)
* foundtion update

* dirt from grass and seedbed craft rebalance

* crowbar, tile prying

* fix high fence

* yellow dayflin sprite update

* fix currency calculation bug

* Update sewing_table.yml
2024-10-27 21:37:15 +03:00
Ed
2850665e33 Tavern map update (#516)
* recursive currency calculation

* map update

* fix
2024-10-27 17:09:06 +03:00
Nim
c2404d6c0c Zombies climbing in and other things (#515)
* hehe

* tweak
2024-10-27 14:42:11 +03:00
PJBot
a1c36dcb79 Automatic changelog update 2024-10-27 04:27:02 +00:00
slarticodefast
4252fdffb9 fix pie throwing sound not playing (#33017) 2024-10-27 15:25:54 +11:00
github-actions[bot]
6486cdf183 Update Credits (#33016)
Co-authored-by: PJBot <pieterjan.briers+bot@gmail.com>
2024-10-27 15:24:45 +11:00
Ed
546e1d8fa1 Tomatoes + farming trading (#513)
* farm trading

* ruond prices

* add tomatoes sprites

* TOMATOES

* Update tomatoes.yml
2024-10-27 01:26:22 +03:00
Moomoobeef
9d6e6257bd Removed the name "Hujsak" (#32998)
removed hujsak
2024-10-26 12:29:40 -05:00
PJBot
427817e237 Automatic changelog update 2024-10-26 17:23:15 +00:00
Saphire Lattice
a95c8baf28 Add health analyzer unrevivability warning (#32636)
* Add health analyzer unrevivability warning

* Remove errornous comment
2024-10-26 19:22:08 +02:00
Ed
08a4c4340d Bank implementation (#512)
* get currency refactor

* bank work

* finish vault markers

* add bank doors

* map update

* loadouts

* Update CP14StationTravelingStoreShipTargetComponent.cs

* oopsie
2024-10-26 18:18:30 +03:00
PJBot
dcb615d678 Automatic changelog update 2024-10-26 04:01:56 +00:00
Moomoobeef
97ef4637fd bowls now make drinking sounds (#32819) 2024-10-25 23:00:49 -05:00
Ilya246
5a10bf0954 add atmosia to devmap (#32460)
change
2024-10-25 22:04:27 -05:00
PJBot
988b62074f Automatic changelog update 2024-10-26 02:17:52 +00:00
BramvanZijp
66432c5cd8 Fix loneop spawnrate by reverting it to not use the shuttle event system. (#32942)
Fix loneop spawnrate by reverting it to not use the custom shuttle event system.
2024-10-26 13:16:45 +11:00
PJBot
6998fa83a4 Automatic changelog update 2024-10-25 22:48:20 +00:00
slarticodefast
e3f442e790 Add flash reaction effect (#32377)
add flash reaction effect
2024-10-26 00:47:11 +02:00
Vasilis The Pikachu
9b0ae98836 Merge branch 'staging' of ssh://github.com/space-wizards/space-station-14 into staging 2024-10-25 21:11:20 +02:00
Jezithyr
ae1c5572fc Applying Fix from #32764 to staging 2024-10-25 21:09:56 +02:00
Vasilis The Pikachu
c28665c7d3 Merge branch 'staging' of ssh://github.com/space-wizards/space-station-14 into staging 2024-10-25 20:33:08 +02:00
chromiumboy
1307733c4b Make atmos alert computer colors private variables (#32992) 2024-10-24 23:34:52 -07:00
chromiumboy
5ff5a72a7c Fix multiplying colors of differing nullabilities (#32991) 2024-10-24 21:06:38 -07:00
Ed
c31f1ad130 Banker and commandant outfit + fix purchase bugs (#509)
* reaname QM to commandant, and merchant to banker

* Update game_presets.yml

* add bureaucracy crate

* fix buying

* bowler hats

* reorganize shirt folders

* cloak refactor, add commandant cloak

* Update battle_royale_temp.yml

* Update migration.yml
2024-10-25 00:23:35 +03:00
Ed
0f6dd2905d Bandit antag (#508)
* remove default antags

* simple bandit antag

* greetings audio and gear

* fixes

* Update AntagPreferenceTest.cs

* gamemodes

* Update game_presets.yml
2024-10-24 18:19:14 +03:00
Ed
f2b8713dc2 Clouds overlay fix + Syringe + Localization visuals (#506)
* fix cloud

* add syringes to alchemist

* remove barrel crafting

* Revert "remove barrel crafting"

This reverts commit d3c5a26136.

* add localization visuals
2024-10-24 14:11:15 +03:00
Ed
4e3c70a9d1 Iron doors (#505)
* iron doors

* shirt desc partial fix

* fix
2024-10-24 12:38:12 +03:00
Thomas
d4da9923ea Fix Emote Chat Sanitizer (#32940)
* Fix bug?

* Fix :)

* aaaa

* AAAA!!!

* comment

* Nicer code

* What's a pull requestWhat's a pull request?
2024-10-24 16:10:13 +11:00
PJBot
79c35e0a41 Automatic changelog update 2024-10-24 03:42:11 +00:00
hyphenationc
5a86b88f8f adds Meat Tag to FoodMeatSnake (#32965) 2024-10-23 22:41:03 -05:00
Spanky
92c49afcf2 Packed Update (#32971)
Packed map update, significantly changes arrivals, perma, AI core, and misc other QOL.
2024-10-23 16:19:35 -06:00
Ed
0652c3f0b4 Prazat jewelry stones (#504)
* marble floor

* fix

* bank wallpaper, marble floor resprite

* marble window

* rename whitebrick wall to marble wall, delete iron walls

* job desc fix

* jewelry

* Update jewelry.yml
2024-10-23 21:25:58 +03:00
Nim
1d43bad57f Dinosaur - Yumkaraptor (#492)
* dino

* sprite

* fix

* ForkFiltered

* Yumkaraptor

* Update meta.json

* Update meta.json

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
2024-10-23 21:25:49 +03:00
FN
1ebe48978e Fix (#503) 2024-10-23 19:44:07 +03:00
PJBot
05a00515ed Automatic changelog update 2024-10-23 12:51:06 +00:00
chromiumboy
d2216835d8 Visualized regions for NavMapControl (#31910)
* Atmospheric alerts computer

* Moved components, restricted access to them

* Minor tweaks

* The screen will now turn off when the computer is not powered

* Bug fix

* Adjusted label

* Updated to latest master version

* Initial commit

* Tidy up

* Add firelocks to the nav map

* Add nav map regions to atmos alerts computer

* Added support for multiple region overlay sets per grid

* Fixed issue where console values were not updating correctly

* Fixing merge conflict

* Fixing merge conflicts

* Finished all major features

* Removed station map regions (to be re-added in a separate PR)

* Improved clarity

* Adjusted the color saturation of the regions displayed on the atmos alerts computer
2024-10-23 14:49:58 +02:00
PJBot
3b0d8e63a1 Automatic changelog update 2024-10-22 23:52:55 +00:00
UBlueberry
c1d5e6fc4d In-hand apprasial tool sprite (#32849)
* golden apprasial tool when

* thanks evan. very cool
2024-10-23 10:51:49 +11:00
PJBot
445cad4955 Automatic changelog update 2024-10-22 23:37:58 +00:00
BramvanZijp
ee8dedea9c Several Ninja Suit power cell upgrade fixes. (#32902)
* Fix several jank issues with space ninja cell upgrades.

* Rework the code to comply with maintainer request.

* Fix some naming convention & formatting errors.

* Change from a custom check to an item whitelist to avoid power cages from fitting.

* Make the EntityUid of GetCellScore non nullable.

* Remove a line from a previous solution to the above problem I forgot to remove.

* Fix the magic number issue.
2024-10-23 10:36:51 +11:00
nikthechampiongr
2b02545f97 Hotfix server config changes for playercap and Levi bunker (#32925)
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-23 00:34:11 +02:00
PJBot
8f52a3448e Automatic changelog update 2024-10-22 17:02:25 +00:00
Southbridge
5d6ec18b2a Add Nuclear Cola centrifuge recipe (#32441)
* Initial implementation

* currently it crashes on load, don't know why, maybe changing the products will provide some insight

* I was overlooking part of the yaml formatting.
2024-10-22 19:01:18 +02:00
PJBot
5e637aa7bf Automatic changelog update 2024-10-22 13:50:46 +00:00
ScarKy0
9873efd514 Adding intellicard functionality. (#32347)
* init

* im so confused

* clean

* sprite update

* :|

* further attempts

* be blessed for it works

* Very prestigious pAI

* cleaning up

* Intellicard in RD locker

* PAIn't

* .Clear()n't

* .Clear()n't for real this time

* Cleaning up

* Whoopsie Daisy
2024-10-22 15:49:39 +02:00
PJBot
fc2bb79ef3 Automatic changelog update 2024-10-22 13:04:49 +00:00
ScarKy0
62f5a31c4a Syringe gun! (#32112)
* Init testing

* copyright

* oops

* Tracking the embed entity uid

* testing stuff for gradual injection

* work

* weh

* god save me

* bleh

* Yippee!

* Again

* Mini syringe ammo

* cleaning up

* mini syringes have a texture for fill amount

* -3 cool points :(

* hitboxes

* init cleanup

* much needed fixes

* Fixes
2024-10-23 00:03:42 +11:00
PJBot
94bbf7262c Automatic changelog update 2024-10-22 09:01:37 +00:00
Moomoobeef
5f1b848c08 Ammo boxes now have sprites for being parially filled! (#32930)
Initial Commit

Created new sprites for all the partial fills and modified the ammo-case ymls to accomodate the new stages
2024-10-22 11:00:28 +02:00
Spessmann
8142ac007f Cog sec maints updated (#32948)
updated sec maints
2024-10-22 00:30:31 -06:00
PJBot
7d91bcba3e Automatic changelog update 2024-10-22 05:40:44 +00:00
Southbridge
a227c3bb42 Box Station - Resolved #32771, #32949, and #32921 (#32950)
* Resolved #32771, #32949,  and #32921

* Resolved build issue
2024-10-21 23:39:34 -06:00
Ed
dacac22663 Marble (#502)
* marble floor

* fix

* bank wallpaper, marble floor resprite

* marble window

* rename whitebrick wall to marble wall, delete iron walls
2024-10-21 23:35:06 +03:00
PJBot
afd4c73bec Automatic changelog update 2024-10-21 12:45:49 +00:00
No Elka
8a5d9a3321 Let station AI use long range fax machines (#32929)
* Change stuff

* Gotcha boss
2024-10-21 14:44:43 +02:00
Ed
41d3ccab8b Locks update (#501)
* massive code refactor

* fix

* ftl fix

* rider pet pet

* hacking doAfter

* Update SharedCP14LockKeySystem.cs

* optimization

* Update migration.yml

* Update migration.yml
2024-10-21 14:20:05 +03:00
PJBot
04e422bd3f Automatic changelog update 2024-10-21 03:51:13 +00:00
MendaxxDev
b5687e4c73 prevent typing sound from playing when AI interacts with consoles (#32906)
* prevent typing sound from playing when AI interacts with consoles

* cleanup
2024-10-20 22:50:05 -05:00
PJBot
1d2ad3c335 Automatic changelog update 2024-10-21 03:44:23 +00:00
Stomf
0b8d6a1bd5 Mutetoxin buff (#32915)
* Fixes smile's ghost role to not need a raffle, very nice

* a simplier solution

* Mute toxin buffed to be more like glue

* buffed the toxin even more

* Update Resources/Prototypes/Entities/Mobs/NPCs/pets.yml

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-20 22:43:14 -05:00
Ed
8c06677ff4 Ru localization update (#500)
* Update entities.ftl

* fix

* Update entities.ftl
2024-10-20 23:27:33 +03:00
Ed
85463d380f Bank preparation (#499)
* TownSend condition

* personal objectives update

* add common objectives

* add common objectives

* tweaks

* quartermaster and merchant

* job spawner icons

* add merchants to tavern map
2024-10-20 21:20:16 +03:00
Pieter-Jan Briers
c221ef06b9 System to automatically restart server after certain uptime. (#32814) 2024-10-20 16:46:22 +02:00
nikthechampiongr
eec533cb77 Reduce player softcap for wizden servers and panic bunker wizden Levi (#32908)
* Reduce player softcap for wizden servers and panic bunker wizden Leviathan

* Fix bunker message

* Make sure it actually activates by default and make it turn off when an admin joins

* Update Resources/ConfigPresets/WizardsDen/wizardsDen.toml

The voices

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-20 12:13:51 +02:00
Spessmann
4c3fd3130d Cog small update (#32922)
based sigma
2024-10-19 22:17:10 -06:00
Jajsha
8cf5f93b9f Fix starting gear multiple storage fills and tests (#32718)
* fix things

* maybe fix everything
2024-10-20 14:43:17 +11:00
PJBot
628f51bb3d Automatic changelog update 2024-10-20 03:42:50 +00:00
Calecute
b7bd7c1d68 Blunt damage will do stamina damage on wide attacks (#32422)
Fix: blunt damage will now do stamina damage on wide attacks.
2024-10-20 14:41:44 +11:00
PJBot
088ec569fe Automatic changelog update 2024-10-20 02:47:38 +00:00
beck-thompson
69849bfb30 MMIs and positronic brains now talk like pAIs in plushies (#32914)
* commit

* spacing fix
2024-10-19 21:46:31 -05:00
github-actions[bot]
a62ddf2f99 Update Credits (#32916)
Co-authored-by: PJBot <pieterjan.briers+bot@gmail.com>
2024-10-20 02:38:14 +02:00
Pieter-Jan Briers
928877f0ef HOTFIX (stable) submodule update (#32900)
Update submodule

This fixes an important memory leak.
2024-10-19 18:05:48 +02:00
PJBot
a4750b3a9e Automatic changelog update 2024-10-19 15:32:52 +00:00
Łukasz Lindert
0a105213b4 Fix for low zombie blood (#32532)
fix for low zombie blood

Co-authored-by: Łuaksz <test@test.com>
2024-10-19 17:31:45 +02:00
PJBot
77a2907535 Automatic changelog update 2024-10-19 14:52:37 +00:00
Pieter-Jan Briers
73a82d5615 HOTFIX submodule update (#32897)
Update submodule

This fixes an important memory leak.
2024-10-19 16:51:29 +02:00
MendaxxDev
109e0bcf96 exponential backoff for admin logs db update (#32865)
* exponential backoff for admin logs db update

* Update Content.Server/Database/ServerDbBase.cs

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2024-10-19 12:28:49 +02:00
PJBot
7e0e6416a7 Automatic changelog update 2024-10-19 02:41:23 +00:00
beck-thompson
c4233cc0a4 Scalpels now cut like knives (#32858)
* im so tired

* silly me

* yeah

* Update Resources/Prototypes/Entities/Objects/Specific/Medical/surgery.yml

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-18 21:40:17 -05:00
Ed
78e94b1623 Airship + Unittest (#496)
* wings

* update cargo shuttle

* update goblin sound

* add new unit test

* Update CP14EntityTest.cs

* Update CP14RitualTest.cs

* add buy and sell hints

* paper reading

* hardwork

* clean task

* body forkfiltered

* Update crystal.yml

* more fork flitered

* Update basic.yml

* Update wild.yml

* Update CP14EntityTest.cs

* realise pusharing

* pusharing alchemical vials

* coin disappear works

* Fix
2024-10-19 01:09:15 +03:00
PJBot
bf14b3cdaa Automatic changelog update 2024-10-18 19:21:12 +00:00
Pieter-Jan Briers
22938a9a56 Allow strip removing items if you're holding something (#32750)
You were already able to strip more items at once from somebody than you could hold, and they would drop to the floor. This matched the behavior in SS13.

Annoyingly, however, you were not allowed to *start* a stripping action if you're holding something. This just feels like an annoying paper cut, so this is no longer a thing.
2024-10-18 21:20:04 +02:00
IProduceWidgets
091e4c1cb0 Add Towels (#32235)
* Towels

* make smoler

* Huh, wonder why that didnt fail locally. The curse of CaPiTaLiZaTiOn

* Teal swapped for LightBlue for medical.

* Appease the linter?

* magic?

* mimery

* lefthandedness
2024-10-18 17:24:43 +02:00
Errant
b137b0caa2 HOTFIX Plushies no longer delete items when recycled (#32882)
Fix: Plushies no longer delete items when recycled (#32838)

fix

Co-authored-by: beck-thompson <107373427+beck-thompson@users.noreply.github.com>
2024-10-18 16:59:50 +02:00
PJBot
758c9e464e Automatic changelog update 2024-10-18 13:43:20 +00:00
Ilya246
fca95ef250 ghost locator maints loot (#32323)
* implement

* react to revenants/AI eye

* rare maints loot

* sprite

* description

* review

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* do changes

* stats

* networked

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-18 15:42:13 +02:00
Errant
cf1b3b0913 Merge spider clan charges can be armed again (#32866) to Master (#32881)
HOTFIX spider clan charges can be armed again (#32866)

* fix ninja bomb component check

* remove TryGetRole
2024-10-18 15:38:16 +02:00
Errant
e04e3a6250 HOTFIX spider clan charges can be armed again (#32866)
* fix ninja bomb component check

* remove TryGetRole
2024-10-18 15:17:18 +02:00
PJBot
304d1d5934 Automatic changelog update 2024-10-18 12:59:14 +00:00
beck-thompson
15290486dc Fix: Plushies no longer delete items when recycled (#32838)
fix
2024-10-18 14:58:07 +02:00
PJBot
7fc27a18f6 Automatic changelog update 2024-10-18 12:56:51 +00:00
Errant
23e4f81b30 Traitor activation fix for missing PDA (#30359)
* Implant the uplink if no PDA is found

* comments

* tidy up loose ends

* Whoops usually I start with the namespace, how did I forget it, shame shame

* Consistent data type for starting TC balance, misc changes

* Implant briefing, guidebook

* Update AutoTraitor, add uplink, codeword and briefing parameters to TraitorRuleComponent,  no pda for reinforcements

* engine 5c0ce43

* pass pda to AddUplink

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* nicer string handling

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* case typo 1

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* case typo 2

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* case typo 3

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* minor layout changes

* removed redundant implant check

* minor cleanup

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-18 14:55:43 +02:00
Ed
f14177bf86 Alchemist update (#497)
* rebalance alchemy resource

* lockers alternative

* map update
2024-10-18 14:56:01 +03:00
beck-thompson
338781c243 Fix: Radio jammer now doesn't show setting changes to other players (#32817)
* fix

* Other fix
2024-10-18 12:04:45 +02:00
PJBot
3da9e93b3d Automatic changelog update 2024-10-18 10:04:18 +00:00
JIPDawg
c606f7144c Set Salamander round restart time to 5 minutes (#32776)
Set round restart time to 5 minutes

Edited the .toml to allow people 5 minutes on centcom for extended RP.
2024-10-18 12:03:12 +02:00
PJBot
103c1dc221 Automatic changelog update 2024-10-18 09:44:12 +00:00
Theodore Lukin
c78b5ae83d Fix warden being and qm being not considered head for tot kill head objective (#32721)
* fixed warden being and qm being not considered head for traitor kill head objective

* fixed hypothetical warden traitor not getting disk objective

* change suggested by deltanedas

* cleanup

* cleanup

* fix

* changed as suggested

* removed a dot in the comment

* removed an empty line

* reformulation
2024-10-18 11:43:05 +02:00
Leon Friedrich
adb7aee831 Fix PlantHolder interactions & InteractionSystem assert (#32874) 2024-10-18 16:40:36 +11:00
PJBot
ab86745c4e Automatic changelog update 2024-10-18 03:29:36 +00:00
Plykiya
ea19a159f8 Remove flares and shotgun flares from lathe options (#32563)
Remove flares and shotgun flares from lathe recipes
2024-10-17 22:28:30 -05:00
PJBot
0bdc57dce8 Automatic changelog update 2024-10-18 03:09:39 +00:00
Catofquestionableethics
22749db3fe Added relevant tags to several cakes, and changed chem in Spacemans cake (#32830) 2024-10-17 22:08:32 -05:00
PJBot
aac3d73456 Automatic changelog update 2024-10-18 02:43:56 +00:00
Stomf
73b2b36243 Fixes smile's ghost role to not need a raffle, very nice (#32837)
* Fixes smile's ghost role to not need a raffle, very nice

* a simplier solution
2024-10-17 21:42:49 -05:00
Spessmann
81c654ddce Cog update (engi buff) (#32875)
krill issue
2024-10-17 19:46:06 -06:00
PJBot
ac120f7ce9 Automatic changelog update 2024-10-17 21:34:06 +00:00
slarticodefast
1518dc94a3 fix playtime stats window (#32856) 2024-10-17 23:32:59 +02:00
Scribbles0
48f8aac732 Fland AI core LV change (#32770)
small ai core lv change
2024-10-17 12:18:43 -06:00
PJBot
3b3a7a6a73 Automatic changelog update 2024-10-17 14:02:41 +00:00
Thomas
876c44cd66 Sanitize shorthand emotes throughought the whole message (#28645)
* Rename ChatSanitizationManager to ChatEmoteSanitizationManager

The prior name was kind of confusing as there's a emote one and
then now there's also chat expansion happening in the accent system,
so knowing which I actually need to edit is useful.

So, I just need to keep myself not confused.

* Rename smileyToEmote and remove punctuation duplicates

The name SmileyToEmote is just... Bad.

Plus, I needed to remove the punctuation duplicates as that would
break any kind of regex parsing that I tried.

* Switch to regex from checking end of string

I also changed from System.Globalization to ILocalizationManager.

Writing that regex was definitely an experience.

* Document regex and the manager

* Rename it back

* Simplify regex
2024-10-17 16:01:32 +02:00
PJBot
ea96e8a1cf Automatic changelog update 2024-10-17 11:07:15 +00:00
Vasilis
a739b21b04 Change the window titlebar to show the joined server (#32547)
* Change the window titlebar to show the joined server

Requires https://github.com/space-wizards/RobustToolbox/pull/5475/

* Totally not a webedit

* Can you tell what cvar I copied?

* And this kids is why we don't webedit

* Reviews

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-10-17 13:06:07 +02:00
Ed
9a8d30022a Wallpaper update + paper folder (#495)
* paper folders

* Update CP14WorkbenchSystem.cs

* wallpaper update

* Update walls.yml

* remove cable sprites

* Update migration.yml
2024-10-17 13:08:36 +03:00
scrivoy
b3c61530bf Enhance Vending Machine UI: Adjust Minimum Height for better User Experience (#32851)
set FancyWindow MinHeight to 210
2024-10-16 23:34:31 -05:00
PJBot
ddec2fff70 Automatic changelog update 2024-10-17 04:01:58 +00:00
Callmore
7039f87bd4 Fix saving prefered quick store item locations (#32480)
this was just copypasted without any context wasn't it
2024-10-16 23:00:52 -05:00
PJBot
9889f8db9d Automatic changelog update 2024-10-17 03:42:13 +00:00
Zachary Higgs
79a23d3e0b Give AI a Sound Cue when an Antimov board is inserted (#32625)
* Subversion Board Insertion Audio Notification

Add Subversion flag and SubversionSound to SiliconLawProviderComponent

Add new Method (OnSubversionInserted)
to SiliconLawSystem to handle a Subversive
SiliconLawProviderComponent and play it's SubversionSound

Add Check for Subversive law provider to OnUpdaterInsert that
calls OnSubversionInserted if the SiliconLawProviderComponent is
Subversive

* Fix subversion Sound

- Change out Weh sound used to test that subversion sounds can be
changed by prototype for a a not yet present Antimov subversion sound

* Make it not just subversive

- Remove OnSubversionInserted and move the MindPlaySound in the
OnUpdaterInsert so long as LawUploadSound exists

- Modify SubversionSound into LawUploadSound

- Remove the Subversion flag

- Just use emagged_borg.ogg until the better one is made

* Remove errant spaces and a errant namespace

* CR Fixes - Add generic Lawboard insert cue

- Combine the If statements per /pull/32625#discussion_r1786926400
inside OnUpdaterInsert

- Remove the ViewVariables(VVAccess.ReadWrite) per
pull/32625#discussion_r1786924433

- Add Cryo_warning.ogg from TGStation, the sound utilized for Law Upload
cue, Attribution.

* CR Add a placeholder Antimov notification sound

- Add a new sound kitbashed from the cryo_sound used for uploading
and the emagged noise

* Add self referential source attribution

- also fix an errant space

* Add more bespoke Sound by ps3moira + attributions
2024-10-16 22:41:06 -05:00
PJBot
fae5c89ef7 Automatic changelog update 2024-10-17 03:22:10 +00:00
lzk
e891838d4b Fix holosignsystem popup (#32808) 2024-10-16 22:21:04 -05:00
PJBot
dccd00999c Automatic changelog update 2024-10-17 03:13:36 +00:00
deltanedas
18c8a803ff enable ejecting in biogenerator UI (#32854)
* enable ejecting in biogenerator UI

* allow inserting too

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-10-16 22:12:30 -05:00
PJBot
8b74244ae9 Automatic changelog update 2024-10-17 01:58:49 +00:00
SlamBamActionman
1c49c638d8 Added new Microphone instrument style "Kweh" (#32848)
* Initial commit

* Attribution
2024-10-17 12:57:42 +11:00
scrivoy
0bee22e7e2 Fix Reagent Description for Bananium (#32810)
* changed bananium desc

* removed bananium name and desc ftl string
2024-10-16 20:45:36 -05:00
LittleNyanCat
c027919618 Several small SFX tweaks (#28897)
* Several small sfx tweaks

* fix small yml oopsie

* Redo the basin code to use events

* now uses an event for when the transfer is successful, not when there's just an attempt

* forgot to remove this

* Update Content.Server/Botany/Components/PlantHolderComponent.cs

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>

* Update Content.Server/Botany/Systems/PlantHolderSystem.cs

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>

* adds sound variations to shoes as well

* variations on honkbots and the H.O.N.K mech

* Update Content.Server/Botany/Systems/PlantHolderSystem.cs

* Update Content.Server/Botany/Systems/PlantHolderSystem.cs

* fix compile issue

* oops forgot to delete this

* cleanup

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-16 20:38:02 -05:00
PJBot
dec9ff69ec Automatic changelog update 2024-10-16 22:33:38 +00:00
IProduceWidgets
05ac74dfcd FTL coordinate disk command for admins: ftldisk (#28075)
* Add robo control comp, also de-reinforce a lot of walls.

* Revert "Add robo control comp, also de-reinforce a lot of walls."

This reverts commit b6be6b616aa9732b81e02bed76e3c9ae103cf7cb.

* FTLdiskburner command to make FTL disks.

* Elegant failure on mistyped ID.

* even more more eleganter failures.

* foo

* bar

* I have reached completion

* prevent id confusion

* I'm givin' her all she's got captain!

* a bit more hug boxing for safe destinations.

* comments for foo

* extra thoughts.

* cleanup

* continuen't

* Improve feedback strings

* reviewer QOL

* Reviewer QOL 2

* handle easy reviews

* Add comments to clarify reviews

* howdoicode to the rescue.

* ftldisk in hand

* ftl.ftl

* funny disk case

* loc

* unusing
2024-10-17 00:33:08 +02:00
deltanedas
cc17acbda8 fix grappling hooks getting bricked (#32738)
Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-10-17 09:32:32 +11:00
PJBot
8aac87a2fe Automatic changelog update 2024-10-16 22:25:38 +00:00
IProduceWidgets
8cafd7261d Fix omega cursed smite code. (#32844)
* le fixo smotes

* CURSE OF BLINDNESS

* Guh
2024-10-17 09:24:31 +11:00
lzk
f387f66387 Fix uplink name (#32846) 2024-10-17 09:23:25 +11:00
Ed
ebca84d28f Minor fixes (#494)
* minor loadout tweaks

* wooden counter

* fix parry predicting

* tables crafting simplify
2024-10-16 17:32:41 +03:00
PJBot
2a22964e51 Automatic changelog update 2024-10-16 10:06:03 +00:00
Minemoder5000
17319c7fc0 New reptile sounds (#32064)
* Adds emotes to the Reptilian species: Tailthump, Hiss
Todo: Huff

* Adds emotes to the Reptilian species: Tailthump, Hiss
Todo: Huff

* Added ReptilianBodyEmotes to speech_emote_sounds.yml, yada yada yada

* added sound and changed volume

* fix thingies

* fixed bug with reptilians not being able to do default emotes

* lowered the volume of the hiss and huff

* reformat the yml

* Add sigh keywords to the huff

* Undo changes to BuildChecker.csproj

* Add icons to the emotes

* Remove sigh triggers from the huff emote since it breaks normal sighing.

* Remove the Huff and Hiss since i cant find good audio for it

* i forgor

* Changed attribution

* Credit Sarahon for the tailslap

---------

Co-authored-by: nicho <nicholasnewsom577@gmail.com>
2024-10-16 12:04:55 +02:00
PJBot
81a8646c4d Automatic changelog update 2024-10-16 03:58:37 +00:00
slarticodefast
87981f3886 Fix plant holder double solution transfer (#32813) 2024-10-15 20:57:30 -07:00
Ed
5b4a7f6edc Ed 15 10 2024 entity hided (#493)
* test

* hide ss14 ents

* Update basic_cloak.yml
2024-10-15 16:53:54 +03:00
Ed
a83d6f0d87 locale (#491)
* locale

* delete ss14 items generated locales
2024-10-15 16:21:07 +03:00
Ed
5d89812abc Merge pull request #490 from crystallpunk-14/ed-15-10-2024-upstream
Ed 15 10 2024 upstream
2024-10-15 15:41:02 +03:00
Ed
31d39b36ae Update CP14ExpeditionSystem.cs 2024-10-15 15:28:16 +03:00
Ed
dc47bb2283 Merge remote-tracking branch 'upstream/stable' into ed-15-10-2024-upstream
# Conflicts:
#	Content.Server/Station/Systems/StationSpawningSystem.cs
2024-10-15 15:25:44 +03:00
Ed
d259191d3d Cargo system (#487)
* simple storeship arriving

* pupu

* ship cycling

* buy positions prototypes

* i hate UI

* PriceControl

* second tab ui

* baloon! pallets!

* update shop in town

* setup billboard timer

* split to sell and buy categories

* renaming gaming

* actually selling

* fix infinity selling

* improve timer

* move description too rigt part UI

* bar selling

* iron cabinet

* purge currency categories

* remove town balance, add money box

* special proposal, FTLImmune anchor

* fix UI

* remove tests buying

* Update CP14StoreWindow.xaml.cs

* currency converter

* currency clean up

* Update CP14CargoSystem.cs

* clean up part 2

* rider petpet

* coins audio

* coin improvment

* Update coins.yml

* translate

* more coins roundstart

* Update wallet.yml

* Update wallet.yml

* generate coin problem fix

* refactor proto reading

* fixes

* huh

* shuttle logshit fix, add to tavern map

* Update CP14StationTravelingStoreShipTargetComponent.cs
2024-10-15 15:22:06 +03:00
PJBot
d871313899 Automatic changelog update 2024-10-15 08:29:36 +00:00
K-Dynamic
7e2c6ea3ea Adds nitrogen to engi tank dispenser (#32565)
nitrogen to engi tank dispenser
2024-10-15 10:28:28 +02:00
PJBot
7532d6f26e Automatic changelog update 2024-10-14 22:00:15 +00:00
Ada
a7741fe9e2 Arcade Prize Additions (#32309)
* rearranged existing arcade rewards for clarity and added more

* removed tesla toy

* removed plushie throngler

* removed singularity toy, readded tesla toy

* removed tesla toy again :(

* Readded accidentally removed PlushieRainbowLizard
2024-10-14 23:59:07 +02:00
mubururu_
6654e00411 organ sprite touch-ups (#32762)
* does work?

* fix

* shrunk organs to normal size of small

* made brains and liver look better

* made stomach slightly less bright

* unique sprite for diona lungs + inhands

* unique sprite for vox lungs + inhands
2024-10-14 13:32:32 +02:00
scrivoy
8c17624896 Marathon: Add EVA Helmets to Perma and add Disposal Unit front of Atmos (#32799)
add: EVA helmets to perma, disposals bin atmos
2024-10-14 05:23:41 -06:00
Errant
519a6b2474 HOTFIX: Fix tech anomaly nexttimer (#32805) (#32807)
Fix tech anomaly nexttimer (#32805)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2024-10-14 11:41:31 +02:00
Ed
4425b77c90 Return RU lang 2024-10-14 11:39:12 +03:00
PJBot
f5ab4f5cb6 Automatic changelog update 2024-10-14 07:07:25 +00:00
metalgearsloth
573f490896 Fix tech anomaly nexttimer (#32805) 2024-10-14 18:06:18 +11:00
ScarKy0
5be82d2a7f Cyborg module action icons (#32505)
* Init

* added jani and medical

* + sci and service modules

* + syndi modules

* fixing up

* geiger counter stuff
2024-10-14 18:05:40 +11:00
PJBot
a7339a5bf9 Automatic changelog update 2024-10-14 05:56:54 +00:00
Kevin Matuschzik
906913563e Fixed portal artifacts targeting the Ai (#32677)
* Added checks to not target AIs and people in containers

* made the change to use IsEntityInContainer. Much Better!

* returned old Mindquerry and removed wrong use of admin logger

* guard statment

* removed unnecessery refs and fixed position swap

* Minor change

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-10-14 16:55:46 +11:00
Джексон Миссиссиппи
9b71757c07 cleanup melee (#32486)
* it removes warns ig

* Quick fix

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2024-10-14 16:40:59 +11:00
Leon Friedrich
97f6097dad Add IsQueuedForDeletion checks to interaction system (#32526) 2024-10-14 15:13:35 +11:00
Leon Friedrich
30ada26315 Remove inaccurate admin log when moving a held item (#32525)
Remove inaccurate admin log when switching held item
2024-10-14 15:05:40 +11:00
PJBot
dd6433c44b Automatic changelog update 2024-10-14 03:55:38 +00:00
metalgearsloth
71c9894903 Jobreq format (#32806)
* Format job requirements as hours and minutes

* Use TimeSpan.ToString for playtime instead of custom method

* wehflicts

---------

Co-authored-by: jmcb <joelsgp@protonmail.com>
2024-10-14 14:54:31 +11:00
OnyxTheBrave
d79b34de9a Fix Industrial Reagent Grinder sprite (#32758)
Updated to reflect the RecyclerVisualLayers no longer having a forward reverse or off visual effect.
2024-10-14 14:53:56 +11:00
PJBot
59490d8259 Automatic changelog update 2024-10-14 03:31:38 +00:00
Pieter-Jan Briers
4a5178a538 Fix role ban loading bugs (#32725)
This code was a mess. Now it's less of a mess and user UserDbDataManager now.

Fixes the following bugs:

* If you connect to a server, restart your client, connect again in the same round, you role bans would not be visible in the client.
* If you role ban somebody who is not connected to the server, then they connect within the round, they will only have the recently-applied ban.

Likely fixes #24781, #27282
2024-10-14 14:30:31 +11:00
lzk
9ceb971535 ping emisse for shuttle changes (#32768) 2024-10-14 14:06:32 +11:00
Leon Friedrich
2d60a4684c Hide role entities in the spawn menu (#32798) 2024-10-14 14:05:49 +11:00
Leon Friedrich
4e0018697f Add role prototype validation tests (#32801)
* Add role prototype validation test

* Rejig GetPrototypesWithComponent

* More tests n stuff
2024-10-14 14:05:25 +11:00
PJBot
870eb439f3 Automatic changelog update 2024-10-13 22:52:54 +00:00
K-Dynamic
0bec8af824 rainbow lizard plushie (#32564)
* rainbow weh

* plushie loot table

* arcade loot pool

* remove from plushie crate

* fuk
2024-10-14 00:51:46 +02:00
TeaMaki
076c692878 Warden Hat Texture Change (#32253) 2024-10-14 00:36:56 +02:00
Pieter-Jan Briers
796764d755 Fix some rounds failing to end due to mind roles (#32792) (#32793)
* Fix some rounds failing to end due to mind roles

Fixes #32791

This is caused by ShowRoundEndScoreboard running into a bug trying to display antags: some player is showing up as antag with MindIsAntagonist(), but has no antag roles listed in MindGetAllRoleInfo().

This was caused by one of the roles of the player having the Antag boolean set, but having no AntagPrototype set.

The responsible mind role appeared to be MindRoleSubvertedSilicon which is missing a set for the SubvertedSilicon antag prototype.

I also added resilience to the round-end code to make it so that an exception showing the scoreboard (and sending the Discord message) would not cause the round end logic to completely abort from an exception.

I am planning to add an integration test to cover this bug (no prototype in mind roles), but I'll leave that for not-the-immediate-hotfix.

* At least one maintainer approved this tiny PR without reading it, not naming names.
2024-10-13 23:00:40 +02:00
Pieter-Jan Briers
c7b0d5a27c Fix some rounds failing to end due to mind roles (#32792)
* Fix some rounds failing to end due to mind roles

Fixes #32791

This is caused by ShowRoundEndScoreboard running into a bug trying to display antags: some player is showing up as antag with MindIsAntagonist(), but has no antag roles listed in MindGetAllRoleInfo().

This was caused by one of the roles of the player having the Antag boolean set, but having no AntagPrototype set.

The responsible mind role appeared to be MindRoleSubvertedSilicon which is missing a set for the SubvertedSilicon antag prototype.

I also added resilience to the round-end code to make it so that an exception showing the scoreboard (and sending the Discord message) would not cause the round end logic to completely abort from an exception.

I am planning to add an integration test to cover this bug (no prototype in mind roles), but I'll leave that for not-the-immediate-hotfix.

* At least one maintainer approved this tiny PR without reading it, not naming names.
2024-10-13 22:55:15 +02:00
github-actions[bot]
56ba3fdf09 Update Credits (#32774)
Co-authored-by: PJBot <pieterjan.briers+bot@gmail.com>
2024-10-13 18:06:40 +02:00
Errant
e5ad32fe93 Fix random test fail in DeleteAllThenGhost (#32753)
It's simple. We kill the heisentest
2024-10-13 17:31:38 +02:00
Errant
30effd5ccd Fix random test fail in DeleteAllThenGhost (#32753)
It's simple. We kill the heisentest
2024-10-13 17:28:26 +02:00
Ed
648505dc15 Switch to ENG language 2024-10-13 15:02:57 +03:00
PJBot
0e3f3536ff Automatic changelog update 2024-10-13 11:26:56 +00:00
SlamBamActionman
9bf7c44585 Add poster about the SSD term (#32736)
* moff

* Attribution
2024-10-13 22:25:49 +11:00
PJBot
7af913ad13 Automatic changelog update 2024-10-13 08:23:11 +00:00
SkaldetSkaeg
8093a49943 Block emotes for sleeping (#32779)
* Block emotes

* typing issue

* Update Content.Shared/Bed/Sleep/SleepingSystem.cs

Co-authored-by: MilenVolf <63782763+MilenVolf@users.noreply.github.com>

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: MilenVolf <63782763+MilenVolf@users.noreply.github.com>
2024-10-13 19:22:05 +11:00
PJBot
52937a2e64 Automatic changelog update 2024-10-13 06:39:39 +00:00
BramvanZijp
2e3db0e2c5 Increase AI Playtime Requirements (#32007)
* Increase AI Playtime Requirement

* Change silicon supervisor message

* Slightly lower AI time requirement and change borg supervisor to be just its laws for now.

* Leave the supervisor to another PR

* Comply with maintainer request

* Comply with another maintainer request because they forgor.
2024-10-13 17:38:32 +11:00
Jezithyr
af72f2e17c Applying Fix from #32764 to staging 2024-10-12 22:21:44 -07:00
John
7c6ff536eb Fixing Thief Beacon Role Check Logic (to use new mindrole system) (#32764) 2024-10-12 22:20:03 -07:00
PJBot
1f6bab7957 Automatic changelog update 2024-10-13 04:57:00 +00:00
Golinth
561d55e7a4 Firebot Tweaks (#32629)
Removed random sentience and some other minor tweaks
2024-10-13 15:55:51 +11:00
Theodore Lukin
7f42c0a531 Qm external access (#32631)
gave qm external access
2024-10-13 15:55:12 +11:00
Nim
40959cf422 fix resp (#488) 2024-10-13 02:09:41 +03:00
KingFroozy
214a20da8e Changes to CE's suits (#29850)
* Changes to ce sprites

* Adjustments

* More changes i guess

* Love life, get skirt

* Bitlessdark

* fkingforcepush

* upd №?
2024-10-12 21:13:39 +02:00
lzk
b999752e88 Update omega evac (#32748)
- rename to evac omega
- add screens
2024-10-12 13:03:55 -06:00
Scribbles0
561297495f Marathon AI tweaks (#32756)
* camera tweaks

* add intercoms
2024-10-12 13:03:31 -06:00
slarticodefast
4704309b4e Fix SpawnAndDeleteAllEntitiesInTheSameSpot heisentest (#32330)
What happened was that the new tech anomaly randomly triggered a signal sink on the portable generator, which is currently broken and throws an error if the that sink is activated.

The resolve needed logMissing = false because it does not expect the ActiveGeneratorRevvingComponent to exist.
2024-10-12 11:54:48 -07:00
slarticodefast
d6d8c55d57 Don't error on missing component in ChangeHeat (#32451) 2024-10-12 11:52:05 -07:00
Nim
a6fc5e6ace Rabbit (#486)
* rabbit

* meat

* гладить

* тоже гладить
2024-10-12 20:01:13 +03:00
eoineoineoin
70b7747fdd Make APC UI work correctly with multiple users (#32465)
* Make APC UI work correctly with multiple users

* Check access only on client, when constructing UI

* Do TODO (Thanks, Robust 236.1)

---------

Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
2024-10-12 19:21:43 +11:00
Errant
a9ecf805e5 Fix random test fail in DeleteAllThenGhost (#32753)
It's simple. We kill the heisentest
2024-10-11 21:17:01 +02:00
Saphire Lattice
729de28844 Fix Centcom cloning scanner (#32746)
* Fix Centcom cloning scanner

* Fix uid conflict
2024-10-11 03:00:54 -06:00
lzk
7a4cefa8ac update fland (#32747)
add captain id card
2024-10-11 02:35:46 -06:00
scrivoy
e98af125dc Fixed capitalization in Interface description (#32739) 2024-10-10 21:40:41 +02:00
PJBot
bc64676747 Automatic changelog update 2024-10-10 14:36:43 +00:00
nikthechampiongr
e7b7e2270d Fix bounties(and potentially other things) running out of ids (#32700)
* Make NameIdentifier Ids get refreshed after round restarts

Before this commit the existing values would just get shuffled.
This means that eventually the server would run out of ids to give to
new entities for different groups. As a result everything would get id 0

* Comply with what seemingly is the convention for sawmills

* Make it impossible to insert a bounty with a duplicate id

* Reduce duplication

* Remove unused sawmill

* Fix rustbrain and skill issue

* Aaaa

* Apply suggestions from code review

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2024-10-10 16:35:35 +02:00
PJBot
740288eb96 Automatic changelog update 2024-10-10 08:50:05 +00:00
Errant
93c7bdc134 Mind Role Entities (#31318)
* Mind Role Entities wip

* headrev count fix

* silicon stuff, cleanup

* exclusive antag config, cleanup

* jobroleadd overwerite

* logging stuff

* MindHasRole cleanup, admin log stuff

* last second cleanup

* ocd

* minor cleanup

* remove createdTime datafield

* now actually using the event replacement I made for role time tracking

* weh
2024-10-10 10:48:56 +02:00
Pieter-Jan Briers
3e078ab3e0 Fix error log when recycling something with small material counts. (#32723)
* Fix error log when recycling something with small material counts.

MaterialStorageSystem.SpawnMultipleFromMaterial now doesn't call StackSystem.SpawnMultiple if it tries to spawn zero. This happens because the recycler calls SpawnMultipleFromMaterial for everything recycled, even if the amount it has stored is < the amount for one sheet.

* Update Content.Server/Materials/MaterialStorageSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-10 03:29:26 +02:00
PJBot
ac16a05fef Automatic changelog update 2024-10-09 18:02:38 +00:00
beck-thompson
327466a6e2 Plushies can now have pAIs stuffed into them (v2)! (#30805)
* First commit

* I forgot silly me

* Actually added comments

* spellin

* fixes

* more blacklists

* Minor fixes

* Speech Verb also changes now

* Simple name stuff

* Other fixes

* remove one line of whitespace

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-09 20:01:32 +02:00
chavonadelal
6d99597349 Job title localization (#32338)
* Job title localization

* Correcting fields
2024-10-09 17:05:36 +02:00
Ed
844b4d4616 underworld (#485) 2024-10-09 16:19:38 +03:00
PJBot
fc1c709d44 Automatic changelog update 2024-10-09 12:45:45 +00:00
beck-thompson
5a41cc81b3 Decrease price of radio jammer from 4 tc -> 3 tc (#32472)
* First commit

* increase price by one tc
2024-10-09 14:44:38 +02:00
lzk
d450b613d6 fix typo (#32712) 2024-10-09 14:41:07 +02:00
PJBot
b657aba2e1 Automatic changelog update 2024-10-09 11:56:57 +00:00
SlamBamActionman
ddaa0e83c6 Add admin log for codewords (#32531)
* initial commit

* Delta review
2024-10-09 13:55:48 +02:00
Pieter-Jan Briers
1dbbf315c7 Update submodule to v236.1.0 (#32704) 2024-10-09 13:41:03 +02:00
Ed
b9df2a495a some blacksmith bandage (#483)
* anvil

* iron and copper ore walls + procedural cave update

* vladimirs rocks

* furnace

* Revert "furnace"

This reverts commit f378e4fb85.

* Revert "vladimirs rocks"

This reverts commit b2c6a193fc.

* Revert "iron and copper ore walls + procedural cave update"

This reverts commit dc6d70b10e.

* Revert "anvil"

This reverts commit 3ab1649992.

* Reapply "anvil"

This reverts commit 91c226d18d.

* huh

* fuck anvil

* Revert "fuck anvil"

This reverts commit 3c3a87c25e.

* Revert "huh"

This reverts commit 7fb44b4908.

* fix comment

* Reapply "iron and copper ore walls + procedural cave update"

This reverts commit 891c3ba0aa.

* Reapply "vladimirs rocks"

This reverts commit 4f2eaef6c1.

* Reapply "furnace"

This reverts commit 9d7e042ddf.

* Update anvil.yml

* Update workbenchs.yml

* Update workbenchs.yml

* Update workbenchs.yml

* Update workbenchs.yml

* Update workbenchs.yml

* Update workbenchs.yml

* Update workbenchs.yml

* Update workbenchs.yml

* Update workbenchs.yml

* EVIL anvil

* Update workbenchs.yml
2024-10-09 13:40:06 +03:00
PJBot
357e998cbb Automatic changelog update 2024-10-08 23:30:49 +00:00
beck-thompson
384ff7e8f6 Add pumpkin pie! (#32623)
* first commit

* Licence fix

* rosysyntax licence change (permission granted!)

* simplify

* Better wording
2024-10-09 10:29:41 +11:00
Nim
1ca7456363 AI Factions (#481)
* factions

* CP14

* Update ai_factions.yml

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
2024-10-08 22:52:46 +03:00
PJBot
dc2899c274 Automatic changelog update 2024-10-08 18:30:44 +00:00
K-Dynamic
6f9b4f4226 CHIMP and APE particle speed increase (#32690)
* swap omega and delta particle colours

* remove upgrade doafter

* explicit syndicate chip description

* Syndicate CHIMP stealth

* fast projectile speed

* 10 to 12 shots

* buff heat dmg

* upgrade chip mentions omega particle

* Revert "remove upgrade doafter"

This reverts commit 8a321980b7a384daca06215656494e0c116e7333.

* Revert "explicit syndicate chip description"

This reverts commit c803c773739a61fc5b3a6cb90810622a6d5846c9.

* Revert "Syndicate CHIMP stealth"

This reverts commit 698a108580892addabf8d51494a72e1ee651b8e6.

* Revert "10 to 12 shots"

This reverts commit 858ac0392be0549eb0a288648413d1020cabae1a.

* Revert "swap omega and delta particle colours"

This reverts commit 4c000b2f110a5d35f317cb61cb5b03ea32841ad5.

* Revert "buff heat dmg"

This reverts commit 02a8690dafbd41631b098e51ef9afba5b6ee6ac4.
2024-10-08 20:29:37 +02:00
PJBot
28f576dae8 Automatic changelog update 2024-10-08 09:54:56 +00:00
Plykiya
1366f6b405 Replace the Librarian's round-start D10 with a D20 (#32648)
Replace D10 with a D20
2024-10-08 11:53:50 +02:00
averystarbit
0e0887bd49 Added proper capitalisation for supervisors when entering the game (#32683)
changed punctuation for jobs, added proper capitalization and comma usa
2024-10-08 11:52:46 +02:00
PJBot
1f04117edf Automatic changelog update 2024-10-08 09:52:31 +00:00
shamp
922dd0bce6 Fix cloth dupe (#32685)
Update curtains.yml
2024-10-08 11:51:23 +02:00
lzk
33042b00d0 Fix cryo locale again (#32654)
* Fix cryo locale again

* yeep
2024-10-08 11:50:54 +02:00
Ubaser
38fd54a1bf Update Core (#32665)
* add

* remove invalids

* fix

* yes
2024-10-07 19:59:06 -06:00
PJBot
34df781668 Automatic changelog update 2024-10-07 22:43:51 +00:00
Saphire Lattice
f22f9e39c5 Change minibomb to be explosion resistant and start timer on damage (#32429)
* Make minibomb explosion resistant and trigger timer on damage

* Tune damage behaviour and threshold for minibomb
2024-10-08 00:42:42 +02:00
Pieter-Jan Briers
eecbfb63a0 Move client dumpentities command to "DEBUG" (#32687) 2024-10-07 19:19:42 +02:00
Scribbles0
6b10e00da4 oasis update (#32679)
sec apcs and ai core wiring
2024-10-06 19:24:44 -06:00
PJBot
a6c468b697 Automatic changelog update 2024-10-06 13:34:08 +00:00
Golinth
46a2eb545e Fully Revert Clown Waddling (#32652)
Fully revert Clown Waddling (revival of #29161)

A sad day, see #29156 for discussion
2024-10-06 15:33:02 +02:00
PJBot
35fc1b4037 Automatic changelog update 2024-10-06 12:49:56 +00:00
Арт
867efe8b5b Add flowers to loadout (#32097)
* Add_Poppy&Lily

* Add_FlowerWreath

* Add_Headflowers

Sprites, meta, prototype

* Id_Changes

* Changes

* Update_Sprite

* Desc_Change

* Scale_Change

* Sprite_Scaling
2024-10-06 14:48:49 +02:00
Spessmann
126c1786de Cog update fix (#32657)
* fixes for cog

* ok fixed that
2024-10-05 20:30:10 -06:00
PJBot
386e59b462 Automatic changelog update 2024-10-05 18:45:55 +00:00
slarticodefast
eb4e422cb0 fix light bulbs not fitting into the trash bag (#32452)
fix trash
2024-10-05 12:44:47 -06:00
Spessmann
2287df13bd Cog engineering DIY update (#32651)
engineers forced to do work, sobbing
2024-10-05 12:08:39 -06:00
TakoDragon
db64ad9c4d Marathon Removed double walls and a wrong cable (#32603)
removed double walls and cable fucks
2024-10-04 17:18:46 -06:00
NotSoDamn
644d7ab682 BaseAdvancedPen migration (#32638)
* Update migration.yml

* Update Resources/migration.yml

Co-authored-by: lzk <124214523+lzk228@users.noreply.github.com>

---------

Co-authored-by: lzk <124214523+lzk228@users.noreply.github.com>
2024-10-04 23:13:30 +03:00
PJBot
ec4acdebbf Automatic changelog update 2024-10-04 09:35:55 +00:00
Saphire Lattice
94c8018ff3 Change the syndicate charge to start a timer on signal (#32423)
* Change the syndicate charge to start a timer on signal

* Actually add the component in question

* Add default link for TimerStart signal
2024-10-04 11:34:48 +02:00
PJBot
fbb6f17add Automatic changelog update 2024-10-04 08:44:51 +00:00
Saphire Lattice
88f060d51a Make the explosions throw the container/item they originated from (#32428)
Extra fun if it's something that can trigger multiple times
2024-10-04 10:43:45 +02:00
PJBot
8b65186bfa Automatic changelog update 2024-10-04 05:40:57 +00:00
SoulFN
9e054c1f9d Give dragon pull ability (#32568) 2024-10-04 15:39:50 +10:00
PJBot
423d394af1 Automatic changelog update 2024-10-04 02:56:43 +00:00
Plykiya
295e63193c Two additional checks to prevent FTLing stations (#32558)
Add two additional checks to prevent FTLing
2024-10-04 12:55:36 +10:00
Jezithyr
570c166517 Disable Auto-Publish (#32627)
disable auto publish
2024-10-04 03:16:32 +02:00
PJBot
7edd1c6d52 Automatic changelog update 2024-10-04 01:14:09 +00:00
Southbridge
c0d67429ab Box Station - Connected Recycler, rerouted power for Singlo Substation, added law boards to AI upload room (#32608)
* Fixed #32443 and #30375

* Fixed duplicate ID issue, and added lawboards to resolve #32581

* Removed Overlord board and added Crewsimov

* Removed invalid UserInterface component
2024-10-03 19:12:59 -06:00
2110 changed files with 165100 additions and 182440 deletions

2
.github/CODEOWNERS vendored
View File

@@ -19,7 +19,7 @@
/Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer
/Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer
/Resources/Prototypes/Maps/ @Emisse
/Resources/Prototypes/Maps/** @Emisse
/Resources/Prototypes/Body/ @DrSmugleaf # suffering
/Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf

View File

@@ -5,8 +5,8 @@ concurrency:
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *'
# schedule:
# - cron: '0 10 * * *'
jobs:
build:

View File

@@ -23,6 +23,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
{
private readonly IEntityManager _entManager;
private readonly SpriteSystem _spriteSystem;
private readonly SharedNavMapSystem _navMapSystem;
private EntityUid? _owner;
private NetEntity? _trackedEntity;
@@ -42,19 +43,32 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
private const float SilencingDuration = 2.5f;
// Colors
private Color _wallColor = new Color(64, 64, 64);
private Color _tileColor = new Color(28, 28, 28);
private Color _monitorBlipColor = Color.Cyan;
private Color _untrackedEntColor = Color.DimGray;
private Color _regionBaseColor = new Color(154, 154, 154);
private Color _inactiveColor = StyleNano.DisabledFore;
private Color _statusTextColor = StyleNano.GoodGreenFore;
private Color _goodColor = Color.LimeGreen;
private Color _warningColor = new Color(255, 182, 72);
private Color _dangerColor = new Color(255, 67, 67);
public AtmosAlertsComputerWindow(AtmosAlertsComputerBoundUserInterface userInterface, EntityUid? owner)
{
RobustXamlLoader.Load(this);
_entManager = IoCManager.Resolve<IEntityManager>();
_spriteSystem = _entManager.System<SpriteSystem>();
_navMapSystem = _entManager.System<SharedNavMapSystem>();
// Pass the owner to nav map
_owner = owner;
NavMap.Owner = _owner;
// Set nav map colors
NavMap.WallColor = new Color(64, 64, 64);
NavMap.TileColor = Color.DimGray * NavMap.WallColor;
NavMap.WallColor = _wallColor;
NavMap.TileColor = _tileColor;
// Set nav map grid uid
var stationName = Loc.GetString("atmos-alerts-window-unknown-location");
@@ -179,6 +193,9 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
// Add tracked entities to the nav map
foreach (var device in console.AtmosDevices)
{
if (!device.NetEntity.Valid)
continue;
if (!NavMap.Visible)
continue;
@@ -209,7 +226,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
if (consoleCoords != null && consoleUid != null)
{
var texture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")));
var blip = new NavMapBlip(consoleCoords.Value, texture, Color.Cyan, true, false);
var blip = new NavMapBlip(consoleCoords.Value, texture, _monitorBlipColor, true, false);
NavMap.TrackedEntities[consoleUid.Value] = blip;
}
@@ -258,7 +275,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
VerticalAlignment = VAlignment.Center,
};
label.SetMarkup(Loc.GetString("atmos-alerts-window-no-active-alerts", ("color", StyleNano.GoodGreenFore.ToHexNoAlpha())));
label.SetMarkup(Loc.GetString("atmos-alerts-window-no-active-alerts", ("color", _statusTextColor.ToHexNoAlpha())));
AlertsTable.AddChild(label);
}
@@ -270,6 +287,34 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
else
MasterTabContainer.SetTabTitle(0, Loc.GetString("atmos-alerts-window-tab-alerts", ("value", activeAlarmCount)));
// Update sensor regions
NavMap.RegionOverlays.Clear();
var prioritizedRegionOverlays = new Dictionary<NavMapRegionOverlay, int>();
if (_owner != null &&
_entManager.TryGetComponent<TransformComponent>(_owner, out var xform) &&
_entManager.TryGetComponent<NavMapComponent>(xform.GridUid, out var navMap))
{
var regionOverlays = _navMapSystem.GetNavMapRegionOverlays(_owner.Value, navMap, AtmosAlertsComputerUiKey.Key);
foreach (var (regionOwner, regionOverlay) in regionOverlays)
{
var alarmState = GetAlarmState(regionOwner);
if (!TryGetSensorRegionColor(regionOwner, alarmState, out var regionColor))
continue;
regionOverlay.Color = regionColor;
var priority = (_trackedEntity == regionOwner) ? 999 : (int)alarmState;
prioritizedRegionOverlays.Add(regionOverlay, priority);
}
// Sort overlays according to their priority
var sortedOverlays = prioritizedRegionOverlays.OrderBy(x => x.Value).Select(x => x.Key).ToList();
NavMap.RegionOverlays = sortedOverlays;
}
// Auto-scroll re-enable
if (_autoScrollAwaitsUpdate)
{
@@ -290,7 +335,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
var coords = _entManager.GetCoordinates(metaData.NetCoordinates);
if (_trackedEntity != null && _trackedEntity != metaData.NetEntity)
color *= Color.DimGray;
color *= _untrackedEntColor;
var selectable = true;
var blip = new NavMapBlip(coords, _spriteSystem.Frame0(texture), color, _trackedEntity == metaData.NetEntity, selectable);
@@ -298,6 +343,24 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
NavMap.TrackedEntities[metaData.NetEntity] = blip;
}
private bool TryGetSensorRegionColor(NetEntity regionOwner, AtmosAlarmType alarmState, out Color color)
{
color = Color.White;
var blip = GetBlipTexture(alarmState);
if (blip == null)
return false;
// Color the region based on alarm state and entity tracking
color = blip.Value.Item2 * _regionBaseColor;
if (_trackedEntity != null && _trackedEntity != regionOwner)
color *= _untrackedEntColor;
return true;
}
private void UpdateUIEntry(AtmosAlertsComputerEntry entry, int index, Control table, AtmosAlertsComputerComponent console, AtmosAlertsFocusDeviceData? focusData = null)
{
// Make new UI entry if required
@@ -534,13 +597,13 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
switch (alarmState)
{
case AtmosAlarmType.Invalid:
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), StyleNano.DisabledFore); break;
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), _inactiveColor); break;
case AtmosAlarmType.Normal:
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), Color.LimeGreen); break;
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), _goodColor); break;
case AtmosAlarmType.Warning:
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_triangle.png")), new Color(255, 182, 72)); break;
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_triangle.png")), _warningColor); break;
case AtmosAlarmType.Danger:
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_square.png")), new Color(255, 67, 67)); break;
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_square.png")), _dangerColor); break;
}
return output;

View File

@@ -43,6 +43,8 @@ public sealed partial class ContentAudioSystem
private void CP14UpdateAmbientLoops()
{
return; //DISABLED UNTIL CLIENT ERROR SPAM FIXED
if (_timing.CurTime <= _nextUpdateTime)
return;

View File

@@ -1,6 +1,8 @@
using Content.Shared.Damage.Prototypes;
using Content.Shared.Overlays;
using Robust.Client.Player;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;
using System.Linq;
namespace Content.Client.Commands;
@@ -34,7 +36,7 @@ public sealed class ShowHealthBarsCommand : LocalizedCommands
{
var showHealthBarsComponent = new ShowHealthBarsComponent
{
DamageContainers = args.ToList(),
DamageContainers = args.Select(arg => new ProtoId<DamageContainerPrototype>(arg)).ToList(),
HealthStatusIcon = null,
NetSyncEnabled = false
};

View File

@@ -4,6 +4,7 @@ using Content.Client.Chat.Managers;
using Content.Client.DebugMon;
using Content.Client.Eui;
using Content.Client.Fullscreen;
using Content.Client.GameTicking.Managers;
using Content.Client.GhostKick;
using Content.Client.Guidebook;
using Content.Client.Input;
@@ -71,6 +72,7 @@ namespace Content.Client.Entry
[Dependency] private readonly IReplayLoadManager _replayLoad = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!;
[Dependency] private readonly TitleWindowManager _titleWindowManager = default!;
public override void Init()
{
@@ -140,6 +142,12 @@ namespace Content.Client.Entry
_configManager.SetCVar("interface.resolutionAutoScaleMinimum", 0.5f);
}
public override void Shutdown()
{
base.Shutdown();
_titleWindowManager.Shutdown();
}
public override void PostInit()
{
base.PostInit();
@@ -160,6 +168,7 @@ namespace Content.Client.Entry
_userInterfaceManager.SetDefaultTheme(_configManager.GetCVar(CCVars.UIDefaultInterfaceTheme));
_userInterfaceManager.SetActiveTheme(_configManager.GetCVar(CVars.InterfaceTheme));
_documentParsingManager.Initialize();
_titleWindowManager.Initialize();
_baseClient.RunLevelChanged += (_, args) =>
{

View File

@@ -0,0 +1,62 @@
using Content.Shared.CCVar;
using Robust.Client;
using Robust.Client.Graphics;
using Robust.Shared;
using Robust.Shared.Configuration;
namespace Content.Client.GameTicking.Managers;
public sealed class TitleWindowManager
{
[Dependency] private readonly IBaseClient _client = default!;
[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IGameController _gameController = default!;
public void Initialize()
{
_cfg.OnValueChanged(CVars.GameHostName, OnHostnameChange, true);
_cfg.OnValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange, true);
_client.RunLevelChanged += OnRunLevelChangedChange;
}
public void Shutdown()
{
_cfg.UnsubValueChanged(CVars.GameHostName, OnHostnameChange);
_cfg.UnsubValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange);
}
private void OnHostnameChange(string hostname)
{
var defaultWindowTitle = _gameController.GameTitle();
// Since the game assumes the server name is MyServer and that GameHostnameInTitlebar CCVar is true by default
// Lets just... not show anything. This also is used to revert back to just the game title on disconnect.
if (_client.RunLevel == ClientRunLevel.Initialize)
{
_clyde.SetWindowTitle(defaultWindowTitle);
return;
}
if (_cfg.GetCVar(CCVars.GameHostnameInTitlebar))
// If you really dislike the dash I guess change it here
_clyde.SetWindowTitle(hostname + " - " + defaultWindowTitle);
else
_clyde.SetWindowTitle(defaultWindowTitle);
}
// Clients by default assume game.hostname_in_titlebar is true
// but we need to clear it as soon as we join and actually receive the servers preference on this.
// This will ensure we rerun OnHostnameChange and set the correct title bar name.
private void OnHostnameTitleChange(bool colonthree)
{
OnHostnameChange(_cfg.GetCVar(CVars.GameHostName));
}
// This is just used we can rerun the hostname change function when we disconnect to revert back to just the games title.
private void OnRunLevelChangedChange(object? sender, RunLevelChangedEventArgs runLevelChangedEventArgs)
{
OnHostnameChange(_cfg.GetCVar(CVars.GameHostName));
}
}

View File

@@ -130,9 +130,9 @@ namespace Content.Client.Hands.Systems
OnPlayerHandsAdded?.Invoke(hands);
}
public override void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, HandsComponent? hands = null)
public override void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, HandsComponent? hands = null, bool log = true)
{
base.DoDrop(uid, hand, doDropInteraction, hands);
base.DoDrop(uid, hand, doDropInteraction, hands, log);
if (TryComp(hand.HeldEntity, out SpriteComponent? sprite))
sprite.RenderOrder = EntityManager.CurrentTick.Value;

View File

@@ -1,3 +1,4 @@
using Content.Shared.Localizations;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
@@ -16,19 +17,10 @@ public sealed partial class PlaytimeStatsEntry : ContainerButton
RoleLabel.Text = role;
Playtime = playtime; // store the TimeSpan value directly
PlaytimeLabel.Text = ConvertTimeSpanToHoursMinutes(playtime); // convert to string for display
PlaytimeLabel.Text = ContentLocalizationManager.FormatPlaytime(playtime); // convert to string for display
BackgroundColorPanel.PanelOverride = styleBox;
}
private static string ConvertTimeSpanToHoursMinutes(TimeSpan timeSpan)
{
var hours = (int)timeSpan.TotalHours;
var minutes = timeSpan.Minutes;
var formattedTimeLoc = Loc.GetString("ui-playtime-time-format", ("hours", hours), ("minutes", minutes));
return formattedTimeLoc;
}
public void UpdateShading(StyleBoxFlat styleBox)
{
BackgroundColorPanel.PanelOverride = styleBox;

View File

@@ -104,8 +104,7 @@ public sealed partial class PlaytimeStatsWindow : FancyWindow
{
var overallPlaytime = _jobRequirementsManager.FetchOverallPlaytime();
var formattedPlaytime = ConvertTimeSpanToHoursMinutes(overallPlaytime);
OverallPlaytimeLabel.Text = Loc.GetString("ui-playtime-overall", ("time", formattedPlaytime));
OverallPlaytimeLabel.Text = Loc.GetString("ui-playtime-overall", ("time", overallPlaytime));
var rolePlaytimes = _jobRequirementsManager.FetchPlaytimeByRoles();
@@ -134,13 +133,4 @@ public sealed partial class PlaytimeStatsWindow : FancyWindow
_sawmill.Error($"The provided playtime string '{playtimeString}' is not in the correct format.");
}
}
private static string ConvertTimeSpanToHoursMinutes(TimeSpan timeSpan)
{
var hours = (int) timeSpan.TotalHours;
var minutes = timeSpan.Minutes;
var formattedTimeLoc = Loc.GetString("ui-playtime-time-format", ("hours", hours), ("minutes", minutes));
return formattedTimeLoc;
}
}

View File

@@ -5,6 +5,7 @@ using Content.Client.Clickable;
using Content.Client.DebugMon;
using Content.Client.Eui;
using Content.Client.Fullscreen;
using Content.Client.GameTicking.Managers;
using Content.Client.GhostKick;
using Content.Client.Guidebook;
using Content.Client.Launcher;
@@ -57,6 +58,7 @@ namespace Content.Client.IoC
collection.Register<DebugMonitorManager>();
collection.Register<PlayerRateLimitManager>();
collection.Register<SharedPlayerRateLimitManager, PlayerRateLimitManager>();
collection.Register<TitleWindowManager>();
}
}
}

View File

@@ -1,149 +0,0 @@
using System.Numerics;
using Content.Client.Buckle;
using Content.Client.Gravity;
using Content.Shared.ActionBlocker;
using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Animations;
namespace Content.Client.Movement.Systems;
public sealed class WaddleAnimationSystem : SharedWaddleAnimationSystem
{
[Dependency] private readonly AnimationPlayerSystem _animation = default!;
[Dependency] private readonly GravitySystem _gravity = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly BuckleSystem _buckle = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
public override void Initialize()
{
base.Initialize();
SubscribeAllEvent<StartedWaddlingEvent>(OnStartWaddling);
SubscribeLocalEvent<WaddleAnimationComponent, AnimationCompletedEvent>(OnAnimationCompleted);
SubscribeAllEvent<StoppedWaddlingEvent>(OnStopWaddling);
}
private void OnStartWaddling(StartedWaddlingEvent msg, EntitySessionEventArgs args)
{
if (TryComp<WaddleAnimationComponent>(GetEntity(msg.Entity), out var comp))
StartWaddling((GetEntity(msg.Entity), comp));
}
private void OnStopWaddling(StoppedWaddlingEvent msg, EntitySessionEventArgs args)
{
if (TryComp<WaddleAnimationComponent>(GetEntity(msg.Entity), out var comp))
StopWaddling((GetEntity(msg.Entity), comp));
}
private void StartWaddling(Entity<WaddleAnimationComponent> entity)
{
if (_animation.HasRunningAnimation(entity.Owner, entity.Comp.KeyName))
return;
if (!TryComp<InputMoverComponent>(entity.Owner, out var mover))
return;
if (_gravity.IsWeightless(entity.Owner))
return;
if (!_actionBlocker.CanMove(entity.Owner, mover))
return;
// Do nothing if buckled in
if (_buckle.IsBuckled(entity.Owner))
return;
// Do nothing if crit or dead (for obvious reasons)
if (_mobState.IsIncapacitated(entity.Owner))
return;
PlayWaddleAnimationUsing(
(entity.Owner, entity.Comp),
CalculateAnimationLength(entity.Comp, mover),
CalculateTumbleIntensity(entity.Comp)
);
}
private static float CalculateTumbleIntensity(WaddleAnimationComponent component)
{
return component.LastStep ? 360 - component.TumbleIntensity : component.TumbleIntensity;
}
private static float CalculateAnimationLength(WaddleAnimationComponent component, InputMoverComponent mover)
{
return mover.Sprinting ? component.AnimationLength * component.RunAnimationLengthMultiplier : component.AnimationLength;
}
private void OnAnimationCompleted(Entity<WaddleAnimationComponent> entity, ref AnimationCompletedEvent args)
{
if (args.Key != entity.Comp.KeyName)
return;
if (!TryComp<InputMoverComponent>(entity.Owner, out var mover))
return;
PlayWaddleAnimationUsing(
(entity.Owner, entity.Comp),
CalculateAnimationLength(entity.Comp, mover),
CalculateTumbleIntensity(entity.Comp)
);
}
private void StopWaddling(Entity<WaddleAnimationComponent> entity)
{
if (!_animation.HasRunningAnimation(entity.Owner, entity.Comp.KeyName))
return;
_animation.Stop(entity.Owner, entity.Comp.KeyName);
if (!TryComp<SpriteComponent>(entity.Owner, out var sprite))
return;
sprite.Offset = new Vector2();
sprite.Rotation = Angle.FromDegrees(0);
}
private void PlayWaddleAnimationUsing(Entity<WaddleAnimationComponent> entity, float len, float tumbleIntensity)
{
entity.Comp.LastStep = !entity.Comp.LastStep;
var anim = new Animation()
{
Length = TimeSpan.FromSeconds(len),
AnimationTracks =
{
new AnimationTrackComponentProperty()
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Rotation),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(0), 0),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(tumbleIntensity), len/2),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(0), len/2),
}
},
new AnimationTrackComponentProperty()
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Offset),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(new Vector2(), 0),
new AnimationTrackProperty.KeyFrame(entity.Comp.HopIntensity, len/2),
new AnimationTrackProperty.KeyFrame(new Vector2(), len/2),
}
}
}
};
_animation.Play(entity.Owner, anim, entity.Comp.KeyName);
}
}

View File

@@ -22,6 +22,6 @@ public sealed class ShowThirstIconsSystem : EquipmentHudSystem<ShowThirstIconsCo
return;
if (_thirst.TryGetStatusIconPrototype(component, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype!);
ev.StatusIcons.Add(iconPrototype);
}
}

View File

@@ -76,16 +76,16 @@ public sealed partial class StencilOverlay : Overlay
//CP14 Overlays
if (_entManager.TryGetComponent<CP14WorldEdgeComponent>(mapUid, out var worldEdge))
if (_entManager.TryGetComponent<CP14CloudShadowsComponent>(mapUid, out var shadows))
{
DrawWorldEdge(args, worldEdge, invMatrix);
DrawCloudShadows(args, shadows, invMatrix);
}
//CP14 Overlays end
//CP14 Overlays
if (_entManager.TryGetComponent<CP14CloudShadowsComponent>(mapUid, out var shadows))
if (_entManager.TryGetComponent<CP14WorldEdgeComponent>(mapUid, out var worldEdge))
{
DrawCloudShadows(args, shadows, invMatrix);
DrawWorldEdge(args, worldEdge, invMatrix);
}
//CP14 Overlays end

View File

@@ -0,0 +1,303 @@
using Content.Shared.Atmos;
using Content.Shared.Pinpointer;
using System.Linq;
namespace Content.Client.Pinpointer;
public sealed partial class NavMapSystem
{
private (AtmosDirection, Vector2i, AtmosDirection)[] _regionPropagationTable =
{
(AtmosDirection.East, new Vector2i(1, 0), AtmosDirection.West),
(AtmosDirection.West, new Vector2i(-1, 0), AtmosDirection.East),
(AtmosDirection.North, new Vector2i(0, 1), AtmosDirection.South),
(AtmosDirection.South, new Vector2i(0, -1), AtmosDirection.North),
};
public override void Update(float frameTime)
{
// To prevent compute spikes, only one region is flood filled per frame
var query = AllEntityQuery<NavMapComponent>();
while (query.MoveNext(out var ent, out var entNavMapRegions))
FloodFillNextEnqueuedRegion(ent, entNavMapRegions);
}
private void FloodFillNextEnqueuedRegion(EntityUid uid, NavMapComponent component)
{
if (!component.QueuedRegionsToFlood.Any())
return;
var regionOwner = component.QueuedRegionsToFlood.Dequeue();
// If the region is no longer valid, flood the next one in the queue
if (!component.RegionProperties.TryGetValue(regionOwner, out var regionProperties) ||
!regionProperties.Seeds.Any())
{
FloodFillNextEnqueuedRegion(uid, component);
return;
}
// Flood fill the region, using the region seeds as starting points
var (floodedTiles, floodedChunks) = FloodFillRegion(uid, component, regionProperties);
// Combine the flooded tiles into larger rectangles
var gridCoords = GetMergedRegionTiles(floodedTiles);
// Create and assign the new region overlay
var regionOverlay = new NavMapRegionOverlay(regionProperties.UiKey, gridCoords)
{
Color = regionProperties.Color
};
component.RegionOverlays[regionOwner] = regionOverlay;
// To reduce unnecessary future flood fills, we will track which chunks have been flooded by a region owner
// First remove an old assignments
if (component.RegionOwnerToChunkTable.TryGetValue(regionOwner, out var oldChunks))
{
foreach (var chunk in oldChunks)
{
if (component.ChunkToRegionOwnerTable.TryGetValue(chunk, out var oldOwners))
{
oldOwners.Remove(regionOwner);
component.ChunkToRegionOwnerTable[chunk] = oldOwners;
}
}
}
// Now update with the new assignments
component.RegionOwnerToChunkTable[regionOwner] = floodedChunks;
foreach (var chunk in floodedChunks)
{
if (!component.ChunkToRegionOwnerTable.TryGetValue(chunk, out var owners))
owners = new();
owners.Add(regionOwner);
component.ChunkToRegionOwnerTable[chunk] = owners;
}
}
private (HashSet<Vector2i>, HashSet<Vector2i>) FloodFillRegion(EntityUid uid, NavMapComponent component, NavMapRegionProperties regionProperties)
{
if (!regionProperties.Seeds.Any())
return (new(), new());
var visitedChunks = new HashSet<Vector2i>();
var visitedTiles = new HashSet<Vector2i>();
var tilesToVisit = new Stack<Vector2i>();
foreach (var regionSeed in regionProperties.Seeds)
{
tilesToVisit.Push(regionSeed);
while (tilesToVisit.Count > 0)
{
// If the max region area is hit, exit
if (visitedTiles.Count > regionProperties.MaxArea)
return (new(), new());
// Pop the top tile from the stack
var current = tilesToVisit.Pop();
// If the current tile position has already been visited,
// or is too far away from the seed, continue
if ((regionSeed - current).Length > regionProperties.MaxRadius)
continue;
if (visitedTiles.Contains(current))
continue;
// Determine the tile's chunk index
var chunkOrigin = SharedMapSystem.GetChunkIndices(current, ChunkSize);
var relative = SharedMapSystem.GetChunkRelative(current, ChunkSize);
var idx = GetTileIndex(relative);
// Extract the tile data
if (!component.Chunks.TryGetValue(chunkOrigin, out var chunk))
continue;
var flag = chunk.TileData[idx];
// If the current tile is entirely occupied, continue
if ((FloorMask & flag) == 0)
continue;
if ((WallMask & flag) == WallMask)
continue;
if ((AirlockMask & flag) == AirlockMask)
continue;
// Otherwise the tile can be added to this region
visitedTiles.Add(current);
visitedChunks.Add(chunkOrigin);
// Determine if we can propagate the region into its cardinally adjacent neighbors
// To propagate to a neighbor, movement into the neighbors closest edge must not be
// blocked, and vice versa
foreach (var (direction, tileOffset, reverseDirection) in _regionPropagationTable)
{
if (!RegionCanPropagateInDirection(chunk, current, direction))
continue;
var neighbor = current + tileOffset;
var neighborOrigin = SharedMapSystem.GetChunkIndices(neighbor, ChunkSize);
if (!component.Chunks.TryGetValue(neighborOrigin, out var neighborChunk))
continue;
visitedChunks.Add(neighborOrigin);
if (!RegionCanPropagateInDirection(neighborChunk, neighbor, reverseDirection))
continue;
tilesToVisit.Push(neighbor);
}
}
}
return (visitedTiles, visitedChunks);
}
private bool RegionCanPropagateInDirection(NavMapChunk chunk, Vector2i tile, AtmosDirection direction)
{
var relative = SharedMapSystem.GetChunkRelative(tile, ChunkSize);
var idx = GetTileIndex(relative);
var flag = chunk.TileData[idx];
if ((FloorMask & flag) == 0)
return false;
var directionMask = 1 << (int)direction;
var wallMask = (int)direction << (int)NavMapChunkType.Wall;
var airlockMask = (int)direction << (int)NavMapChunkType.Airlock;
if ((wallMask & flag) > 0)
return false;
if ((airlockMask & flag) > 0)
return false;
return true;
}
private List<(Vector2i, Vector2i)> GetMergedRegionTiles(HashSet<Vector2i> tiles)
{
if (!tiles.Any())
return new();
var x = tiles.Select(t => t.X);
var minX = x.Min();
var maxX = x.Max();
var y = tiles.Select(t => t.Y);
var minY = y.Min();
var maxY = y.Max();
var matrix = new int[maxX - minX + 1, maxY - minY + 1];
foreach (var tile in tiles)
{
var a = tile.X - minX;
var b = tile.Y - minY;
matrix[a, b] = 1;
}
return GetMergedRegionTiles(matrix, new Vector2i(minX, minY));
}
private List<(Vector2i, Vector2i)> GetMergedRegionTiles(int[,] matrix, Vector2i offset)
{
var output = new List<(Vector2i, Vector2i)>();
var rows = matrix.GetLength(0);
var cols = matrix.GetLength(1);
var dp = new int[rows, cols];
var coords = (new Vector2i(), new Vector2i());
var maxArea = 0;
var count = 0;
while (!IsArrayEmpty(matrix))
{
count++;
if (count > rows * cols)
break;
// Clear old values
dp = new int[rows, cols];
coords = (new Vector2i(), new Vector2i());
maxArea = 0;
// Initialize the first row of dp
for (int j = 0; j < cols; j++)
{
dp[0, j] = matrix[0, j];
}
// Calculate dp values for remaining rows
for (int i = 1; i < rows; i++)
{
for (int j = 0; j < cols; j++)
dp[i, j] = matrix[i, j] == 1 ? dp[i - 1, j] + 1 : 0;
}
// Find the largest rectangular area seeded for each position in the matrix
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
int minWidth = dp[i, j];
for (int k = j; k >= 0; k--)
{
if (dp[i, k] <= 0)
break;
minWidth = Math.Min(minWidth, dp[i, k]);
var currArea = Math.Max(maxArea, minWidth * (j - k + 1));
if (currArea > maxArea)
{
maxArea = currArea;
coords = (new Vector2i(i - minWidth + 1, k), new Vector2i(i, j));
}
}
}
}
// Save the recorded rectangle vertices
output.Add((coords.Item1 + offset, coords.Item2 + offset));
// Removed the tiles covered by the rectangle from matrix
for (int i = coords.Item1.X; i <= coords.Item2.X; i++)
{
for (int j = coords.Item1.Y; j <= coords.Item2.Y; j++)
matrix[i, j] = 0;
}
}
return output;
}
private bool IsArrayEmpty(int[,] matrix)
{
for (int i = 0; i < matrix.GetLength(0); i++)
{
for (int j = 0; j < matrix.GetLength(1); j++)
{
if (matrix[i, j] == 1)
return false;
}
}
return true;
}
}

View File

@@ -1,3 +1,4 @@
using System.Linq;
using Content.Shared.Pinpointer;
using Robust.Shared.GameStates;
@@ -16,6 +17,7 @@ public sealed partial class NavMapSystem : SharedNavMapSystem
{
Dictionary<Vector2i, int[]> modifiedChunks;
Dictionary<NetEntity, NavMapBeacon> beacons;
Dictionary<NetEntity, NavMapRegionProperties> regions;
switch (args.Current)
{
@@ -23,6 +25,8 @@ public sealed partial class NavMapSystem : SharedNavMapSystem
{
modifiedChunks = delta.ModifiedChunks;
beacons = delta.Beacons;
regions = delta.Regions;
foreach (var index in component.Chunks.Keys)
{
if (!delta.AllChunks!.Contains(index))
@@ -35,6 +39,8 @@ public sealed partial class NavMapSystem : SharedNavMapSystem
{
modifiedChunks = state.Chunks;
beacons = state.Beacons;
regions = state.Regions;
foreach (var index in component.Chunks.Keys)
{
if (!state.Chunks.ContainsKey(index))
@@ -47,13 +53,54 @@ public sealed partial class NavMapSystem : SharedNavMapSystem
return;
}
// Update region data and queue new regions for flooding
var prevRegionOwners = component.RegionProperties.Keys.ToList();
var validRegionOwners = new List<NetEntity>();
component.RegionProperties.Clear();
foreach (var (regionOwner, regionData) in regions)
{
if (!regionData.Seeds.Any())
continue;
component.RegionProperties[regionOwner] = regionData;
validRegionOwners.Add(regionOwner);
if (component.RegionOverlays.ContainsKey(regionOwner))
continue;
if (component.QueuedRegionsToFlood.Contains(regionOwner))
continue;
component.QueuedRegionsToFlood.Enqueue(regionOwner);
}
// Remove stale region owners
var regionOwnersToRemove = prevRegionOwners.Except(validRegionOwners);
foreach (var regionOwnerRemoved in regionOwnersToRemove)
RemoveNavMapRegion(uid, component, regionOwnerRemoved);
// Modify chunks
foreach (var (origin, chunk) in modifiedChunks)
{
var newChunk = new NavMapChunk(origin);
Array.Copy(chunk, newChunk.TileData, chunk.Length);
component.Chunks[origin] = newChunk;
// If the affected chunk intersects one or more regions, re-flood them
if (!component.ChunkToRegionOwnerTable.TryGetValue(origin, out var affectedOwners))
continue;
foreach (var affectedOwner in affectedOwners)
{
if (!component.QueuedRegionsToFlood.Contains(affectedOwner))
component.QueuedRegionsToFlood.Enqueue(affectedOwner);
}
}
// Refresh beacons
component.Beacons.Clear();
foreach (var (nuid, beacon) in beacons)
{

View File

@@ -48,6 +48,7 @@ public partial class NavMapControl : MapGridControl
public List<(Vector2, Vector2)> TileLines = new();
public List<(Vector2, Vector2)> TileRects = new();
public List<(Vector2[], Color)> TilePolygons = new();
public List<NavMapRegionOverlay> RegionOverlays = new();
// Default colors
public Color WallColor = new(102, 217, 102);
@@ -228,7 +229,7 @@ public partial class NavMapControl : MapGridControl
{
if (!blip.Selectable)
continue;
var currentDistance = (_transformSystem.ToMapCoordinates(blip.Coordinates).Position - worldPosition).Length();
if (closestDistance < currentDistance || currentDistance * MinimapScale > MaxSelectableDistance)
@@ -319,6 +320,22 @@ public partial class NavMapControl : MapGridControl
}
}
// Draw region overlays
if (_grid != null)
{
foreach (var regionOverlay in RegionOverlays)
{
foreach (var gridCoords in regionOverlay.GridCoords)
{
var positionTopLeft = ScalePosition(new Vector2(gridCoords.Item1.X, -gridCoords.Item1.Y) - new Vector2(offset.X, -offset.Y));
var positionBottomRight = ScalePosition(new Vector2(gridCoords.Item2.X + _grid.TileSize, -gridCoords.Item2.Y - _grid.TileSize) - new Vector2(offset.X, -offset.Y));
var box = new UIBox2(positionTopLeft, positionBottomRight);
handle.DrawRect(box, regionOverlay.Color);
}
}
}
// Draw map lines
if (TileLines.Any())
{

View File

@@ -51,6 +51,8 @@ public sealed class JobRequirementsManager : ISharedPlaytimeManager
{
// Reset on disconnect, just in case.
_roles.Clear();
_jobWhitelists.Clear();
_roleBans.Clear();
}
}
@@ -58,9 +60,6 @@ public sealed class JobRequirementsManager : ISharedPlaytimeManager
{
_sawmill.Debug($"Received roleban info containing {message.Bans.Count} entries.");
if (_roleBans.Equals(message.Bans))
return;
_roleBans.Clear();
_roleBans.AddRange(message.Bans);
Updated?.Invoke();

View File

@@ -1,8 +1,9 @@
using Content.Client.Power.APC.UI;
using Content.Client.Power.APC.UI;
using Content.Shared.Access.Systems;
using Content.Shared.APC;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Shared.Player;
namespace Content.Client.Power.APC
{
@@ -22,6 +23,14 @@ namespace Content.Client.Power.APC
_menu = this.CreateWindow<ApcMenu>();
_menu.SetEntity(Owner);
_menu.OnBreaker += BreakerPressed;
var hasAccess = false;
if (PlayerManager.LocalEntity != null)
{
var accessReader = EntMan.System<AccessReaderSystem>();
hasAccess = accessReader.IsAllowed((EntityUid)PlayerManager.LocalEntity, Owner);
}
_menu?.SetAccessEnabled(hasAccess);
}
protected override void UpdateState(BoundUserInterfaceState state)

View File

@@ -1,4 +1,4 @@
using Robust.Client.AutoGenerated;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Client.GameObjects;
using Robust.Shared.IoC;
@@ -36,19 +36,9 @@ namespace Content.Client.Power.APC.UI
{
var castState = (ApcBoundInterfaceState) state;
if (BreakerButton != null)
if (!BreakerButton.Disabled)
{
if(castState.HasAccess == false)
{
BreakerButton.Disabled = true;
BreakerButton.ToolTip = Loc.GetString("apc-component-insufficient-access");
}
else
{
BreakerButton.Disabled = false;
BreakerButton.ToolTip = null;
BreakerButton.Pressed = castState.MainBreaker;
}
BreakerButton.Pressed = castState.MainBreaker;
}
if (PowerLabel != null)
@@ -86,6 +76,20 @@ namespace Content.Client.Power.APC.UI
}
}
public void SetAccessEnabled(bool hasAccess)
{
if(hasAccess)
{
BreakerButton.Disabled = false;
BreakerButton.ToolTip = null;
}
else
{
BreakerButton.Disabled = true;
BreakerButton.ToolTip = Loc.GetString("apc-component-insufficient-access");
}
}
private void UpdateChargeBarColor(float charge)
{
if (ChargeBar == null)

View File

@@ -100,7 +100,7 @@ namespace Content.Client.Stylesheets
public static readonly Color ButtonColorDefaultRed = Color.FromHex("#D43B3B");
public static readonly Color ButtonColorHovered = Color.FromHex("#7f6357");
public static readonly Color ButtonColorHoveredRed = Color.FromHex("#DF6B6B");
public static readonly Color ButtonColorPressed = Color.FromHex("#6c4a3e");
public static readonly Color ButtonColorPressed = Color.FromHex("#4a332b");
public static readonly Color ButtonColorDisabled = Color.FromHex("#3c3330");
public static readonly Color ButtonColorCautionDefault = Color.FromHex("#ab3232");

View File

@@ -0,0 +1,9 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical"
Margin="8 0 8 0">
<BoxContainer Name="Buttons"
Orientation="Vertical"
SeparationOverride="5">
<!-- Buttons are added here by code -->
</BoxContainer>
</BoxContainer>

View File

@@ -10,20 +10,17 @@ using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
public sealed partial class GhostRolesEntry : BoxContainer
public sealed partial class GhostRoleButtonsBox : BoxContainer
{
private SpriteSystem _spriteSystem;
public event Action<GhostRoleInfo>? OnRoleSelected;
public event Action<GhostRoleInfo>? OnRoleFollow;
public GhostRolesEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem)
public GhostRoleButtonsBox(bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem)
{
RobustXamlLoader.Load(this);
_spriteSystem = spriteSystem;
Title.Text = name;
Description.SetMessage(description);
foreach (var role in roles)
{
var button = new GhostRoleEntryButtons(role);

View File

@@ -1,15 +1,15 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Horizontal">
Orientation="Horizontal"
HorizontalAlignment="Stretch">
<Button Name="RequestButton"
Access="Public"
Text="{Loc 'ghost-roles-window-request-role-button'}"
StyleClasses="OpenRight"
HorizontalAlignment="Left"
SetWidth="300"/>
HorizontalExpand="True"
SizeFlagsStretchRatio="3"/>
<Button Name="FollowButton"
Access="Public"
Text="{Loc 'ghost-roles-window-follow-role-button'}"
StyleClasses="OpenLeft"
HorizontalAlignment="Right"
SetWidth="150"/>
HorizontalExpand="True"/>
</BoxContainer>

View File

@@ -0,0 +1,8 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical">
<Label Name="Title"
StyleClasses="LabelKeyText"/>
<PanelContainer StyleClasses="HighDivider" />
<RichTextLabel Name="Description"
Margin="0 4"/>
</BoxContainer>

View File

@@ -0,0 +1,18 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
public sealed partial class GhostRoleInfoBox : BoxContainer
{
public GhostRoleInfoBox(string name, string description)
{
RobustXamlLoader.Load(this);
Title.Text = name;
Description.SetMessage(description);
}
}
}

View File

@@ -1,16 +0,0 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical"
HorizontalExpand="True"
Margin="0 0 8 8">
<Label Name="Title"
StyleClasses="LabelKeyText"/>
<PanelContainer StyleClasses="HighDivider" />
<RichTextLabel Name="Description"
Margin="0 4"/>
<BoxContainer Name="Buttons"
HorizontalAlignment="Left"
Orientation="Vertical"
SeparationOverride="5">
<!-- Buttons are added here by code -->
</BoxContainer>
</BoxContainer>

View File

@@ -5,7 +5,6 @@ using Content.Shared.Eui;
using Content.Shared.Ghost.Roles;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
@@ -77,6 +76,13 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
if (state is not GhostRolesEuiState ghostState)
return;
// We must save BodyVisible state, so all Collapsible boxes will not close
// on adding new ghost role.
// Save the current state of each Collapsible box being visible or not
_window.SaveCollapsibleBoxesStates();
// Clearing the container before adding new roles
_window.ClearEntries();
var entityManager = IoCManager.Resolve<IEntityManager>();
@@ -84,28 +90,32 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
var spriteSystem = sysManager.GetEntitySystem<SpriteSystem>();
var requirementsManager = IoCManager.Resolve<JobRequirementsManager>();
// TODO: role.Requirements value doesn't work at all as an equality key, this must be fixed
// Grouping roles
var groupedRoles = ghostState.GhostRoles.GroupBy(
role => (role.Name, role.Description, role.Requirements));
// Add a new entry for each role group
foreach (var group in groupedRoles)
{
var name = group.Key.Name;
var description = group.Key.Description;
bool hasAccess = true;
FormattedMessage? reason;
if (!requirementsManager.CheckRoleRequirements(group.Key.Requirements, null, out reason))
{
hasAccess = false;
}
var hasAccess = requirementsManager.CheckRoleRequirements(
group.Key.Requirements,
null,
out var reason);
// Adding a new role
_window.AddEntry(name, description, hasAccess, reason, group, spriteSystem);
}
// Restore the Collapsible box state if it is saved
_window.RestoreCollapsibleBoxesStates();
// Close the rules window if it is no longer needed
var closeRulesWindow = ghostState.GhostRoles.All(role => role.Identifier != _windowRulesId);
if (closeRulesWindow)
{
_windowRules?.Close();
}
}
}
}

View File

@@ -1,7 +1,10 @@
using System.Linq;
using Content.Shared.Ghost.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
@@ -12,20 +15,86 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
public event Action<GhostRoleInfo>? OnRoleRequestButtonClicked;
public event Action<GhostRoleInfo>? OnRoleFollow;
private Dictionary<(string name, string description), Collapsible> _collapsibleBoxes = new();
private HashSet<(string name, string description)> _uncollapsedStates = new();
public GhostRolesWindow()
{
RobustXamlLoader.Load(this);
}
public void ClearEntries()
{
NoRolesMessage.Visible = true;
EntryContainer.DisposeAllChildren();
_collapsibleBoxes.Clear();
}
public void SaveCollapsibleBoxesStates()
{
_uncollapsedStates.Clear();
foreach (var (key, collapsible) in _collapsibleBoxes)
{
if (collapsible.BodyVisible)
{
_uncollapsedStates.Add(key);
}
}
}
public void RestoreCollapsibleBoxesStates()
{
foreach (var (key, collapsible) in _collapsibleBoxes)
{
collapsible.BodyVisible = _uncollapsedStates.Contains(key);
}
}
public void AddEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem)
{
NoRolesMessage.Visible = false;
var entry = new GhostRolesEntry(name, description, hasAccess, reason, roles, spriteSystem);
entry.OnRoleSelected += OnRoleRequestButtonClicked;
entry.OnRoleFollow += OnRoleFollow;
EntryContainer.AddChild(entry);
var ghostRoleInfos = roles.ToList();
var rolesCount = ghostRoleInfos.Count;
var info = new GhostRoleInfoBox(name, description);
var buttons = new GhostRoleButtonsBox(hasAccess, reason, ghostRoleInfos, spriteSystem);
buttons.OnRoleSelected += OnRoleRequestButtonClicked;
buttons.OnRoleFollow += OnRoleFollow;
EntryContainer.AddChild(info);
if (rolesCount > 1)
{
var buttonHeading = new CollapsibleHeading(Loc.GetString("ghost-roles-window-available-button", ("rolesCount", rolesCount)));
buttonHeading.AddStyleClass(ContainerButton.StyleClassButton);
buttonHeading.Label.HorizontalAlignment = HAlignment.Center;
buttonHeading.Label.HorizontalExpand = true;
var body = new CollapsibleBody
{
Margin = new Thickness(0, 5, 0, 0),
};
// TODO: Add Requirements to this key when it'll be fixed and work as an equality key in GhostRolesEui
var key = (name, description);
var collapsible = new Collapsible(buttonHeading, body)
{
Orientation = BoxContainer.LayoutOrientation.Vertical,
Margin = new Thickness(0, 0, 0, 8),
};
body.AddChild(buttons);
EntryContainer.AddChild(collapsible);
_collapsibleBoxes.Add(key, collapsible);
}
else
{
EntryContainer.AddChild(buttons);
}
}
}
}

View File

@@ -2,7 +2,8 @@
xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:co="clr-namespace:Content.Client.UserInterface.Controls">
xmlns:co="clr-namespace:Content.Client.UserInterface.Controls"
MinHeight="210">
<BoxContainer Name="MainContainer" Orientation="Vertical">
<LineEdit Name="SearchBar" PlaceHolder="{Loc 'vending-machine-component-search-filter'}" HorizontalExpand="True" Margin ="4 4"/>
<co:SearchListContainer Name="VendingContents" VerticalExpand="True" Margin="4 4"/>

View File

@@ -1,5 +1,6 @@
using System.Linq;
using System.Numerics;
using Content.Client.Gameplay;
using Content.Client.Stylesheets;
using Content.Shared.Administration;
using Content.Shared.CCVar;
@@ -8,6 +9,7 @@ using Content.Shared.Voting;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.State;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
@@ -28,6 +30,7 @@ namespace Content.Client.Voting.UI
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IEntityNetworkManager _entNetManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IStateManager _state = default!;
private VotingSystem _votingSystem;
@@ -62,7 +65,7 @@ namespace Content.Client.Voting.UI
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;
CloseButton.OnPressed += _ => Close();
VoteNotTrustedLabel.Text = Loc.GetString("ui-vote-trusted-users-notice", ("timeReq", _cfg.GetCVar(CCVars.VotekickEligibleVoterDeathtime) / 60));
VoteNotTrustedLabel.Text = Loc.GetString("ui-vote-trusted-users-notice", ("timeReq", _cfg.GetCVar(CCVars.VotekickEligibleVoterDeathtime)));
foreach (StandardVoteType voteType in Enum.GetValues<StandardVoteType>())
{
@@ -70,6 +73,7 @@ namespace Content.Client.Voting.UI
VoteTypeButton.AddItem(Loc.GetString(option.Name), (int)voteType);
}
_state.OnStateChanged += OnStateChanged;
VoteTypeButton.OnItemSelected += VoteTypeSelected;
CreateButton.OnPressed += CreatePressed;
FollowButton.OnPressed += FollowSelected;
@@ -101,6 +105,14 @@ namespace Content.Client.Voting.UI
UpdateVoteTimeout();
}
private void OnStateChanged(StateChangedEventArgs obj)
{
if (obj.NewState is not GameplayState)
return;
Close();
}
private void CanCallVoteChanged(bool obj)
{
if (!obj)

View File

@@ -19,11 +19,6 @@ public sealed class VotingSystem : EntitySystem
private void OnVotePlayerListResponseEvent(VotePlayerListResponseEvent msg)
{
if (!_ghostSystem.IsGhost)
{
return;
}
VotePlayerListResponse?.Invoke(msg);
}

View File

@@ -28,6 +28,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
[Dependency] private readonly AnimationPlayerSystem _animation = default!;
[Dependency] private readonly InputSystem _inputSystem = default!;
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly MapSystem _map = default!;
private EntityQuery<TransformComponent> _xformQuery;
@@ -109,11 +110,11 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
if (MapManager.TryFindGridAt(mousePos, out var gridUid, out _))
{
coordinates = EntityCoordinates.FromMap(gridUid, mousePos, TransformSystem, EntityManager);
coordinates = TransformSystem.ToCoordinates(gridUid, mousePos);
}
else
{
coordinates = EntityCoordinates.FromMap(MapManager.GetMapEntityId(mousePos.MapId), mousePos, TransformSystem, EntityManager);
coordinates = TransformSystem.ToCoordinates(_map.GetMap(mousePos.MapId), mousePos);
}
// Heavy attack.

View File

@@ -0,0 +1,31 @@
namespace Content.Client._CP14.Localization;
/// <summary>
/// Controls the visual of the sprite, depending on the localization. Useful for drawn lettering
/// </summary>
[RegisterComponent]
public sealed partial class CP14LocalizationVisualsComponent : Component
{
/// <summary>
/// map(map,(lang, state))
/// in yml:
///
/// - type: Sprite
/// layers:
/// - state: stateName0
/// map: ["map1"]
/// - state: stateName0
/// map: ["map2"]
/// - type: CP14LocalizationVisuals
/// mapStates:
/// map1:
/// ru-RU: stateName1
/// en-US: stateName2
/// map2:
/// ru-RU: stateName3
/// en-US: stateName4
///
/// </summary>
[DataField]
public Dictionary<string, Dictionary<string, string>> MapStates;
}

View File

@@ -0,0 +1,29 @@
using Content.Shared.Localizations;
using Robust.Client.GameObjects;
namespace Content.Client._CP14.Localization;
public sealed class CP14LocalizationVisualsSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14LocalizationVisualsComponent, ComponentInit>(OnCompInit);
}
private void OnCompInit(Entity<CP14LocalizationVisualsComponent> visuals, ref ComponentInit args)
{
if (!TryComp<SpriteComponent>(visuals, out var sprite))
return;
foreach (var (map, pDictionary) in visuals.Comp.MapStates)
{
if (!pDictionary.TryGetValue(ContentLocalizationManager.Culture, out var state))
return;
if (sprite.LayerMapTryGet(map, out _))
sprite.LayerSetState(map, state);
}
}
}

View File

@@ -0,0 +1,7 @@
using Content.Shared._CP14.MagicSpell;
namespace Content.Client._CP14.MagicSpell;
public sealed partial class CP14ClientMagicSystem : CP14SharedMagicSystem
{
}

View File

@@ -0,0 +1,17 @@
using Robust.Shared;
using Robust.Shared.Configuration;
namespace Content.Client._CP14.Shitcode;
/// <summary>
/// Эта система - сборник разного мелкого барахла, который слишком мелкий чтобы иметь свои собственные системы. В идеале в будущем разнести по отдельным файлам.
/// </summary>
public sealed class CP14EdSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
public override void Initialize()
{
_cfg.SetCVar(CVars.EntitiesCategoryFilter, "ForkFiltered");
}
}

View File

@@ -0,0 +1,22 @@
<Control xmlns="https://spacestation14.io">
<GridContainer Columns="6">
<TextureRect Name="GoldView"
MinSize="10 10"
Stretch="KeepAspectCentered"/>
<Label Name="GoldText"
Margin="0,0,5,0"/>
<TextureRect Name="SilverView"
MinSize="10 10"
Stretch="KeepAspectCentered"/>
<Label Name="SilverText"
Margin="0,0,5,0"/>
<TextureRect Name="CopperView"
MinSize="10 10"
Stretch="KeepAspectCentered"/>
<Label Name="CopperText"
Margin="0,0,5,0"/>
</GridContainer>
</Control>

View File

@@ -0,0 +1,46 @@
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Client._CP14.TravelingStoreShip;
[GenerateTypedNameReferences]
public sealed partial class CP14PriceControl : Control
{
[Dependency] private readonly IEntityManager _entity = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
private readonly SpriteSystem _sprite;
public CP14PriceControl(int price)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_sprite = _entity.System<SpriteSystem>();
var rsiPath = new ResPath("_CP14/Interface/Misc/coins.rsi");
var total = price;
var gp = total / 100;
total %= 100;
var sp = total / 10;
total %= 10;
var cp = total;
CopperView.Texture = _sprite.Frame0(new SpriteSpecifier.Rsi(rsiPath, "c"));
CopperText.Text = cp.ToString();
SilverView.Texture = _sprite.Frame0(new SpriteSpecifier.Rsi(rsiPath, "s"));
SilverText.Text = sp.ToString();
GoldView.Texture = _sprite.Frame0(new SpriteSpecifier.Rsi(rsiPath, "g"));
GoldText.Text = gp.ToString();
}
}

View File

@@ -0,0 +1,34 @@
using Content.Shared._CP14.Cargo;
using JetBrains.Annotations;
using Robust.Client.UserInterface;
namespace Content.Client._CP14.TravelingStoreShip;
public sealed class CP14StoreBoundUserInterface : BoundUserInterface
{
private CP14StoreWindow? _window;
public CP14StoreBoundUserInterface(EntityUid owner, [NotNull] Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = this.CreateWindow<CP14StoreWindow>();
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
switch (state)
{
case CP14StoreUiState storeState:
_window?.UpdateUI(storeState);
break;
}
}
}

View File

@@ -0,0 +1,15 @@
<Control xmlns="https://spacestation14.io">
<Button Name="ProductButton" Access="Public">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<TextureRect Name="View"
MinSize="48 48"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Stretch="KeepAspectCentered"/>
<RichTextLabel Name="ProductName" VerticalAlignment="Center" Access="Public"/>
<BoxContainer Name="PriceHolder" VerticalAlignment="Center" HorizontalExpand="True" HorizontalAlignment="Right"/>
</BoxContainer>
</BoxContainer>
</Button>
</Control>

View File

@@ -0,0 +1,44 @@
using Content.Shared._CP14.Cargo;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
namespace Content.Client._CP14.TravelingStoreShip;
[GenerateTypedNameReferences]
public sealed partial class CP14StoreProductControl : Control
{
[Dependency] private readonly IEntityManager _entity = default!;
private readonly SpriteSystem _sprite;
public CP14StoreProductControl(CP14StoreUiProductEntry entry)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_sprite = _entity.System<SpriteSystem>();
UpdateName(entry.Name);
UpdateView(entry.Icon);
UpdatePrice(entry.Price);
}
private void UpdatePrice(int price)
{
PriceHolder.RemoveAllChildren();
PriceHolder.AddChild(new CP14PriceControl(price));
}
private void UpdateName(string name)
{
ProductName.Text = $"[bold]{name}[/bold]";
}
private void UpdateView(SpriteSpecifier spriteSpecifier)
{
View.Texture = _sprite.Frame0(spriteSpecifier);
}
}

View File

@@ -0,0 +1,31 @@
<DefaultWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'cp14-store-ui-title'}"
MinSize="800 600"
SetSize="800 600">
<BoxContainer Orientation="Horizontal">
<BoxContainer HorizontalExpand="True" VerticalExpand="True" Orientation="Horizontal">
<!-- Product list (left side UI) -->
<TabContainer SizeFlagsStretchRatio="0.5" Name="Tabs" HorizontalExpand="True" VerticalExpand="True" MinSize="0 200">
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" MinSize="0 200">
<BoxContainer Name="BuyProductsContainer" Orientation="Vertical" HorizontalExpand="True"/>
</ScrollContainer>
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" MinSize="0 200">
<BoxContainer Name="SellProductsContainer" Orientation="Vertical" HorizontalExpand="True"/>
</ScrollContainer>
</TabContainer>
<!-- Station trading data (right side UI) -->
<BoxContainer SizeFlagsStretchRatio="0.5" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="0 0 10 0">
<controls:StripeBack>
<PanelContainer>
<Label Text="{Loc 'cp14-store-ui-order'}" Align="Center" Margin="0 5 0 3"/>
</PanelContainer>
</controls:StripeBack>
<Label Name="TravelTimeLabel" Text="00:00" HorizontalAlignment="Center" HorizontalExpand="True" Margin="0 15 0 0"/>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<RichTextLabel Name="SelectedName" HorizontalExpand="True" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5"/>
<RichTextLabel Name="SelectedDesc" HorizontalExpand="True" VerticalExpand="True" VerticalAlignment="Top" Margin="5"/>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</DefaultWindow>

View File

@@ -0,0 +1,79 @@
using Content.Shared._CP14.Cargo;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing;
namespace Content.Client._CP14.TravelingStoreShip;
[GenerateTypedNameReferences]
public sealed partial class CP14StoreWindow : DefaultWindow
{
[Dependency] private readonly IGameTiming _timing = default!;
private TimeSpan? _nextTravelTime;
private bool _onStation;
public CP14StoreWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
Tabs.SetTabTitle(0, Loc.GetString("cp14-store-ui-tab-buy"));
Tabs.SetTabTitle(1, Loc.GetString("cp14-store-ui-tab-sell"));
}
public void UpdateUI(CP14StoreUiState state)
{
UpdateProducts(state);
_nextTravelTime = state.NextTravelTime;
_onStation = state.OnStation;
}
protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
//Updating time
if (_nextTravelTime is not null)
{
var time = _nextTravelTime.Value - _timing.CurTime;
TravelTimeLabel.Text =
$"{Loc.GetString(_onStation ? "cp14-store-ui-next-travel-out" : "cp14-store-ui-next-travel-in")} {Math.Max(time.Minutes, 0):00}:{Math.Max(time.Seconds, 0):00}";
}
}
private void UpdateProducts(CP14StoreUiState state)
{
BuyProductsContainer.RemoveAllChildren();
SellProductsContainer.RemoveAllChildren();
foreach (var product in state.ProductsBuy)
{
var control = new CP14StoreProductControl(product);
control.ProductButton.OnPressed += _ =>
{
SelectProduct(product);
};
BuyProductsContainer.AddChild(control);
}
foreach (var product in state.ProductsSell)
{
var control = new CP14StoreProductControl(product);
control.ProductButton.OnPressed += _ =>
{
SelectProduct(product);
};
SellProductsContainer.AddChild(control);
}
}
private void SelectProduct(CP14StoreUiProductEntry? entry)
{
SelectedName.Text = entry is null ? string.Empty : $"[bold]{entry.Value.Name}[/bold]";
SelectedDesc.Text = entry is null ? string.Empty : entry.Value.Desc;
}
}

View File

@@ -107,13 +107,41 @@ public sealed partial class TestPair
/// <summary>
/// Retrieve all entity prototypes that have some component.
/// </summary>
public List<EntityPrototype> GetPrototypesWithComponent<T>(
public List<(EntityPrototype, T)> GetPrototypesWithComponent<T>(
HashSet<string>? ignored = null,
bool ignoreAbstract = true,
bool ignoreTestPrototypes = true)
where T : IComponent
{
var id = Server.ResolveDependency<IComponentFactory>().GetComponentName(typeof(T));
var list = new List<(EntityPrototype, T)>();
foreach (var proto in Server.ProtoMan.EnumeratePrototypes<EntityPrototype>())
{
if (ignored != null && ignored.Contains(proto.ID))
continue;
if (ignoreAbstract && proto.Abstract)
continue;
if (ignoreTestPrototypes && IsTestPrototype(proto))
continue;
if (proto.Components.TryGetComponent(id, out var cmp))
list.Add((proto, (T)cmp));
}
return list;
}
/// <summary>
/// Retrieve all entity prototypes that have some component.
/// </summary>
public List<EntityPrototype> GetPrototypesWithComponent(Type type,
HashSet<string>? ignored = null,
bool ignoreAbstract = true,
bool ignoreTestPrototypes = true)
{
var id = Server.ResolveDependency<IComponentFactory>().GetComponentName(type);
var list = new List<EntityPrototype>();
foreach (var proto in Server.ProtoMan.EnumeratePrototypes<EntityPrototype>())
{
@@ -127,7 +155,7 @@ public sealed partial class TestPair
continue;
if (proto.Components.ContainsKey(id))
list.Add(proto);
list.Add((proto));
}
return list;

View File

@@ -15,7 +15,7 @@ namespace Content.IntegrationTests.Tests.GameRules;
// Lets not let that happen again.
[TestFixture]
public sealed class AntagPreferenceTest
{
{/* CP14 disabled
[Test]
public async Task TestLobbyPlayersValid()
{
@@ -72,5 +72,5 @@ public sealed class AntagPreferenceTest
await server.WaitPost(() => server.EntMan.DeleteEntity(uid));
await pair.CleanReturnAsync();
}
}*/
}

View File

@@ -1,4 +1,5 @@
#nullable enable
using System.Collections.Generic;
using System.Linq;
using Content.Server.Body.Components;
using Content.Server.GameTicking;
@@ -120,8 +121,8 @@ public sealed class NukeOpsTest
Assert.That(roleSys.MindHasRole<NukeopsRoleComponent>(mind));
Assert.That(factionSys.IsMember(player, "Syndicate"), Is.True);
Assert.That(factionSys.IsMember(player, "NanoTrasen"), Is.False);
var roles = roleSys.MindGetAllRoles(mind);
var cmdRoles = roles.Where(x => x.Prototype == "NukeopsCommander" && x.Component is NukeopsRoleComponent);
var roles = roleSys.MindGetAllRoleInfo(mind);
var cmdRoles = roles.Where(x => x.Prototype == "NukeopsCommander");
Assert.That(cmdRoles.Count(), Is.EqualTo(1));
// The second dummy player should be a medic
@@ -131,8 +132,8 @@ public sealed class NukeOpsTest
Assert.That(roleSys.MindHasRole<NukeopsRoleComponent>(dummyMind));
Assert.That(factionSys.IsMember(dummyEnts[1], "Syndicate"), Is.True);
Assert.That(factionSys.IsMember(dummyEnts[1], "NanoTrasen"), Is.False);
roles = roleSys.MindGetAllRoles(dummyMind);
cmdRoles = roles.Where(x => x.Prototype == "NukeopsMedic" && x.Component is NukeopsRoleComponent);
roles = roleSys.MindGetAllRoleInfo(dummyMind);
cmdRoles = roles.Where(x => x.Prototype == "NukeopsMedic");
Assert.That(cmdRoles.Count(), Is.EqualTo(1));
// The other two players should have just spawned in as normal.
@@ -141,13 +142,14 @@ public sealed class NukeOpsTest
void CheckDummy(int i)
{
var ent = dummyEnts[i];
var mind = mindSys.GetMind(ent)!.Value;
var mindCrew = mindSys.GetMind(ent)!.Value;
Assert.That(entMan.HasComponent<NukeOperativeComponent>(ent), Is.False);
Assert.That(roleSys.MindIsAntagonist(mind), Is.False);
Assert.That(roleSys.MindHasRole<NukeopsRoleComponent>(mind), Is.False);
Assert.That(roleSys.MindIsAntagonist(mindCrew), Is.False);
Assert.That(roleSys.MindHasRole<NukeopsRoleComponent>(mindCrew), Is.False);
Assert.That(factionSys.IsMember(ent, "Syndicate"), Is.False);
Assert.That(factionSys.IsMember(ent, "NanoTrasen"), Is.True);
Assert.That(roleSys.MindGetAllRoles(mind).Any(x => x.Component is NukeopsRoleComponent), Is.False);
var nukeroles = new List<string>() { "Nukeops", "NukeopsMedic", "NukeopsCommander" };
Assert.That(roleSys.MindGetAllRoleInfo(mindCrew).Any(x => nukeroles.Contains(x.Prototype)), Is.False);
}
// The game rule exists, and all the stations/shuttles/maps are properly initialized
@@ -238,7 +240,8 @@ public sealed class NukeOpsTest
for (var i = 0; i < nukies.Length - 1; i++)
{
entMan.DeleteEntity(nukies[i]);
Assert.That(roundEndSys.IsRoundEndRequested, Is.False,
Assert.That(roundEndSys.IsRoundEndRequested,
Is.False,
$"The round ended, but {nukies.Length - i - 1} nukies are still alive!");
}
// Delete the last nukie and make sure the round ends.

View File

@@ -2,7 +2,6 @@ using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Systems;
using Content.Server.Station.Systems;
using Content.Shared.Preferences;
using Content.Shared.Roles.Jobs;
namespace Content.IntegrationTests.Tests.Internals;
@@ -25,10 +24,7 @@ public sealed class AutoInternalsTests
await server.WaitAssertion(() =>
{
var profile = new HumanoidCharacterProfile();
var dummy = stationSpawning.SpawnPlayerMob(testMap.GridCoords, new JobComponent()
{
Prototype = "TestInternalsDummy"
}, profile, station: null);
var dummy = stationSpawning.SpawnPlayerMob(testMap.GridCoords, "TestInternalsDummy", profile, station: null);
Assert.That(atmos.HasAtmosphere(testMap.Grid), Is.False, "Test map has atmosphere - test needs adjustment!");
Assert.That(internals.AreInternalsWorking(dummy), "Internals did not automatically connect!");

View File

@@ -1,10 +1,8 @@
#nullable enable
using System.Linq;
using Content.Server.Ghost;
using Content.Server.Ghost.Roles;
using Content.Server.Ghost.Roles.Components;
using Content.Server.Mind.Commands;
using Content.Server.Players;
using Content.Server.Roles;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
@@ -18,7 +16,6 @@ using Robust.Server.Console;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
@@ -287,27 +284,27 @@ public sealed partial class MindTests
Assert.Multiple(() =>
{
Assert.That(roleSystem.MindHasRole<TraitorRoleComponent>(mindId), Is.False);
Assert.That(roleSystem.MindHasRole<JobComponent>(mindId), Is.False);
Assert.That(roleSystem.MindHasRole<JobRoleComponent>(mindId), Is.False);
});
var traitorRole = new TraitorRoleComponent();
var traitorRole = "MindRoleTraitor";
roleSystem.MindAddRole(mindId, traitorRole);
Assert.Multiple(() =>
{
Assert.That(roleSystem.MindHasRole<TraitorRoleComponent>(mindId));
Assert.That(roleSystem.MindHasRole<JobComponent>(mindId), Is.False);
Assert.That(roleSystem.MindHasRole<JobRoleComponent>(mindId), Is.False);
});
var jobRole = new JobComponent();
var jobRole = "";
roleSystem.MindAddRole(mindId, jobRole);
roleSystem.MindAddJobRole(mindId, jobPrototype:jobRole);
Assert.Multiple(() =>
{
Assert.That(roleSystem.MindHasRole<TraitorRoleComponent>(mindId));
Assert.That(roleSystem.MindHasRole<JobComponent>(mindId));
Assert.That(roleSystem.MindHasRole<JobRoleComponent>(mindId));
});
roleSystem.MindRemoveRole<TraitorRoleComponent>(mindId);
@@ -315,15 +312,15 @@ public sealed partial class MindTests
Assert.Multiple(() =>
{
Assert.That(roleSystem.MindHasRole<TraitorRoleComponent>(mindId), Is.False);
Assert.That(roleSystem.MindHasRole<JobComponent>(mindId));
Assert.That(roleSystem.MindHasRole<JobRoleComponent>(mindId));
});
roleSystem.MindRemoveRole<JobComponent>(mindId);
roleSystem.MindRemoveRole<JobRoleComponent>(mindId);
Assert.Multiple(() =>
{
Assert.That(roleSystem.MindHasRole<TraitorRoleComponent>(mindId), Is.False);
Assert.That(roleSystem.MindHasRole<JobComponent>(mindId), Is.False);
Assert.That(roleSystem.MindHasRole<JobRoleComponent>(mindId), Is.False);
});
});

View File

@@ -0,0 +1,95 @@
using System.Linq;
using Content.Server.Roles;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Robust.Shared.GameObjects;
using Robust.Shared.Reflection;
namespace Content.IntegrationTests.Tests.Minds;
[TestFixture]
public sealed class RoleTests
{
/// <summary>
/// Check that any prototype with a <see cref="MindRoleComponent"/> is properly configured
/// </summary>
[Test]
public async Task ValidateRolePrototypes()
{
await using var pair = await PoolManager.GetServerClient();
var jobComp = pair.Server.ResolveDependency<IComponentFactory>().GetComponentName(typeof(JobRoleComponent));
Assert.Multiple(() =>
{
foreach (var (proto, comp) in pair.GetPrototypesWithComponent<MindRoleComponent>())
{
Assert.That(comp.AntagPrototype == null || comp.JobPrototype == null, $"Role {proto.ID} has both a job and antag prototype.");
Assert.That(!comp.ExclusiveAntag || comp.Antag, $"Role {proto.ID} is marked as an exclusive antag, despite not being an antag.");
Assert.That(comp.Antag || comp.AntagPrototype == null, $"Role {proto.ID} has an antag prototype, despite not being an antag.");
if (comp.JobPrototype != null)
Assert.That(proto.Components.ContainsKey(jobComp), $"Role {proto.ID} is a job, despite not having a job prototype.");
// It is possible that this is meant to be supported? Though I would assume that it would be for
// admin / prototype uploads, and that pre-defined roles should still check this.
Assert.That(!comp.Antag || comp.AntagPrototype != null , $"Role {proto.ID} is an antag, despite not having a antag prototype.");
}
});
await pair.CleanReturnAsync();
}
/// <summary>
/// Check that any prototype with a <see cref="JobRoleComponent"/> also has a properly configured
/// <see cref="MindRoleComponent"/>
/// </summary>
[Test]
public async Task ValidateJobPrototypes()
{
await using var pair = await PoolManager.GetServerClient();
var mindCompId = pair.Server.ResolveDependency<IComponentFactory>().GetComponentName(typeof(MindRoleComponent));
Assert.Multiple(() =>
{
foreach (var (proto, comp) in pair.GetPrototypesWithComponent<JobRoleComponent>())
{
if (proto.Components.TryGetComponent(mindCompId, out var mindComp))
Assert.That(((MindRoleComponent)mindComp).JobPrototype, Is.Not.Null);
}
});
await pair.CleanReturnAsync();
}
/// <summary>
/// Check that any prototype with a component that inherits from <see cref="BaseMindRoleComponent"/> also has a
/// <see cref="MindRoleComponent"/>
/// </summary>
[Test]
public async Task ValidateRolesHaveMindRoleComp()
{
await using var pair = await PoolManager.GetServerClient();
var refMan = pair.Server.ResolveDependency<IReflectionManager>();
var mindCompId = pair.Server.ResolveDependency<IComponentFactory>().GetComponentName(typeof(MindRoleComponent));
var compTypes = refMan.GetAllChildren(typeof(BaseMindRoleComponent))
.Append(typeof(RoleBriefingComponent))
.Where(x => !x.IsAbstract);
Assert.Multiple(() =>
{
foreach (var comp in compTypes)
{
foreach (var proto in pair.GetPrototypesWithComponent(comp))
{
Assert.That(proto.Components.ContainsKey(mindCompId), $"Role {proto.ID} does not have a {nameof(MindRoleComponent)} despite having a {comp.Name}");
}
}
});
await pair.CleanReturnAsync();
}
}

View File

@@ -50,9 +50,8 @@ namespace Content.IntegrationTests.Tests
"MeteorArena",
//CrystallPunk maps
"AlchemyTest",
"BattleRoyale",
"ExpeditionTest",
"Village",
"Island",
//CrystallPunk Map replacement end
};
@@ -236,7 +235,6 @@ namespace Content.IntegrationTests.Tests
// Test all availableJobs have spawnPoints
// This is done inside gamemap test because loading the map takes ages and we already have it.
/*
var comp = entManager.GetComponent<StationJobsComponent>(station);
var jobs = new HashSet<ProtoId<JobPrototype>>(comp.SetupAvailableJobs.Keys);
@@ -253,7 +251,6 @@ namespace Content.IntegrationTests.Tests
jobs.ExceptWith(spawnPoints);
Assert.That(jobs, Is.Empty, $"There is no spawnpoints for {string.Join(", ", jobs)} on {mapProto}.");
*/ //CP14 disable job spawners test
}
try

View File

@@ -3,7 +3,6 @@ using Content.Server.Station.Systems;
using Content.Shared.Inventory;
using Content.Shared.Preferences;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles.Jobs;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
@@ -68,10 +67,7 @@ public sealed class LoadoutTests
profile.SetLoadout(new RoleLoadout("LoadoutTester"));
var tester = stationSystem.SpawnPlayerMob(testMap.GridCoords, job: new JobComponent()
{
Prototype = "LoadoutTester"
}, profile, station: null);
var tester = stationSystem.SpawnPlayerMob(testMap.GridCoords, job: "LoadoutTester", profile, station: null);
var slotQuery = inventorySystem.GetSlotEnumerator(tester);
var checkedCount = 0;

View File

@@ -35,15 +35,16 @@ public sealed class StartingGearPrototypeStorageTest
{
foreach (var gearProto in protos)
{
var backpackProto = ((IEquipmentLoadout) gearProto).GetGear("back");
if (backpackProto == string.Empty)
continue;
var bag = server.EntMan.SpawnEntity(backpackProto, coords);
var ents = new ValueList<EntityUid>();
foreach (var (slot, entProtos) in gearProto.Storage)
{
ents.Clear();
var storageProto = ((IEquipmentLoadout)gearProto).GetGear(slot);
if (storageProto == string.Empty)
continue;
var bag = server.EntMan.SpawnEntity(storageProto, coords);
if (entProtos.Count == 0)
continue;
@@ -59,9 +60,8 @@ public sealed class StartingGearPrototypeStorageTest
server.EntMan.DeleteEntity(ent);
}
server.EntMan.DeleteEntity(bag);
}
server.EntMan.DeleteEntity(bag);
}
mapManager.DeleteMap(testMap.MapId);

View File

@@ -40,7 +40,7 @@ public sealed class PrototypeSaveTest
await pair.Client.WaitPost(() =>
{
foreach (var proto in pair.GetPrototypesWithComponent<ItemComponent>(Ignored))
foreach (var (proto, _) in pair.GetPrototypesWithComponent<ItemComponent>(Ignored))
{
var dummy = pair.Client.EntMan.Spawn(proto.ID);
pair.Client.EntMan.RunMapInit(dummy, pair.Client.MetaData(dummy));

View File

@@ -94,14 +94,13 @@ namespace Content.IntegrationTests.Tests
await Assert.MultipleAsync(async () =>
{
foreach (var proto in pair.GetPrototypesWithComponent<StorageFillComponent>())
foreach (var (proto, fill) in pair.GetPrototypesWithComponent<StorageFillComponent>())
{
if (proto.HasComponent<EntityStorageComponent>(compFact))
continue;
StorageComponent? storage = null;
ItemComponent? item = null;
StorageFillComponent fill = default!;
var size = 0;
await server.WaitAssertion(() =>
{
@@ -112,7 +111,6 @@ namespace Content.IntegrationTests.Tests
}
proto.TryGetComponent("Item", out item);
fill = (StorageFillComponent) proto.Components[id].Component;
size = GetFillSize(fill, false, protoMan, itemSys);
});
@@ -179,7 +177,7 @@ namespace Content.IntegrationTests.Tests
var itemSys = entMan.System<SharedItemSystem>();
foreach (var proto in pair.GetPrototypesWithComponent<StorageFillComponent>())
foreach (var (proto, fill) in pair.GetPrototypesWithComponent<StorageFillComponent>())
{
if (proto.HasComponent<StorageComponent>(compFact))
continue;
@@ -192,7 +190,6 @@ namespace Content.IntegrationTests.Tests
if (entStorage == null)
return;
var fill = (StorageFillComponent) proto.Components[id].Component;
var size = GetFillSize(fill, true, protoMan, itemSys);
Assert.That(size, Is.LessThanOrEqualTo(entStorage.Capacity),
$"{proto.ID} storage fill is too large.");

View File

@@ -0,0 +1,37 @@
using System.Collections.Generic;
using Content.Shared._CP14.Cargo.Prototype;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests._CP14;
#nullable enable
[TestFixture]
public sealed class CP14CargoTest
{
[Test]
public async Task CheckAllBuyPositionsUniqueCode()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var compFactory = server.ResolveDependency<IComponentFactory>();
var protoManager = server.ResolveDependency<IPrototypeManager>();
await server.WaitAssertion(() =>
{
Assert.Multiple(() =>
{
HashSet<string> existedCodes = new();
foreach (var proto in protoManager.EnumeratePrototypes<CP14StoreBuyPositionPrototype>())
{
Assert.That(!existedCodes.Contains(proto.Code), $"Repeated purchasing code {proto.Code} of the {proto}");
existedCodes.Add(proto.Code);
}
});
});
await pair.CleanReturnAsync();
}
}

View File

@@ -0,0 +1,41 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
namespace Content.IntegrationTests.Tests._CP14;
#nullable enable
[TestFixture]
public sealed class CP14EntityTest
{
[Test]
public async Task CheckAllCP14EntityHasForkFilteredCategory()
{
await using var pair = await PoolManager.GetServerClient();
var server = pair.Server;
var compFactory = server.ResolveDependency<IComponentFactory>();
var protoManager = server.ResolveDependency<IPrototypeManager>();
await server.WaitAssertion(() =>
{
Assert.Multiple(() =>
{
if (!protoManager.TryIndex<EntityCategoryPrototype>("ForkFiltered", out var indexedFilter))
return;
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
{
if (!proto.ID.StartsWith("CP14"))
continue;
if (proto.Abstract || proto.HideSpawnMenu)
continue;
Assert.That(proto.Categories.Contains(indexedFilter), $"CP14 fork proto: {proto} does not marked abstract, or have a HideSpawnMenu or ForkFiltered category");
}
});
});
await pair.CleanReturnAsync();
}
}

View File

@@ -42,7 +42,7 @@ public sealed class CP14RitualTest
foreach (var edge in phase.Edges)
{
Assert.That(edge.Triggers.Count > 0, $"{{proto}} is ritual node, but edge to {edge.Target} has no triggers and cannot be activated.");
Assert.That(edge.Triggers.Count > 0, $"{proto} is ritual node, but edge to {edge.Target} has no triggers and cannot be activated.");
}
}
});

View File

@@ -67,7 +67,7 @@ namespace Content.Server.Access.Systems
if (!TryComp<IdCardComponent>(uid, out var idCard))
return;
var state = new AgentIDCardBoundUserInterfaceState(idCard.FullName ?? "", idCard.JobTitle ?? "", idCard.JobIcon);
var state = new AgentIDCardBoundUserInterfaceState(idCard.FullName ?? "", idCard.LocalizedJobTitle ?? "", idCard.JobIcon);
_uiSystem.SetUiState(uid, AgentIDCardUiKey.Key, state);
}

View File

@@ -96,7 +96,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
PrivilegedIdIsAuthorized(uid, component),
true,
targetIdComponent.FullName,
targetIdComponent.JobTitle,
targetIdComponent.LocalizedJobTitle,
targetAccessComponent.Tags.ToList(),
possibleAccess,
jobProto,

View File

@@ -14,13 +14,13 @@ using Content.Shared.Players.PlayTimeTracking;
using Content.Shared.Roles;
using Robust.Server.Player;
using Robust.Shared.Asynchronous;
using Robust.Shared.Collections;
using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
namespace Content.Server.Administration.Managers;
@@ -45,14 +45,12 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
public const string SawmillId = "admin.bans";
public const string JobPrefix = "Job:";
private readonly Dictionary<NetUserId, HashSet<ServerRoleBanDef>> _cachedRoleBans = new();
private readonly Dictionary<ICommonSession, List<ServerRoleBanDef>> _cachedRoleBans = new();
// Cached ban exemption flags are used to handle
private readonly Dictionary<ICommonSession, ServerBanExemptFlags> _cachedBanExemptions = new();
public void Initialize()
{
_playerManager.PlayerStatusChanged += OnPlayerStatusChanged;
_netManager.RegisterNetMessage<MsgRoleBans>();
_db.SubscribeToNotifications(OnDatabaseNotification);
@@ -63,12 +61,23 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
private async Task CachePlayerData(ICommonSession player, CancellationToken cancel)
{
// Yeah so role ban loading code isn't integrated with exempt flag loading code.
// Have you seen how garbage role ban code code is? I don't feel like refactoring it right now.
var flags = await _db.GetBanExemption(player.UserId, cancel);
var netChannel = player.Channel;
ImmutableArray<byte>? hwId = netChannel.UserData.HWId.Length == 0 ? null : netChannel.UserData.HWId;
var roleBans = await _db.GetServerRoleBansAsync(netChannel.RemoteEndPoint.Address, player.UserId, hwId, false);
var userRoleBans = new List<ServerRoleBanDef>();
foreach (var ban in roleBans)
{
userRoleBans.Add(ban);
}
cancel.ThrowIfCancellationRequested();
_cachedBanExemptions[player] = flags;
_cachedRoleBans[player] = userRoleBans;
SendRoleBans(player);
}
private void ClearPlayerData(ICommonSession player)
@@ -76,25 +85,15 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
_cachedBanExemptions.Remove(player);
}
private async void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
{
if (e.NewStatus != SessionStatus.Connected || _cachedRoleBans.ContainsKey(e.Session.UserId))
return;
var netChannel = e.Session.Channel;
ImmutableArray<byte>? hwId = netChannel.UserData.HWId.Length == 0 ? null : netChannel.UserData.HWId;
await CacheDbRoleBans(e.Session.UserId, netChannel.RemoteEndPoint.Address, hwId);
SendRoleBans(e.Session);
}
private async Task<bool> AddRoleBan(ServerRoleBanDef banDef)
{
banDef = await _db.AddServerRoleBanAsync(banDef);
if (banDef.UserId != null)
if (banDef.UserId != null
&& _playerManager.TryGetSessionById(banDef.UserId, out var player)
&& _cachedRoleBans.TryGetValue(player, out var cachedBans))
{
_cachedRoleBans.GetOrNew(banDef.UserId.Value).Add(banDef);
cachedBans.Add(banDef);
}
return true;
@@ -102,31 +101,21 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
public HashSet<string>? GetRoleBans(NetUserId playerUserId)
{
return _cachedRoleBans.TryGetValue(playerUserId, out var roleBans)
if (!_playerManager.TryGetSessionById(playerUserId, out var session))
return null;
return _cachedRoleBans.TryGetValue(session, out var roleBans)
? roleBans.Select(banDef => banDef.Role).ToHashSet()
: null;
}
private async Task CacheDbRoleBans(NetUserId userId, IPAddress? address = null, ImmutableArray<byte>? hwId = null)
{
var roleBans = await _db.GetServerRoleBansAsync(address, userId, hwId, false);
var userRoleBans = new HashSet<ServerRoleBanDef>();
foreach (var ban in roleBans)
{
userRoleBans.Add(ban);
}
_cachedRoleBans[userId] = userRoleBans;
}
public void Restart()
{
// Clear out players that have disconnected.
var toRemove = new List<NetUserId>();
var toRemove = new ValueList<ICommonSession>();
foreach (var player in _cachedRoleBans.Keys)
{
if (!_playerManager.TryGetSessionById(player, out _))
if (player.Status == SessionStatus.Disconnected)
toRemove.Add(player);
}
@@ -138,7 +127,7 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
// Check for expired bans
foreach (var roleBans in _cachedRoleBans.Values)
{
roleBans.RemoveWhere(ban => DateTimeOffset.Now > ban.ExpirationTime);
roleBans.RemoveAll(ban => DateTimeOffset.Now > ban.ExpirationTime);
}
}
@@ -281,9 +270,9 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
var length = expires == null ? Loc.GetString("cmd-roleban-inf") : Loc.GetString("cmd-roleban-until", ("expires", expires));
_chat.SendAdminAlert(Loc.GetString("cmd-roleban-success", ("target", targetUsername ?? "null"), ("role", role), ("reason", reason), ("length", length)));
if (target != null)
if (target != null && _playerManager.TryGetSessionById(target.Value, out var session))
{
SendRoleBans(target.Value);
SendRoleBans(session);
}
}
@@ -311,10 +300,12 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
await _db.AddServerRoleUnbanAsync(new ServerRoleUnbanDef(banId, unbanningAdmin, DateTimeOffset.Now));
if (ban.UserId is { } player && _cachedRoleBans.TryGetValue(player, out var roleBans))
if (ban.UserId is { } player
&& _playerManager.TryGetSessionById(player, out var session)
&& _cachedRoleBans.TryGetValue(session, out var roleBans))
{
roleBans.RemoveWhere(roleBan => roleBan.Id == ban.Id);
SendRoleBans(player);
roleBans.RemoveAll(roleBan => roleBan.Id == ban.Id);
SendRoleBans(session);
}
return $"Pardoned ban with id {banId}";
@@ -322,8 +313,12 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
public HashSet<ProtoId<JobPrototype>>? GetJobBans(NetUserId playerUserId)
{
if (!_cachedRoleBans.TryGetValue(playerUserId, out var roleBans))
if (!_playerManager.TryGetSessionById(playerUserId, out var session))
return null;
if (!_cachedRoleBans.TryGetValue(session, out var roleBans))
return null;
return roleBans
.Where(ban => ban.Role.StartsWith(JobPrefix, StringComparison.Ordinal))
.Select(ban => new ProtoId<JobPrototype>(ban.Role[JobPrefix.Length..]))
@@ -331,19 +326,9 @@ public sealed partial class BanManager : IBanManager, IPostInjectInit
}
#endregion
public void SendRoleBans(NetUserId userId)
{
if (!_playerManager.TryGetSessionById(userId, out var player))
{
return;
}
SendRoleBans(player);
}
public void SendRoleBans(ICommonSession pSession)
{
var roleBans = _cachedRoleBans.GetValueOrDefault(pSession.UserId) ?? new HashSet<ServerRoleBanDef>();
var roleBans = _cachedRoleBans.GetValueOrDefault(pSession) ?? new List<ServerRoleBanDef>();
var bans = new MsgRoleBans()
{
Bans = roleBans.Select(o => o.Role).ToList()

View File

@@ -47,12 +47,6 @@ public interface IBanManager
/// <param name="unbanTime">The time at which this role ban was pardoned.</param>
public Task<string> PardonRoleBan(int banId, NetUserId? unbanningAdmin, DateTimeOffset unbanTime);
/// <summary>
/// Sends role bans to the target
/// </summary>
/// <param name="pSession">Player's user ID</param>
public void SendRoleBans(NetUserId userId);
/// <summary>
/// Sends role bans to the target
/// </summary>

View File

@@ -1,3 +1,4 @@
using Content.Server._CP14.Roles;
using Content.Server.Administration.Commands;
using Content.Server.Antag;
using Content.Server.GameTicking.Rules.Components;
@@ -52,6 +53,23 @@ public sealed partial class AdminVerbSystem
var targetPlayer = targetActor.PlayerSession;
Verb CP14Sociopath = new()
{
Text = Loc.GetString("cp14-admin-verb-text-make-sociopath"),
Category = VerbCategory.Antag,
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Clothing/Hands/Gloves/Color/black.rsi"),
"icon"), //TODO
Act = () =>
{
//_antag.ForceMakeAntag<CP14BanditRoleComponent>(targetPlayer, "CP14Bandit"); //TODO
},
Impact = LogImpact.High,
Message = Loc.GetString("cp14-admin-verb-make-sociopath"),
};
args.Verbs.Add(CP14Sociopath);
/* CP14 disable default antags
Verb traitor = new()
{
Text = Loc.GetString("admin-verb-text-make-traitor"),
@@ -151,5 +169,6 @@ public sealed partial class AdminVerbSystem
Message = Loc.GetString("admin-verb-make-thief"),
};
args.Verbs.Add(thief);
*/
}
}

View File

@@ -95,9 +95,10 @@ public sealed partial class AdminVerbSystem
if (HasComp<MapComponent>(args.Target) || HasComp<MapGridComponent>(args.Target))
return;
var explodeName = Loc.GetString("admin-smite-explode-name").ToLowerInvariant();
Verb explode = new()
{
Text = "admin-smite-explode-name",
Text = explodeName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/smite.svg.192dpi.png")),
Act = () =>
@@ -111,13 +112,14 @@ public sealed partial class AdminVerbSystem
_bodySystem.GibBody(args.Target);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-explode-description")
Message = string.Join(": ", explodeName, Loc.GetString("admin-smite-explode-description")) // we do this so the description tells admins the Text to run it via console.
};
args.Verbs.Add(explode);
var chessName = Loc.GetString("admin-smite-chess-dimension-name").ToLowerInvariant();
Verb chess = new()
{
Text = "admin-smite-chess-dimension-name",
Text = chessName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Fun/Tabletop/chessboard.rsi"), "chessboard"),
Act = () =>
@@ -137,12 +139,13 @@ public sealed partial class AdminVerbSystem
xform.WorldRotation = Angle.Zero;
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-chess-dimension-description")
Message = string.Join(": ", chessName, Loc.GetString("admin-smite-chess-dimension-description"))
};
args.Verbs.Add(chess);
if (TryComp<FlammableComponent>(args.Target, out var flammable))
{
var flamesName = Loc.GetString("admin-smite-set-alight-name").ToLowerInvariant();
Verb flames = new()
{
Text = "admin-smite-set-alight-name",
@@ -160,14 +163,15 @@ public sealed partial class AdminVerbSystem
Filter.PvsExcept(args.Target), true, PopupType.MediumCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-set-alight-description")
Message = string.Join(": ", flamesName, Loc.GetString("admin-smite-set-alight-description"))
};
args.Verbs.Add(flames);
}
var monkeyName = Loc.GetString("admin-smite-monkeyify-name").ToLowerInvariant();
Verb monkey = new()
{
Text = "admin-smite-monkeyify-name",
Text = monkeyName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Animals/monkey.rsi"), "monkey"),
Act = () =>
@@ -175,13 +179,14 @@ public sealed partial class AdminVerbSystem
_polymorphSystem.PolymorphEntity(args.Target, "AdminMonkeySmite");
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-monkeyify-description")
Message = string.Join(": ", monkeyName, Loc.GetString("admin-smite-monkeyify-description"))
};
args.Verbs.Add(monkey);
var disposalBinName = Loc.GetString("admin-smite-garbage-can-name").ToLowerInvariant();
Verb disposalBin = new()
{
Text = "admin-smite-electrocute-name",
Text = disposalBinName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Structures/Piping/disposal.rsi"), "disposal"),
Act = () =>
@@ -189,16 +194,17 @@ public sealed partial class AdminVerbSystem
_polymorphSystem.PolymorphEntity(args.Target, "AdminDisposalsSmite");
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-garbage-can-description")
Message = string.Join(": ", disposalBinName, Loc.GetString("admin-smite-garbage-can-description"))
};
args.Verbs.Add(disposalBin);
if (TryComp<DamageableComponent>(args.Target, out var damageable) &&
HasComp<MobStateComponent>(args.Target))
{
var hardElectrocuteName = Loc.GetString("admin-smite-electrocute-name").ToLowerInvariant();
Verb hardElectrocute = new()
{
Text = "admin-smite-creampie-name",
Text = hardElectrocuteName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Clothing/Hands/Gloves/Color/yellow.rsi"), "icon"),
Act = () =>
@@ -234,16 +240,17 @@ public sealed partial class AdminVerbSystem
TimeSpan.FromSeconds(30), refresh: true, ignoreInsulation: true);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-electrocute-description")
Message = string.Join(": ", hardElectrocuteName, Loc.GetString("admin-smite-electrocute-description"))
};
args.Verbs.Add(hardElectrocute);
}
if (TryComp<CreamPiedComponent>(args.Target, out var creamPied))
{
var creamPieName = Loc.GetString("admin-smite-creampie-name").ToLowerInvariant();
Verb creamPie = new()
{
Text = "admin-smite-remove-blood-name",
Text = creamPieName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Consumable/Food/Baked/pie.rsi"), "plain-slice"),
Act = () =>
@@ -251,16 +258,17 @@ public sealed partial class AdminVerbSystem
_creamPieSystem.SetCreamPied(args.Target, creamPied, true);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-creampie-description")
Message = string.Join(": ", creamPieName, Loc.GetString("admin-smite-creampie-description"))
};
args.Verbs.Add(creamPie);
}
if (TryComp<BloodstreamComponent>(args.Target, out var bloodstream))
{
var bloodRemovalName = Loc.GetString("admin-smite-remove-blood-name").ToLowerInvariant();
Verb bloodRemoval = new()
{
Text = "admin-smite-vomit-organs-name",
Text = bloodRemovalName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Fluids/tomato_splat.rsi"), "puddle-1"),
Act = () =>
@@ -273,7 +281,7 @@ public sealed partial class AdminVerbSystem
Filter.PvsExcept(args.Target), true, PopupType.MediumCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-remove-blood-description")
Message = string.Join(": ", bloodRemovalName, Loc.GetString("admin-smite-remove-blood-description"))
};
args.Verbs.Add(bloodRemoval);
}
@@ -281,9 +289,10 @@ public sealed partial class AdminVerbSystem
// bobby...
if (TryComp<BodyComponent>(args.Target, out var body))
{
var vomitOrgansName = Loc.GetString("admin-smite-vomit-organs-name").ToLowerInvariant();
Verb vomitOrgans = new()
{
Text = "admin-smite-remove-hands-name",
Text = vomitOrgansName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new("/Textures/Fluids/vomit_toxin.rsi"), "vomit_toxin-1"),
Act = () =>
@@ -305,13 +314,14 @@ public sealed partial class AdminVerbSystem
Filter.PvsExcept(args.Target), true, PopupType.MediumCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-vomit-organs-description")
Message = string.Join(": ", vomitOrgansName, Loc.GetString("admin-smite-vomit-organs-description"))
};
args.Verbs.Add(vomitOrgans);
var handsRemovalName = Loc.GetString("admin-smite-remove-hands-name").ToLowerInvariant();
Verb handsRemoval = new()
{
Text = "admin-smite-remove-hand-name",
Text = handsRemovalName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/remove-hands.png")),
Act = () =>
@@ -327,13 +337,14 @@ public sealed partial class AdminVerbSystem
Filter.PvsExcept(args.Target), true, PopupType.Medium);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-remove-hands-description")
Message = string.Join(": ", handsRemovalName, Loc.GetString("admin-smite-remove-hands-description"))
};
args.Verbs.Add(handsRemoval);
var handRemovalName = Loc.GetString("admin-smite-remove-hand-name").ToLowerInvariant();
Verb handRemoval = new()
{
Text = "admin-smite-pinball-name",
Text = handRemovalName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/remove-hand.png")),
Act = () =>
@@ -350,13 +361,14 @@ public sealed partial class AdminVerbSystem
Filter.PvsExcept(args.Target), true, PopupType.Medium);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-remove-hand-description")
Message = string.Join(": ", handRemovalName, Loc.GetString("admin-smite-remove-hand-description"))
};
args.Verbs.Add(handRemoval);
var stomachRemovalName = Loc.GetString("admin-smite-stomach-removal-name").ToLowerInvariant();
Verb stomachRemoval = new()
{
Text = "admin-smite-yeet-name",
Text = stomachRemovalName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Species/Human/organs.rsi"), "stomach"),
Act = () =>
@@ -370,13 +382,14 @@ public sealed partial class AdminVerbSystem
args.Target, PopupType.LargeCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-stomach-removal-description"),
Message = string.Join(": ", stomachRemovalName, Loc.GetString("admin-smite-stomach-removal-description"))
};
args.Verbs.Add(stomachRemoval);
var lungRemovalName = Loc.GetString("admin-smite-lung-removal-name").ToLowerInvariant();
Verb lungRemoval = new()
{
Text = "admin-smite-become-bread-name",
Text = lungRemovalName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Species/Human/organs.rsi"), "lung-r"),
Act = () =>
@@ -390,16 +403,17 @@ public sealed partial class AdminVerbSystem
args.Target, PopupType.LargeCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-lung-removal-description"),
Message = string.Join(": ", lungRemovalName, Loc.GetString("admin-smite-lung-removal-description"))
};
args.Verbs.Add(lungRemoval);
}
if (TryComp<PhysicsComponent>(args.Target, out var physics))
{
var pinballName = Loc.GetString("admin-smite-pinball-name").ToLowerInvariant();
Verb pinball = new()
{
Text = "admin-smite-ghostkick-name",
Text = pinballName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Fun/toys.rsi"), "basketball"),
Act = () =>
@@ -427,13 +441,14 @@ public sealed partial class AdminVerbSystem
_physics.SetAngularDamping(args.Target, physics, 0f);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-pinball-description")
Message = string.Join(": ", pinballName, Loc.GetString("admin-smite-pinball-description"))
};
args.Verbs.Add(pinball);
var yeetName = Loc.GetString("admin-smite-yeet-name").ToLowerInvariant();
Verb yeet = new()
{
Text = "admin-smite-nyanify-name",
Text = yeetName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/eject.svg.192dpi.png")),
Act = () =>
@@ -457,11 +472,12 @@ public sealed partial class AdminVerbSystem
_physics.SetAngularDamping(args.Target, physics, 0f);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-yeet-description")
Message = string.Join(": ", yeetName, Loc.GetString("admin-smite-yeet-description"))
};
args.Verbs.Add(yeet);
}
var breadName = Loc.GetString("admin-smite-become-bread-name").ToLowerInvariant(); // Will I get cancelled for breadName-ing you?
Verb bread = new()
{
Text = "admin-smite-kill-sign-name",
@@ -472,10 +488,11 @@ public sealed partial class AdminVerbSystem
_polymorphSystem.PolymorphEntity(args.Target, "AdminBreadSmite");
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-become-bread-description")
Message = string.Join(": ", breadName, Loc.GetString("admin-smite-become-bread-description"))
};
args.Verbs.Add(bread);
var mouseName = Loc.GetString("admin-smite-become-mouse-name").ToLowerInvariant();
Verb mouse = new()
{
Text = "admin-smite-cluwne-name",
@@ -486,15 +503,16 @@ public sealed partial class AdminVerbSystem
_polymorphSystem.PolymorphEntity(args.Target, "AdminMouseSmite");
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-become-mouse-description")
Message = string.Join(": ", mouseName, Loc.GetString("admin-smite-become-mouse-description"))
};
args.Verbs.Add(mouse);
if (TryComp<ActorComponent>(args.Target, out var actorComponent))
{
var ghostKickName = Loc.GetString("admin-smite-ghostkick-name").ToLowerInvariant();
Verb ghostKick = new()
{
Text = "admin-smite-anger-pointing-arrows-name",
Text = ghostKickName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/gavel.svg.192dpi.png")),
Act = () =>
@@ -502,15 +520,18 @@ public sealed partial class AdminVerbSystem
_ghostKickManager.DoDisconnect(actorComponent.PlayerSession.Channel, "Smitten.");
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-ghostkick-description")
Message = string.Join(": ", ghostKickName, Loc.GetString("admin-smite-ghostkick-description"))
};
args.Verbs.Add(ghostKick);
}
if (TryComp<InventoryComponent>(args.Target, out var inventory)) {
if (TryComp<InventoryComponent>(args.Target, out var inventory))
{
var nyanifyName = Loc.GetString("admin-smite-nyanify-name").ToLowerInvariant();
Verb nyanify = new()
{
Text = "admin-smite-dust-name",
Text = nyanifyName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Clothing/Head/Hats/catears.rsi"), "icon"),
Act = () =>
@@ -521,13 +542,14 @@ public sealed partial class AdminVerbSystem
_inventorySystem.TryEquip(args.Target, ears, "head", true, true, false, inventory);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-nyanify-description")
Message = string.Join(": ", nyanifyName, Loc.GetString("admin-smite-nyanify-description"))
};
args.Verbs.Add(nyanify);
var killSignName = Loc.GetString("admin-smite-kill-sign-name").ToLowerInvariant();
Verb killSign = new()
{
Text = "admin-smite-buffering-name",
Text = killSignName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Misc/killsign.rsi"), "icon"),
Act = () =>
@@ -535,13 +557,14 @@ public sealed partial class AdminVerbSystem
EnsureComp<KillSignComponent>(args.Target);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-kill-sign-description")
Message = string.Join(": ", killSignName, Loc.GetString("admin-smite-kill-sign-description"))
};
args.Verbs.Add(killSign);
var cluwneName = Loc.GetString("admin-smite-cluwne-name").ToLowerInvariant();
Verb cluwne = new()
{
Text = "admin-smite-become-instrument-name",
Text = cluwneName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Clothing/Mask/cluwne.rsi"), "icon"),
@@ -551,13 +574,14 @@ public sealed partial class AdminVerbSystem
EnsureComp<CluwneComponent>(args.Target);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-cluwne-description")
Message = string.Join(": ", cluwneName, Loc.GetString("admin-smite-cluwne-description"))
};
args.Verbs.Add(cluwne);
var maidenName = Loc.GetString("admin-smite-maid-name").ToLowerInvariant();
Verb maiden = new()
{
Text = "admin-smite-remove-gravity-name",
Text = maidenName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Clothing/Uniforms/Jumpskirt/janimaid.rsi"), "icon"),
Act = () =>
@@ -570,14 +594,15 @@ public sealed partial class AdminVerbSystem
});
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-maid-description")
Message = string.Join(": ", maidenName, Loc.GetString("admin-smite-maid-description"))
};
args.Verbs.Add(maiden);
}
var angerPointingArrowsName = Loc.GetString("admin-smite-anger-pointing-arrows-name").ToLowerInvariant();
Verb angerPointingArrows = new()
{
Text = "admin-smite-reptilian-species-swap-name",
Text = angerPointingArrowsName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Interface/Misc/pointing.rsi"), "pointing"),
Act = () =>
@@ -585,13 +610,14 @@ public sealed partial class AdminVerbSystem
EnsureComp<PointingArrowAngeringComponent>(args.Target);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-anger-pointing-arrows-description")
Message = string.Join(": ", angerPointingArrowsName, Loc.GetString("admin-smite-anger-pointing-arrows-description"))
};
args.Verbs.Add(angerPointingArrows);
var dustName = Loc.GetString("admin-smite-dust-name").ToLowerInvariant();
Verb dust = new()
{
Text = "admin-smite-locker-stuff-name",
Text = dustName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Materials/materials.rsi"), "ash"),
Act = () =>
@@ -601,13 +627,14 @@ public sealed partial class AdminVerbSystem
_popupSystem.PopupEntity(Loc.GetString("admin-smite-turned-ash-other", ("name", args.Target)), args.Target, PopupType.LargeCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-dust-description"),
Message = string.Join(": ", dustName, Loc.GetString("admin-smite-dust-description"))
};
args.Verbs.Add(dust);
var youtubeVideoSimulationName = Loc.GetString("admin-smite-buffering-name").ToLowerInvariant();
Verb youtubeVideoSimulation = new()
{
Text = "admin-smite-headstand-name",
Text = youtubeVideoSimulationName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/Misc/buffering_smite_icon.png")),
Act = () =>
@@ -615,10 +642,11 @@ public sealed partial class AdminVerbSystem
EnsureComp<BufferingComponent>(args.Target);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-buffering-description"),
Message = string.Join(": ", youtubeVideoSimulationName, Loc.GetString("admin-smite-buffering-description"))
};
args.Verbs.Add(youtubeVideoSimulation);
var instrumentationName = Loc.GetString("admin-smite-become-instrument-name").ToLowerInvariant();
Verb instrumentation = new()
{
Text = "admin-smite-become-mouse-name",
@@ -629,13 +657,14 @@ public sealed partial class AdminVerbSystem
_polymorphSystem.PolymorphEntity(args.Target, "AdminInstrumentSmite");
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-become-instrument-description"),
Message = string.Join(": ", instrumentationName, Loc.GetString("admin-smite-become-instrument-description"))
};
args.Verbs.Add(instrumentation);
var noGravityName = Loc.GetString("admin-smite-remove-gravity-name").ToLowerInvariant();
Verb noGravity = new()
{
Text = "admin-smite-maid-name",
Text = noGravityName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new("/Textures/Structures/Machines/gravity_generator.rsi"), "off"),
Act = () =>
@@ -646,13 +675,14 @@ public sealed partial class AdminVerbSystem
Dirty(args.Target, grav);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-remove-gravity-description"),
Message = string.Join(": ", noGravityName, Loc.GetString("admin-smite-remove-gravity-description"))
};
args.Verbs.Add(noGravity);
var reptilianName = Loc.GetString("admin-smite-reptilian-species-swap-name").ToLowerInvariant();
Verb reptilian = new()
{
Text = "admin-smite-zoom-in-name",
Text = reptilianName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Fun/toys.rsi"), "plushie_lizard"),
Act = () =>
@@ -660,13 +690,14 @@ public sealed partial class AdminVerbSystem
_polymorphSystem.PolymorphEntity(args.Target, "AdminLizardSmite");
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-reptilian-species-swap-description"),
Message = string.Join(": ", reptilianName, Loc.GetString("admin-smite-reptilian-species-swap-description"))
};
args.Verbs.Add(reptilian);
var lockerName = Loc.GetString("admin-smite-locker-stuff-name").ToLowerInvariant();
Verb locker = new()
{
Text = "admin-smite-flip-eye-name",
Text = lockerName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("/Textures/Structures/Storage/closet.rsi"), "generic"),
Act = () =>
@@ -682,10 +713,11 @@ public sealed partial class AdminVerbSystem
_weldableSystem.SetWeldedState(locker, true);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-locker-stuff-description"),
Message = string.Join(": ", lockerName, Loc.GetString("admin-smite-locker-stuff-description"))
};
args.Verbs.Add(locker);
var headstandName = Loc.GetString("admin-smite-headstand-name").ToLowerInvariant();
Verb headstand = new()
{
Text = "admin-smite-run-walk-swap-name",
@@ -696,13 +728,14 @@ public sealed partial class AdminVerbSystem
EnsureComp<HeadstandComponent>(args.Target);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-headstand-description"),
Message = string.Join(": ", headstandName, Loc.GetString("admin-smite-headstand-description"))
};
args.Verbs.Add(headstand);
var zoomInName = Loc.GetString("admin-smite-zoom-in-name").ToLowerInvariant();
Verb zoomIn = new()
{
Text = "admin-smite-super-speed-name",
Text = zoomInName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/zoom.png")),
Act = () =>
@@ -711,13 +744,14 @@ public sealed partial class AdminVerbSystem
_eyeSystem.SetZoom(args.Target, eye.TargetZoom * 0.2f, ignoreLimits: true);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-zoom-in-description"),
Message = string.Join(": ", zoomInName, Loc.GetString("admin-smite-zoom-in-description"))
};
args.Verbs.Add(zoomIn);
var flipEyeName = Loc.GetString("admin-smite-flip-eye-name").ToLowerInvariant();
Verb flipEye = new()
{
Text = "admin-smite-stomach-removal-name",
Text = flipEyeName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/flip.png")),
Act = () =>
@@ -726,13 +760,14 @@ public sealed partial class AdminVerbSystem
_eyeSystem.SetZoom(args.Target, eye.TargetZoom * -1, ignoreLimits: true);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-flip-eye-description"),
Message = string.Join(": ", flipEyeName, Loc.GetString("admin-smite-flip-eye-description"))
};
args.Verbs.Add(flipEye);
var runWalkSwapName = Loc.GetString("admin-smite-run-walk-swap-name").ToLowerInvariant();
Verb runWalkSwap = new()
{
Text = "admin-smite-speak-backwards-name",
Text = runWalkSwapName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/run-walk-swap.png")),
Act = () =>
@@ -746,13 +781,14 @@ public sealed partial class AdminVerbSystem
args.Target, PopupType.LargeCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-run-walk-swap-description"),
Message = string.Join(": ", runWalkSwapName, Loc.GetString("admin-smite-run-walk-swap-description"))
};
args.Verbs.Add(runWalkSwap);
var backwardsAccentName = Loc.GetString("admin-smite-speak-backwards-name").ToLowerInvariant();
Verb backwardsAccent = new()
{
Text = "admin-smite-lung-removal-name",
Text = backwardsAccentName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/help-backwards.png")),
Act = () =>
@@ -760,13 +796,14 @@ public sealed partial class AdminVerbSystem
EnsureComp<BackwardsAccentComponent>(args.Target);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-speak-backwards-description"),
Message = string.Join(": ", backwardsAccentName, Loc.GetString("admin-smite-speak-backwards-description"))
};
args.Verbs.Add(backwardsAccent);
var disarmProneName = Loc.GetString("admin-smite-disarm-prone-name").ToLowerInvariant();
Verb disarmProne = new()
{
Text = "admin-smite-disarm-prone-name",
Text = disarmProneName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/Actions/disarm.png")),
Act = () =>
@@ -774,10 +811,11 @@ public sealed partial class AdminVerbSystem
EnsureComp<DisarmProneComponent>(args.Target);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-disarm-prone-description"),
Message = string.Join(": ", disarmProneName, Loc.GetString("admin-smite-disarm-prone-description"))
};
args.Verbs.Add(disarmProne);
var superSpeedName = Loc.GetString("admin-smite-super-speed-name").ToLowerInvariant();
Verb superSpeed = new()
{
Text = "admin-smite-garbage-can-name",
@@ -792,41 +830,45 @@ public sealed partial class AdminVerbSystem
args.Target, PopupType.LargeCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-super-speed-description"),
Message = string.Join(": ", superSpeedName, Loc.GetString("admin-smite-super-speed-description"))
};
args.Verbs.Add(superSpeed);
//Bonk
var superBonkLiteName = Loc.GetString("admin-smite-super-bonk-lite-name").ToLowerInvariant();
Verb superBonkLite = new()
{
Text = "admin-smite-super-bonk-name",
Text = superBonkLiteName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new("Structures/Furniture/Tables/glass.rsi"), "full"),
Act = () =>
{
_superBonkSystem.StartSuperBonk(args.Target, stopWhenDead: true);
},
Message = Loc.GetString("admin-smite-super-bonk-lite-description"),
Impact = LogImpact.Extreme,
Message = string.Join(": ", superBonkLiteName, Loc.GetString("admin-smite-super-bonk-lite-description"))
};
args.Verbs.Add(superBonkLite);
var superBonkName = Loc.GetString("admin-smite-super-bonk-name").ToLowerInvariant();
Verb superBonk= new()
{
Text = "admin-smite-super-bonk-lite-name",
Text = superBonkName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new("Structures/Furniture/Tables/generic.rsi"), "full"),
Act = () =>
{
_superBonkSystem.StartSuperBonk(args.Target);
},
Message = Loc.GetString("admin-smite-super-bonk-description"),
Impact = LogImpact.Extreme,
Message = string.Join(": ", superBonkName, Loc.GetString("admin-smite-super-bonk-description"))
};
args.Verbs.Add(superBonk);
var superslipName = Loc.GetString("admin-smite-super-slip-name").ToLowerInvariant();
Verb superslip = new()
{
Text = "admin-smite-super-slip-name",
Text = superslipName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new("Objects/Specific/Janitorial/soap.rsi"), "omega-4"),
Act = () =>
@@ -846,7 +888,7 @@ public sealed partial class AdminVerbSystem
}
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-super-slip-description")
Message = string.Join(": ", superslipName, Loc.GetString("admin-smite-super-slip-description"))
};
args.Verbs.Add(superslip);
}

View File

@@ -35,8 +35,10 @@ using Robust.Shared.Toolshed;
using Robust.Shared.Utility;
using System.Linq;
using Content.Server.Silicons.Laws;
using Content.Shared.Movement.Components;
using Content.Shared.Silicons.Laws.Components;
using Robust.Server.Player;
using Content.Shared.Silicons.StationAi;
using Robust.Shared.Physics.Components;
using static Content.Shared.Configurable.ConfigurationComponent;
@@ -345,7 +347,30 @@ namespace Content.Server.Administration.Systems
Impact = LogImpact.Low
});
if (TryComp<SiliconLawBoundComponent>(args.Target, out var lawBoundComponent))
// This logic is needed to be able to modify the AI's laws through its core and eye.
EntityUid? target = null;
SiliconLawBoundComponent? lawBoundComponent = null;
if (TryComp(args.Target, out lawBoundComponent))
{
target = args.Target;
}
// When inspecting the core we can find the entity with its laws by looking at the AiHolderComponent.
else if (TryComp<StationAiHolderComponent>(args.Target, out var holder) && holder.Slot.Item != null
&& TryComp(holder.Slot.Item, out lawBoundComponent))
{
target = holder.Slot.Item.Value;
// For the eye we can find the entity with its laws as the source of the movement relay since the eye
// is just a proxy for it to move around and look around the station.
}
else if (TryComp<MovementRelayTargetComponent>(args.Target, out var relay)
&& TryComp(relay.Source, out lawBoundComponent))
{
target = relay.Source;
}
if (lawBoundComponent != null && target != null)
{
args.Verbs.Add(new Verb()
{
@@ -359,7 +384,7 @@ namespace Content.Server.Administration.Systems
return;
}
_euiManager.OpenEui(ui, session);
ui.UpdateLaws(lawBoundComponent, args.Target);
ui.UpdateLaws(lawBoundComponent, target.Value);
},
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Actions/actions_borg.rsi"), "state-laws"),
});

View File

@@ -47,20 +47,23 @@ namespace Content.Server.Administration.Systems
[GeneratedRegex(@"^https://discord\.com/api/webhooks/(\d+)/((?!.*/).*)$")]
private static partial Regex DiscordRegex();
private ISawmill _sawmill = default!;
private readonly HttpClient _httpClient = new();
private string _webhookUrl = string.Empty;
private WebhookData? _webhookData;
private string _onCallUrl = string.Empty;
private WebhookData? _onCallData;
private ISawmill _sawmill = default!;
private readonly HttpClient _httpClient = new();
private string _footerIconUrl = string.Empty;
private string _avatarUrl = string.Empty;
private string _serverName = string.Empty;
private readonly
Dictionary<NetUserId, (string? id, string username, string description, string? characterName, GameRunLevel
lastRunLevel)> _relayMessages = new();
private readonly Dictionary<NetUserId, DiscordRelayInteraction> _relayMessages = new();
private Dictionary<NetUserId, string> _oldMessageIds = new();
private readonly Dictionary<NetUserId, Queue<string>> _messageQueues = new();
private readonly Dictionary<NetUserId, Queue<DiscordRelayedData>> _messageQueues = new();
private readonly HashSet<NetUserId> _processingChannels = new();
private readonly Dictionary<NetUserId, (TimeSpan Timestamp, bool Typing)> _typingUpdateTimestamps = new();
private string _overrideClientName = string.Empty;
@@ -82,12 +85,16 @@ namespace Content.Server.Administration.Systems
public override void Initialize()
{
base.Initialize();
Subs.CVar(_config, CCVars.DiscordOnCallWebhook, OnCallChanged, true);
Subs.CVar(_config, CCVars.DiscordAHelpWebhook, OnWebhookChanged, true);
Subs.CVar(_config, CCVars.DiscordAHelpFooterIcon, OnFooterIconChanged, true);
Subs.CVar(_config, CCVars.DiscordAHelpAvatar, OnAvatarChanged, true);
Subs.CVar(_config, CVars.GameHostName, OnServerNameChanged, true);
Subs.CVar(_config, CCVars.AdminAhelpOverrideClientName, OnOverrideChanged, true);
_sawmill = IoCManager.Resolve<ILogManager>().GetSawmill("AHELP");
var defaultParams = new AHelpMessageParams(
string.Empty,
string.Empty,
@@ -96,7 +103,7 @@ namespace Content.Server.Administration.Systems
_gameTicker.RunLevel,
playedSound: false
);
_maxAdditionalChars = GenerateAHelpMessage(defaultParams).Length;
_maxAdditionalChars = GenerateAHelpMessage(defaultParams).Message.Length;
_playerManager.PlayerStatusChanged += OnPlayerStatusChanged;
SubscribeLocalEvent<GameRunLevelChangedEvent>(OnGameRunLevelChanged);
@@ -111,6 +118,33 @@ namespace Content.Server.Administration.Systems
);
}
private async void OnCallChanged(string url)
{
_onCallUrl = url;
if (url == string.Empty)
return;
var match = DiscordRegex().Match(url);
if (!match.Success)
{
Log.Error("On call URL does not appear to be valid.");
return;
}
if (match.Groups.Count <= 2)
{
Log.Error("Could not get webhook ID or token for on call URL.");
return;
}
var webhookId = match.Groups[1].Value;
var webhookToken = match.Groups[2].Value;
_onCallData = await GetWebhookData(webhookId, webhookToken);
}
private void PlayerRateLimitedAction(ICommonSession obj)
{
RaiseNetworkEvent(
@@ -259,13 +293,13 @@ namespace Content.Server.Administration.Systems
// Store the Discord message IDs of the previous round
_oldMessageIds = new Dictionary<NetUserId, string>();
foreach (var message in _relayMessages)
foreach (var (user, interaction) in _relayMessages)
{
var id = message.Value.id;
var id = interaction.Id;
if (id == null)
return;
_oldMessageIds[message.Key] = id;
_oldMessageIds[user] = id;
}
_relayMessages.Clear();
@@ -330,10 +364,10 @@ namespace Content.Server.Administration.Systems
var webhookToken = match.Groups[2].Value;
// Fire and forget
await SetWebhookData(webhookId, webhookToken);
_webhookData = await GetWebhookData(webhookId, webhookToken);
}
private async Task SetWebhookData(string id, string token)
private async Task<WebhookData?> GetWebhookData(string id, string token)
{
var response = await _httpClient.GetAsync($"https://discord.com/api/v10/webhooks/{id}/{token}");
@@ -342,10 +376,10 @@ namespace Content.Server.Administration.Systems
{
_sawmill.Log(LogLevel.Error,
$"Discord returned bad status code when trying to get webhook data (perhaps the webhook URL is invalid?): {response.StatusCode}\nResponse: {content}");
return;
return null;
}
_webhookData = JsonSerializer.Deserialize<WebhookData>(content);
return JsonSerializer.Deserialize<WebhookData>(content);
}
private void OnFooterIconChanged(string url)
@@ -358,14 +392,14 @@ namespace Content.Server.Administration.Systems
_avatarUrl = url;
}
private async void ProcessQueue(NetUserId userId, Queue<string> messages)
private async void ProcessQueue(NetUserId userId, Queue<DiscordRelayedData> messages)
{
// Whether an embed already exists for this player
var exists = _relayMessages.TryGetValue(userId, out var existingEmbed);
// Whether the message will become too long after adding these new messages
var tooLong = exists && messages.Sum(msg => Math.Min(msg.Length, MessageLengthCap) + "\n".Length)
+ existingEmbed.description.Length > DescriptionMax;
var tooLong = exists && messages.Sum(msg => Math.Min(msg.Message.Length, MessageLengthCap) + "\n".Length)
+ existingEmbed?.Description.Length > DescriptionMax;
// If there is no existing embed, or it is getting too long, we create a new embed
if (!exists || tooLong)
@@ -385,10 +419,10 @@ namespace Content.Server.Administration.Systems
// If we have all the data required, we can link to the embed of the previous round or embed that was too long
if (_webhookData is { GuildId: { } guildId, ChannelId: { } channelId })
{
if (tooLong && existingEmbed.id != null)
if (tooLong && existingEmbed?.Id != null)
{
linkToPrevious =
$"**[Go to previous embed of this round](https://discord.com/channels/{guildId}/{channelId}/{existingEmbed.id})**\n";
$"**[Go to previous embed of this round](https://discord.com/channels/{guildId}/{channelId}/{existingEmbed.Id})**\n";
}
else if (_oldMessageIds.TryGetValue(userId, out var id) && !string.IsNullOrEmpty(id))
{
@@ -398,13 +432,22 @@ namespace Content.Server.Administration.Systems
}
var characterName = _minds.GetCharacterName(userId);
existingEmbed = (null, lookup.Username, linkToPrevious, characterName, _gameTicker.RunLevel);
existingEmbed = new DiscordRelayInteraction()
{
Id = null,
CharacterName = characterName,
Description = linkToPrevious,
Username = lookup.Username,
LastRunLevel = _gameTicker.RunLevel,
};
_relayMessages[userId] = existingEmbed;
}
// Previous message was in another RunLevel, so show that in the embed
if (existingEmbed.lastRunLevel != _gameTicker.RunLevel)
if (existingEmbed!.LastRunLevel != _gameTicker.RunLevel)
{
existingEmbed.description += _gameTicker.RunLevel switch
existingEmbed.Description += _gameTicker.RunLevel switch
{
GameRunLevel.PreRoundLobby => "\n\n:arrow_forward: _**Pre-round lobby started**_\n",
GameRunLevel.InRound => "\n\n:arrow_forward: _**Round started**_\n",
@@ -413,26 +456,35 @@ namespace Content.Server.Administration.Systems
$"{_gameTicker.RunLevel} was not matched."),
};
existingEmbed.lastRunLevel = _gameTicker.RunLevel;
existingEmbed.LastRunLevel = _gameTicker.RunLevel;
}
// If last message of the new batch is SOS then relay it to on-call.
// ... as long as it hasn't been relayed already.
var discordMention = messages.Last();
var onCallRelay = !discordMention.Receivers && !existingEmbed.OnCall;
// Add available messages to the embed description
while (messages.TryDequeue(out var message))
{
// In case someone thinks they're funny
if (message.Length > MessageLengthCap)
message = message[..(MessageLengthCap - TooLongText.Length)] + TooLongText;
string text;
existingEmbed.description += $"\n{message}";
// In case someone thinks they're funny
if (message.Message.Length > MessageLengthCap)
text = message.Message[..(MessageLengthCap - TooLongText.Length)] + TooLongText;
else
text = message.Message;
existingEmbed.Description += $"\n{text}";
}
var payload = GeneratePayload(existingEmbed.description,
existingEmbed.username,
existingEmbed.characterName);
var payload = GeneratePayload(existingEmbed.Description,
existingEmbed.Username,
existingEmbed.CharacterName);
// If there is no existing embed, create a new one
// Otherwise patch (edit) it
if (existingEmbed.id == null)
if (existingEmbed.Id == null)
{
var request = await _httpClient.PostAsync($"{_webhookUrl}?wait=true",
new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json"));
@@ -455,11 +507,11 @@ namespace Content.Server.Administration.Systems
return;
}
existingEmbed.id = id.ToString();
existingEmbed.Id = id.ToString();
}
else
{
var request = await _httpClient.PatchAsync($"{_webhookUrl}/messages/{existingEmbed.id}",
var request = await _httpClient.PatchAsync($"{_webhookUrl}/messages/{existingEmbed.Id}",
new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json"));
if (!request.IsSuccessStatusCode)
@@ -474,6 +526,43 @@ namespace Content.Server.Administration.Systems
_relayMessages[userId] = existingEmbed;
// Actually do the on call relay last, we just need to grab it before we dequeue every message above.
if (onCallRelay &&
_onCallData != null)
{
existingEmbed.OnCall = true;
var roleMention = _config.GetCVar(CCVars.DiscordAhelpMention);
if (!string.IsNullOrEmpty(roleMention))
{
var message = new StringBuilder();
message.AppendLine($"<@&{roleMention}>");
message.AppendLine("Unanswered SOS");
// Need webhook data to get the correct link for that channel rather than on-call data.
if (_webhookData is { GuildId: { } guildId, ChannelId: { } channelId })
{
message.AppendLine(
$"**[Go to ahelp](https://discord.com/channels/{guildId}/{channelId}/{existingEmbed.Id})**");
}
payload = GeneratePayload(message.ToString(), existingEmbed.Username, existingEmbed.CharacterName);
var request = await _httpClient.PostAsync($"{_onCallUrl}?wait=true",
new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json"));
var content = await request.Content.ReadAsStringAsync();
if (!request.IsSuccessStatusCode)
{
_sawmill.Log(LogLevel.Error, $"Discord returned bad status code when posting relay message (perhaps the message is too long?): {request.StatusCode}\nResponse: {content}");
}
}
}
else
{
existingEmbed.OnCall = false;
}
_processingChannels.Remove(userId);
}
@@ -652,7 +741,7 @@ namespace Content.Server.Administration.Systems
if (sendsWebhook)
{
if (!_messageQueues.ContainsKey(msg.UserId))
_messageQueues[msg.UserId] = new Queue<string>();
_messageQueues[msg.UserId] = new Queue<DiscordRelayedData>();
var str = message.Text;
var unameLength = senderSession.Name.Length;
@@ -701,7 +790,7 @@ namespace Content.Server.Administration.Systems
.ToList();
}
private static string GenerateAHelpMessage(AHelpMessageParams parameters)
private static DiscordRelayedData GenerateAHelpMessage(AHelpMessageParams parameters)
{
var stringbuilder = new StringBuilder();
@@ -718,13 +807,57 @@ namespace Content.Server.Administration.Systems
stringbuilder.Append($" **{parameters.RoundTime}**");
if (!parameters.PlayedSound)
stringbuilder.Append(" **(S)**");
if (parameters.Icon == null)
stringbuilder.Append($" **{parameters.Username}:** ");
else
stringbuilder.Append($" **{parameters.Username}** ");
stringbuilder.Append(parameters.Message);
return stringbuilder.ToString();
return new DiscordRelayedData()
{
Receivers = !parameters.NoReceivers,
Message = stringbuilder.ToString(),
};
}
private record struct DiscordRelayedData
{
/// <summary>
/// Was anyone online to receive it.
/// </summary>
public bool Receivers;
/// <summary>
/// What's the payload to send to discord.
/// </summary>
public string Message;
}
/// <summary>
/// Class specifically for holding information regarding existing Discord embeds
/// </summary>
private sealed class DiscordRelayInteraction
{
public string? Id;
public string Username = String.Empty;
public string? CharacterName;
/// <summary>
/// Contents for the discord message.
/// </summary>
public string Description = string.Empty;
/// <summary>
/// Run level of the last interaction. If different we'll link to the last Id.
/// </summary>
public GameRunLevel LastRunLevel;
/// <summary>
/// Did we relay this interaction to OnCall previously.
/// </summary>
public bool OnCall;
}
}

View File

@@ -55,7 +55,7 @@ public sealed partial class AmeControllerComponent : SharedAmeControllerComponen
/// </summary>
[DataField("injectSound")]
[ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier InjectSound = new SoundCollectionSpecifier("MetalThud");
public SoundSpecifier InjectSound = new SoundPathSpecifier("/Audio/Machines/ame_fuelinjection.ogg");
/// <summary>
/// The last time this could have injected fuel into the AME.

View File

@@ -22,11 +22,17 @@ public sealed class TechAnomalySystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<TechAnomalyComponent, MapInitEvent>(OnTechMapInit);
SubscribeLocalEvent<TechAnomalyComponent, AnomalyPulseEvent>(OnPulse);
SubscribeLocalEvent<TechAnomalyComponent, AnomalySupercriticalEvent>(OnSupercritical);
SubscribeLocalEvent<TechAnomalyComponent, AnomalyStabilityChangedEvent>(OnStabilityChanged);
}
private void OnTechMapInit(Entity<TechAnomalyComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextTimer = _timing.CurTime;
}
public override void Update(float frameTime)
{
base.Update(frameTime);

View File

@@ -11,7 +11,6 @@ using Content.Server.Preferences.Managers;
using Content.Server.Roles;
using Content.Server.Roles.Jobs;
using Content.Server.Shuttles.Components;
using Content.Server.Station.Systems;
using Content.Shared.Antag;
using Content.Shared.Clothing;
using Content.Shared.GameTicking;
@@ -20,7 +19,6 @@ using Content.Shared.Ghost;
using Content.Shared.Humanoid;
using Content.Shared.Mind;
using Content.Shared.Players;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles;
using Content.Shared.Whitelist;
using Robust.Server.Audio;
@@ -37,14 +35,14 @@ namespace Content.Server.Antag;
public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelectionComponent>
{
[Dependency] private readonly IChatManager _chat = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IServerPreferencesManager _pref = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly IChatManager _chat = default!;
[Dependency] private readonly GhostRoleSystem _ghostRole = default!;
[Dependency] private readonly JobSystem _jobs = default!;
[Dependency] private readonly LoadoutSystem _loadout = default!;
[Dependency] private readonly MindSystem _mind = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IServerPreferencesManager _pref = default!;
[Dependency] private readonly RoleSystem _role = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
@@ -193,6 +191,9 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
/// <summary>
/// Chooses antagonists from the given selection of players
/// </summary>
/// <param name="ent">The antagonist rule entity</param>
/// <param name="pool">The players to choose from</param>
/// <param name="midround">Disable picking players for pre-spawn antags in the middle of a round</param>
public void ChooseAntags(Entity<AntagSelectionComponent> ent, IList<ICommonSession> pool, bool midround = false)
{
if (ent.Comp.SelectionsComplete)
@@ -209,8 +210,14 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
/// <summary>
/// Chooses antagonists from the given selection of players for the given antag definition.
/// </summary>
/// <param name="ent">The antagonist rule entity</param>
/// <param name="pool">The players to choose from</param>
/// <param name="def">The antagonist selection parameters and criteria</param>
/// <param name="midround">Disable picking players for pre-spawn antags in the middle of a round</param>
public void ChooseAntags(Entity<AntagSelectionComponent> ent, IList<ICommonSession> pool, AntagSelectionDefinition def, bool midround = false)
public void ChooseAntags(Entity<AntagSelectionComponent> ent,
IList<ICommonSession> pool,
AntagSelectionDefinition def,
bool midround = false)
{
var playerPool = GetPlayerPool(ent, pool, def);
var count = GetTargetAntagCount(ent, GetTotalPlayerCount(pool), def);
@@ -331,7 +338,7 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
EntityManager.AddComponents(player, def.Components);
// Equip the entity's RoleLoadout and LoadoutGroup
List<ProtoId<StartingGearPrototype>>? gear = new();
List<ProtoId<StartingGearPrototype>> gear = new();
if (def.StartingGear is not null)
gear.Add(def.StartingGear.Value);
@@ -340,8 +347,8 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
if (session != null)
{
var curMind = session.GetMind();
if (curMind == null ||
if (curMind == null ||
!TryComp<MindComponent>(curMind.Value, out var mindComp) ||
mindComp.OwnedEntity != antagEnt)
{
@@ -350,7 +357,7 @@ public sealed partial class AntagSelectionSystem : GameRuleSystem<AntagSelection
}
_mind.TransferTo(curMind.Value, antagEnt, ghostCheckOverride: true);
_role.MindAddRoles(curMind.Value, def.MindComponents, null, true);
_role.MindAddRoles(curMind.Value, def.MindRoles, null, true);
ent.Comp.SelectedMinds.Add((curMind.Value, Name(player)));
SendBriefing(session, def.Briefing);
}

View File

@@ -3,7 +3,6 @@ using Content.Shared.Antag;
using Content.Shared.Destructible.Thresholds;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles;
using Content.Shared.Storage;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.Player;
@@ -145,10 +144,17 @@ public partial struct AntagSelectionDefinition()
/// <summary>
/// Components added to the player's mind.
/// Do NOT use this to add role-type components. Add those as MindRoles instead
/// </summary>
[DataField]
public ComponentRegistry MindComponents = new();
/// <summary>
/// List of Mind Role Prototypes to be added to the player's mind.
/// </summary>
[DataField]
public List<ProtoId<EntityPrototype>>? MindRoles;
/// <summary>
/// A set of starting gear that's equipped to the player.
/// </summary>

View File

@@ -1,9 +1,11 @@
using Robust.Shared.Prototypes;
namespace Content.Server.Atmos.Components
{
/// <summary>
/// Used by FixGridAtmos. Entities with this may get magically auto-deleted on map initialization in future.
/// </summary>
[RegisterComponent]
[RegisterComponent, EntityCategory("Mapping")]
public sealed partial class AtmosFixMarkerComponent : Component
{
// See FixGridAtmos for more details

View File

@@ -1,15 +1,19 @@
using Content.Server.Atmos.Monitor.Components;
using Content.Server.DeviceNetwork.Components;
using Content.Server.DeviceNetwork.Systems;
using Content.Server.Pinpointer;
using Content.Server.Power.Components;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Components;
using Content.Shared.Atmos.Consoles;
using Content.Shared.Atmos.Monitor;
using Content.Shared.Atmos.Monitor.Components;
using Content.Shared.DeviceNetwork.Components;
using Content.Shared.Pinpointer;
using Content.Shared.Tag;
using Robust.Server.GameObjects;
using Robust.Shared.Map.Components;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
@@ -21,6 +25,12 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
[Dependency] private readonly AirAlarmSystem _airAlarmSystem = default!;
[Dependency] private readonly AtmosDeviceNetworkSystem _atmosDevNet = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly NavMapSystem _navMapSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly DeviceListSystem _deviceListSystem = default!;
private const float UpdateTime = 1.0f;
@@ -38,6 +48,9 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
// Grid events
SubscribeLocalEvent<GridSplitEvent>(OnGridSplit);
// Alarm events
SubscribeLocalEvent<AtmosAlertsDeviceComponent, EntityTerminatingEvent>(OnDeviceTerminatingEvent);
SubscribeLocalEvent<AtmosAlertsDeviceComponent, AnchorStateChangedEvent>(OnDeviceAnchorChanged);
}
@@ -81,6 +94,16 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
}
private void OnDeviceAnchorChanged(EntityUid uid, AtmosAlertsDeviceComponent component, AnchorStateChangedEvent args)
{
OnDeviceAdditionOrRemoval(uid, component, args.Anchored);
}
private void OnDeviceTerminatingEvent(EntityUid uid, AtmosAlertsDeviceComponent component, ref EntityTerminatingEvent args)
{
OnDeviceAdditionOrRemoval(uid, component, false);
}
private void OnDeviceAdditionOrRemoval(EntityUid uid, AtmosAlertsDeviceComponent component, bool isAdding)
{
var xform = Transform(uid);
var gridUid = xform.GridUid;
@@ -88,10 +111,13 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
if (gridUid == null)
return;
if (!TryGetAtmosDeviceNavMapData(uid, component, xform, gridUid.Value, out var data))
if (!TryComp<NavMapComponent>(xform.GridUid, out var navMap))
return;
var netEntity = EntityManager.GetNetEntity(uid);
if (!TryGetAtmosDeviceNavMapData(uid, component, xform, out var data))
return;
var netEntity = GetNetEntity(uid);
var query = AllEntityQuery<AtmosAlertsComputerComponent, TransformComponent>();
while (query.MoveNext(out var ent, out var entConsole, out var entXform))
@@ -99,11 +125,18 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
if (gridUid != entXform.GridUid)
continue;
if (args.Anchored)
if (isAdding)
{
entConsole.AtmosDevices.Add(data.Value);
}
else if (!args.Anchored)
else
{
entConsole.AtmosDevices.RemoveWhere(x => x.NetEntity == netEntity);
_navMapSystem.RemoveNavMapRegion(gridUid.Value, navMap, netEntity);
}
Dirty(ent, entConsole);
}
}
@@ -209,6 +242,12 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
if (entDevice.Group != group)
continue;
if (!TryComp<MapGridComponent>(entXform.GridUid, out var mapGrid))
continue;
if (!TryComp<NavMapComponent>(entXform.GridUid, out var navMap))
continue;
// If emagged, change the alarm type to normal
var alarmState = (entAtmosAlarmable.LastAlarmState == AtmosAlarmType.Emagged) ? AtmosAlarmType.Normal : entAtmosAlarmable.LastAlarmState;
@@ -216,14 +255,45 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
if (TryComp<ApcPowerReceiverComponent>(ent, out var entAPCPower) && !entAPCPower.Powered)
alarmState = AtmosAlarmType.Invalid;
// Create entry
var netEnt = GetNetEntity(ent);
var entry = new AtmosAlertsComputerEntry
(GetNetEntity(ent),
(netEnt,
GetNetCoordinates(entXform.Coordinates),
entDevice.Group,
alarmState,
MetaData(ent).EntityName,
entDeviceNetwork.Address);
// Get the list of sensors attached to the alarm
var sensorList = TryComp<DeviceListComponent>(ent, out var entDeviceList) ? _deviceListSystem.GetDeviceList(ent, entDeviceList) : null;
if (sensorList?.Any() == true)
{
var alarmRegionSeeds = new HashSet<Vector2i>();
// If valid and anchored, use the position of sensors as seeds for the region
foreach (var (address, sensorEnt) in sensorList)
{
if (!sensorEnt.IsValid() || !HasComp<AtmosMonitorComponent>(sensorEnt))
continue;
var sensorXform = Transform(sensorEnt);
if (sensorXform.Anchored && sensorXform.GridUid == entXform.GridUid)
alarmRegionSeeds.Add(_mapSystem.CoordinatesToTile(entXform.GridUid.Value, mapGrid, _transformSystem.GetMapCoordinates(sensorEnt, sensorXform)));
}
var regionProperties = new SharedNavMapSystem.NavMapRegionProperties(netEnt, AtmosAlertsComputerUiKey.Key, alarmRegionSeeds);
_navMapSystem.AddOrUpdateNavMapRegion(gridUid, navMap, netEnt, regionProperties);
}
else
{
_navMapSystem.RemoveNavMapRegion(entXform.GridUid.Value, navMap, netEnt);
}
alarmStateData.Add(entry);
}
@@ -306,7 +376,10 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
var query = AllEntityQuery<AtmosAlertsDeviceComponent, TransformComponent>();
while (query.MoveNext(out var ent, out var entComponent, out var entXform))
{
if (TryGetAtmosDeviceNavMapData(ent, entComponent, entXform, gridUid, out var data))
if (entXform.GridUid != gridUid)
continue;
if (TryGetAtmosDeviceNavMapData(ent, entComponent, entXform, out var data))
atmosDeviceNavMapData.Add(data.Value);
}
@@ -317,14 +390,10 @@ public sealed class AtmosAlertsComputerSystem : SharedAtmosAlertsComputerSystem
(EntityUid uid,
AtmosAlertsDeviceComponent component,
TransformComponent xform,
EntityUid gridUid,
[NotNullWhen(true)] out AtmosAlertsDeviceNavMapData? output)
{
output = null;
if (xform.GridUid != gridUid)
return false;
if (!xform.Anchored)
return false;

View File

@@ -239,7 +239,7 @@ public sealed class CryostorageSystem : SharedCryostorageSystem
Loc.GetString(
"earlyleave-cryo-announcement",
("character", name),
("entity", ent.Owner),
("entity", ent.Owner), // gender things for supporting downstreams with other languages
("job", CultureInfo.CurrentCulture.TextInfo.ToTitleCase(jobName))
), Loc.GetString("earlyleave-cryo-sender"),
playDefaultSound: false

View File

@@ -472,7 +472,7 @@ public sealed class BloodstreamSystem : EntitySystem
return;
}
var currentVolume = bloodSolution.RemoveReagent(component.BloodReagent, bloodSolution.Volume);
var currentVolume = bloodSolution.RemoveReagent(component.BloodReagent, bloodSolution.Volume, ignoreReagentData: true);
component.BloodReagent = reagent;

View File

@@ -1,5 +1,6 @@
using Content.Shared.Chemistry.Components;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Audio;
namespace Content.Server.Botany.Components;
@@ -23,6 +24,9 @@ public sealed partial class PlantHolderComponent : Component
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan LastCycle = TimeSpan.Zero;
[DataField]
public SoundSpecifier? WateringSound;
[DataField]
public bool UpdateSpriteAfterUpdate;

View File

@@ -1,6 +1,5 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Botany.Components;
using Content.Server.Fluids.Components;
using Content.Server.Kitchen.Components;
using Content.Server.Popups;
using Content.Shared.Chemistry.EntitySystems;
@@ -18,7 +17,6 @@ using Content.Shared.Popups;
using Content.Shared.Random;
using Content.Shared.Tag;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
@@ -37,7 +35,6 @@ public sealed class PlantHolderSystem : EntitySystem
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SharedPointLightSystem _pointLight = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly RandomHelperSystem _randomHelper = default!;
@@ -53,6 +50,7 @@ public sealed class PlantHolderSystem : EntitySystem
SubscribeLocalEvent<PlantHolderComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<PlantHolderComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<PlantHolderComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<PlantHolderComponent, SolutionTransferredEvent>(OnSolutionTransferred);
}
public override void Update(float frameTime)
@@ -158,6 +156,7 @@ public sealed class PlantHolderSystem : EntitySystem
if (!_botany.TryGetSeed(seeds, out var seed))
return;
args.Handled = true;
var name = Loc.GetString(seed.Name);
var noun = Loc.GetString(seed.Noun);
_popup.PopupCursor(Loc.GetString("plant-holder-component-plant-success-message",
@@ -185,6 +184,7 @@ public sealed class PlantHolderSystem : EntitySystem
return;
}
args.Handled = true;
_popup.PopupCursor(Loc.GetString("plant-holder-component-already-seeded-message",
("name", Comp<MetaDataComponent>(uid).EntityName)), args.User, PopupType.Medium);
return;
@@ -192,6 +192,7 @@ public sealed class PlantHolderSystem : EntitySystem
if (_tagSystem.HasTag(args.Used, "Hoe"))
{
args.Handled = true;
if (component.WeedLevel > 0)
{
_popup.PopupCursor(Loc.GetString("plant-holder-component-remove-weeds-message",
@@ -211,6 +212,7 @@ public sealed class PlantHolderSystem : EntitySystem
if (HasComp<ShovelComponent>(args.Used))
{
args.Handled = true;
if (component.Seed != null)
{
_popup.PopupCursor(Loc.GetString("plant-holder-component-remove-plant-message",
@@ -228,39 +230,9 @@ public sealed class PlantHolderSystem : EntitySystem
return;
}
if (_solutionContainerSystem.TryGetDrainableSolution(args.Used, out var solution, out _)
&& _solutionContainerSystem.ResolveSolution(uid, component.SoilSolutionName, ref component.SoilSolution)
&& TryComp(args.Used, out SprayComponent? spray))
{
var amount = FixedPoint2.New(1);
var targetEntity = uid;
var solutionEntity = args.Used;
_audio.PlayPvs(spray.SpraySound, args.Used, AudioParams.Default.WithVariation(0.125f));
var split = _solutionContainerSystem.Drain(solutionEntity, solution.Value, amount);
if (split.Volume == 0)
{
_popup.PopupCursor(Loc.GetString("plant-holder-component-no-plant-message",
("owner", args.Used)), args.User);
return;
}
_popup.PopupCursor(Loc.GetString("plant-holder-component-spray-message",
("owner", uid),
("amount", split.Volume)), args.User, PopupType.Medium);
_solutionContainerSystem.TryAddSolution(component.SoilSolution.Value, split);
ForceUpdateByExternalCause(uid, component);
return;
}
if (_tagSystem.HasTag(args.Used, "PlantSampleTaker"))
{
args.Handled = true;
if (component.Seed == null)
{
_popup.PopupCursor(Loc.GetString("plant-holder-component-nothing-to-sample-message"), args.User);
@@ -316,10 +288,15 @@ public sealed class PlantHolderSystem : EntitySystem
}
if (HasComp<SharpComponent>(args.Used))
{
args.Handled = true;
DoHarvest(uid, args.User, component);
return;
}
if (TryComp<ProduceComponent>(args.Used, out var produce))
{
args.Handled = true;
_popup.PopupCursor(Loc.GetString("plant-holder-component-compost-message",
("owner", uid),
("usingItem", args.Used)), args.User, PopupType.Medium);
@@ -351,6 +328,10 @@ public sealed class PlantHolderSystem : EntitySystem
}
}
private void OnSolutionTransferred(Entity<PlantHolderComponent> ent, ref SolutionTransferredEvent args)
{
_audio.PlayPvs(ent.Comp.WateringSound, ent.Owner);
}
private void OnInteractHand(Entity<PlantHolderComponent> entity, ref InteractHandEvent args)
{
DoHarvest(entity, args.User, entity.Comp);
@@ -699,7 +680,10 @@ public sealed class PlantHolderSystem : EntitySystem
if (TryComp<HandsComponent>(user, out var hands))
{
if (!_botany.CanHarvest(component.Seed, hands.ActiveHandEntity))
{
_popup.PopupCursor(Loc.GetString("plant-holder-component-ligneous-cant-harvest-message"), user);
return false;
}
}
else if (!_botany.CanHarvest(component.Seed))
{

View File

@@ -420,6 +420,13 @@ public sealed partial class CargoSystem
return false;
_nameIdentifier.GenerateUniqueName(uid, BountyNameIdentifierGroup, out var randomVal);
var newBounty = new CargoBountyData(bounty, randomVal);
// This bounty id already exists! Probably because NameIdentifierSystem ran out of ids.
if (component.Bounties.Any(b => b.Id == newBounty.Id))
{
Log.Error("Failed to add bounty {ID} because another one with the same ID already existed!", newBounty.Id);
return false;
}
component.Bounties.Add(new CargoBountyData(bounty, randomVal));
_adminLogger.Add(LogType.Action, LogImpact.Low, $"Added bounty \"{bounty.ID}\" (id:{component.TotalBounties}) to station {ToPrettyString(uid)}");
component.TotalBounties++;

View File

@@ -1,15 +1,18 @@
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text.RegularExpressions;
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
namespace Content.Server.Chat.Managers;
/// <summary>
/// Sanitizes messages!
/// It currently ony removes the shorthands for emotes (like "lol" or "^-^") from a chat message and returns the last
/// emote in their message
/// </summary>
public sealed class ChatSanitizationManager : IChatSanitizationManager
{
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
private static readonly Dictionary<string, string> SmileyToEmote = new()
private static readonly Dictionary<string, string> ShorthandToEmote = new()
{
// CP14-RU-Localization-Start
{ "лол", "chatsan-laughs" },
@@ -60,7 +63,7 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
{ ":D", "chatsan-smiles-widely" },
{ "D:", "chatsan-frowns-deeply" },
{ ":O", "chatsan-surprised" },
{ ":3", "chatsan-smiles" }, //nope
{ ":3", "chatsan-smiles" },
{ ":S", "chatsan-uncertain" },
{ ":>", "chatsan-grins" },
{ ":<", "chatsan-pouts" },
@@ -102,7 +105,7 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
{ "kek", "chatsan-laughs" },
{ "rofl", "chatsan-laughs" },
{ "o7", "chatsan-salutes" },
{ ";_;7", "chatsan-tearfully-salutes"},
{ ";_;7", "chatsan-tearfully-salutes" },
{ "idk", "chatsan-shrugs" },
{ ";)", "chatsan-winks" },
{ ";]", "chatsan-winks" },
@@ -115,9 +118,12 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
{ "(':", "chatsan-tearfully-smiles" },
{ "[':", "chatsan-tearfully-smiles" },
{ "('=", "chatsan-tearfully-smiles" },
{ "['=", "chatsan-tearfully-smiles" },
{ "['=", "chatsan-tearfully-smiles" }
};
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly ILocalizationManager _loc = default!;
private bool _doSanitize;
public void Initialize()
@@ -125,29 +131,60 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
_configurationManager.OnValueChanged(CCVars.ChatSanitizerEnabled, x => _doSanitize = x, true);
}
public bool TrySanitizeOutSmilies(string input, EntityUid speaker, out string sanitized, [NotNullWhen(true)] out string? emote)
/// <summary>
/// Remove the shorthands from the message, returning the last one found as the emote
/// </summary>
/// <param name="message">The pre-sanitized message</param>
/// <param name="speaker">The speaker</param>
/// <param name="sanitized">The sanitized message with shorthands removed</param>
/// <param name="emote">The localized emote</param>
/// <returns>True if emote has been sanitized out</returns>
public bool TrySanitizeEmoteShorthands(string message,
EntityUid speaker,
out string sanitized,
[NotNullWhen(true)] out string? emote)
{
if (!_doSanitize)
{
sanitized = input;
emote = null;
return false;
}
input = input.TrimEnd();
foreach (var (smiley, replacement) in SmileyToEmote)
{
if (input.EndsWith(smiley, true, CultureInfo.InvariantCulture))
{
sanitized = input.Remove(input.Length - smiley.Length).TrimEnd();
emote = Loc.GetString(replacement, ("ent", speaker));
return true;
}
}
sanitized = input;
emote = null;
return false;
sanitized = message;
if (!_doSanitize)
return false;
// -1 is just a canary for nothing found yet
var lastEmoteIndex = -1;
foreach (var (shorthand, emoteKey) in ShorthandToEmote)
{
// We have to escape it because shorthands like ":)" or "-_-" would break the regex otherwise.
var escaped = Regex.Escape(shorthand);
// So there are 2 cases:
// - If there is whitespace before it and after it is either punctuation, whitespace, or the end of the line
// Delete the word and the whitespace before
// - If it is at the start of the string and is followed by punctuation, whitespace, or the end of the line
// Delete the word and the punctuation if it exists.
var pattern =
$@"\s{escaped}(?=\p{{P}}|\s|$)|^{escaped}(?:\p{{P}}|(?=\s|$))";
var r = new Regex(pattern, RegexOptions.RightToLeft | RegexOptions.IgnoreCase);
// We're using sanitized as the original message until the end so that we can make sure the indices of
// the emotes are accurate.
var lastMatch = r.Match(sanitized);
if (!lastMatch.Success)
continue;
if (lastMatch.Index > lastEmoteIndex)
{
lastEmoteIndex = lastMatch.Index;
emote = _loc.GetString(emoteKey, ("ent", speaker));
}
message = r.Replace(message, string.Empty);
}
sanitized = message.Trim();
return emote is not null;
}
}

View File

@@ -6,5 +6,8 @@ public interface IChatSanitizationManager
{
public void Initialize();
public bool TrySanitizeOutSmilies(string input, EntityUid speaker, out string sanitized, [NotNullWhen(true)] out string? emote);
public bool TrySanitizeEmoteShorthands(string input,
EntityUid speaker,
out string sanitized,
[NotNullWhen(true)] out string? emote);
}

View File

@@ -746,8 +746,12 @@ public sealed partial class ChatSystem : SharedChatSystem
// ReSharper disable once InconsistentNaming
private string SanitizeInGameICMessage(EntityUid source, string message, out string? emoteStr, bool capitalize = true, bool punctuate = false, bool capitalizeTheWordI = true)
{
var newMessage = message.Trim();
newMessage = SanitizeMessageReplaceWords(newMessage);
var newMessage = SanitizeMessageReplaceWords(message.Trim());
GetRadioKeycodePrefix(source, newMessage, out newMessage, out var prefix);
// Sanitize it first as it might change the word order
_sanitizer.TrySanitizeEmoteShorthands(newMessage, source, out newMessage, out emoteStr);
if (capitalize)
newMessage = SanitizeMessageCapital(newMessage);
@@ -756,9 +760,7 @@ public sealed partial class ChatSystem : SharedChatSystem
if (punctuate)
newMessage = SanitizeMessagePeriod(newMessage);
_sanitizer.TrySanitizeOutSmilies(newMessage, source, out newMessage, out emoteStr);
return newMessage;
return prefix + newMessage;
}
private string SanitizeInGameOOCMessage(string message)

View File

@@ -0,0 +1,24 @@
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Chemistry.Components;
/// <summary>
/// Used for embeddable entities that should try to inject a
/// contained solution into a target over time while they are embbeded into.
/// </summary>
[RegisterComponent, AutoGenerateComponentPause]
public sealed partial class SolutionInjectWhileEmbeddedComponent : BaseSolutionInjectOnEventComponent {
///<summary>
///The time at which the injection will happen.
///</summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan NextUpdate;
///<summary>
///The delay between each injection in seconds.
///</summary>
[DataField]
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(3);
}

View File

@@ -2,6 +2,7 @@ using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Events;
using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.Projectiles;
@@ -29,6 +30,7 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
SubscribeLocalEvent<SolutionInjectOnProjectileHitComponent, ProjectileHitEvent>(HandleProjectileHit);
SubscribeLocalEvent<SolutionInjectOnEmbedComponent, EmbedEvent>(HandleEmbed);
SubscribeLocalEvent<MeleeChemicalInjectorComponent, MeleeHitEvent>(HandleMeleeHit);
SubscribeLocalEvent<SolutionInjectWhileEmbeddedComponent, InjectOverTimeEvent>(OnInjectOverTime);
}
private void HandleProjectileHit(Entity<SolutionInjectOnProjectileHitComponent> entity, ref ProjectileHitEvent args)
@@ -49,6 +51,11 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
TryInjectTargets((entity.Owner, entity.Comp), args.HitEntities, args.User);
}
private void OnInjectOverTime(Entity<SolutionInjectWhileEmbeddedComponent> entity, ref InjectOverTimeEvent args)
{
DoInjection((entity.Owner, entity.Comp), args.EmbeddedIntoUid);
}
private void DoInjection(Entity<BaseSolutionInjectOnEventComponent> injectorEntity, EntityUid target, EntityUid? source = null)
{
TryInjectTargets(injectorEntity, [target], source);

View File

@@ -0,0 +1,60 @@
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Events;
using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.Projectiles;
using Content.Shared.Tag;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Collections;
using Robust.Shared.Timing;
namespace Content.Server.Chemistry.EntitySystems;
/// <summary>
/// System for handling injecting into an entity while a projectile is embedded.
/// </summary>
public sealed class SolutionInjectWhileEmbeddedSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly TagSystem _tag = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SolutionInjectWhileEmbeddedComponent, MapInitEvent>(OnMapInit);
}
private void OnMapInit(Entity<SolutionInjectWhileEmbeddedComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval;
}
public override void Update(float frameTime)
{
base.Update(frameTime);
var query = EntityQueryEnumerator<SolutionInjectWhileEmbeddedComponent, EmbeddableProjectileComponent>();
while (query.MoveNext(out var uid, out var injectComponent, out var projectileComponent))
{
if (_gameTiming.CurTime < injectComponent.NextUpdate)
continue;
injectComponent.NextUpdate += injectComponent.UpdateInterval;
if(projectileComponent.EmbeddedIntoUid == null)
continue;
var ev = new InjectOverTimeEvent(projectileComponent.EmbeddedIntoUid.Value);
RaiseLocalEvent(uid, ref ev);
}
}
}

View File

@@ -231,7 +231,7 @@ namespace Content.Server.Cloning
// TODO: Ideally, components like this should be components on the mind entity so this isn't necessary.
// Add on special job components to the mob.
if (_jobs.MindTryGetJob(mindEnt, out _, out var prototype))
if (_jobs.MindTryGetJob(mindEnt, out var prototype))
{
foreach (var special in prototype.Special)
{

View File

@@ -39,7 +39,7 @@ public sealed class ExaminableDamageSystem : EntitySystem
var level = GetDamageLevel(uid, component);
var msg = Loc.GetString(messages[level]);
args.PushMarkup(msg);
args.PushMarkup(msg,-99);
}
private int GetDamageLevel(EntityUid uid, ExaminableDamageComponent? component = null,

View File

@@ -875,10 +875,41 @@ INSERT INTO player_round (players_id, rounds_id) VALUES ({players[player]}, {id}
public async Task AddAdminLogs(List<AdminLog> logs)
{
const int maxRetryAttempts = 5;
var initialRetryDelay = TimeSpan.FromSeconds(5);
DebugTools.Assert(logs.All(x => x.RoundId > 0), "Adding logs with invalid round ids.");
await using var db = await GetDb();
db.DbContext.AdminLog.AddRange(logs);
await db.DbContext.SaveChangesAsync();
var attempt = 0;
var retryDelay = initialRetryDelay;
while (attempt < maxRetryAttempts)
{
try
{
await using var db = await GetDb();
db.DbContext.AdminLog.AddRange(logs);
await db.DbContext.SaveChangesAsync();
_opsLog.Debug($"Successfully saved {logs.Count} admin logs.");
break;
}
catch (Exception ex)
{
attempt += 1;
_opsLog.Error($"Attempt {attempt} failed to save logs: {ex}");
if (attempt >= maxRetryAttempts)
{
_opsLog.Error($"Max retry attempts reached. Failed to save {logs.Count} admin logs.");
return;
}
_opsLog.Warning($"Retrying in {retryDelay.TotalSeconds} seconds...");
await Task.Delay(retryDelay);
retryDelay *= 2;
}
}
}
protected abstract IQueryable<AdminLog> StartAdminLogsQuery(ServerDbContext db, LogFilter? filter = null);

View File

@@ -0,0 +1,10 @@
namespace Content.Server.Destructible.Thresholds.Behaviors;
[DataDefinition]
public sealed partial class TimerStartBehavior : IThresholdBehavior
{
public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null)
{
system.TriggerSystem.StartTimer(owner, cause);
}
}

View File

@@ -46,8 +46,8 @@ public sealed class DoorSystem : SharedDoorSystem
SetBoltsDown(ent, true);
}
UpdateBoltLightStatus(ent);
ent.Comp.Powered = args.Powered;
Dirty(ent, ent.Comp);
UpdateBoltLightStatus(ent);
}
}

View File

@@ -1,49 +1,53 @@
using System.Linq;
using Content.Shared.EntityEffects;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Localizations;
using Robust.Shared.Prototypes;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Content.Shared.Station;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
namespace Content.Server.EntityEffects.EffectConditions;
public sealed partial class JobCondition : EntityEffectCondition
{
[DataField(required: true)] public List<ProtoId<JobPrototype>> Job;
public override bool Condition(EntityEffectBaseArgs args)
{
{
args.EntityManager.TryGetComponent<MindContainerComponent>(args.TargetEntity, out var mindContainer);
if (mindContainer != null && mindContainer.Mind != null)
if ( mindContainer is null
|| !args.EntityManager.TryGetComponent<MindComponent>(mindContainer.Mind, out var mind))
return false;
foreach (var roleId in mind.MindRoles)
{
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
if (args.EntityManager.TryGetComponent<JobComponent>(mindContainer?.Mind, out var comp) && prototypeManager.TryIndex(comp.Prototype, out var prototype))
if(!args.EntityManager.HasComponent<JobRoleComponent>(roleId))
continue;
if (!args.EntityManager.TryGetComponent<MindRoleComponent>(roleId, out var mindRole))
{
foreach (var jobId in Job)
{
if (prototype.ID == jobId)
{
return true;
}
}
Logger.Error($"Encountered job mind role entity {roleId} without a {nameof(MindRoleComponent)}");
continue;
}
if (mindRole.JobPrototype == null)
{
Logger.Error($"Encountered job mind role entity {roleId} without a {nameof(JobPrototype)}");
continue;
}
if (Job.Contains(mindRole.JobPrototype.Value))
return true;
}
return false;
}
public override string GuidebookExplanation(IPrototypeManager prototype)
{
var localizedNames = Job.Select(jobId => prototype.Index(jobId).LocalizedName).ToList();
return Loc.GetString("reagent-effect-condition-guidebook-job-condition", ("job", ContentLocalizationManager.FormatListToOr(localizedNames)));
}
}

View File

@@ -0,0 +1,15 @@
using Content.Shared.DeviceLinking;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Explosion.Components
{
/// <summary>
/// Sends a trigger when signal is received.
/// </summary>
[RegisterComponent]
public sealed partial class TimerStartOnSignalComponent : Component
{
[DataField("port", customTypeSerializer: typeof(PrototypeIdSerializer<SinkPortPrototype>))]
public string Port = "Timer";
}
}

View File

@@ -488,9 +488,12 @@ public sealed partial class ExplosionSystem
&& physics.BodyType == BodyType.Dynamic)
{
var pos = _transformSystem.GetWorldPosition(xform);
var dir = pos - epicenter.Position;
if (dir.IsLengthZero())
dir = _robustRandom.NextVector2().Normalized();
_throwingSystem.TryThrow(
uid,
pos - epicenter.Position,
dir,
physics,
xform,
_projectileQuery,

View File

@@ -11,6 +11,9 @@ namespace Content.Server.Explosion.EntitySystems
{
SubscribeLocalEvent<TriggerOnSignalComponent,SignalReceivedEvent>(OnSignalReceived);
SubscribeLocalEvent<TriggerOnSignalComponent,ComponentInit>(OnInit);
SubscribeLocalEvent<TimerStartOnSignalComponent,SignalReceivedEvent>(OnTimerSignalReceived);
SubscribeLocalEvent<TimerStartOnSignalComponent,ComponentInit>(OnTimerSignalInit);
}
private void OnSignalReceived(EntityUid uid, TriggerOnSignalComponent component, ref SignalReceivedEvent args)
@@ -24,5 +27,17 @@ namespace Content.Server.Explosion.EntitySystems
{
_signalSystem.EnsureSinkPorts(uid, component.Port);
}
private void OnTimerSignalReceived(EntityUid uid, TimerStartOnSignalComponent component, ref SignalReceivedEvent args)
{
if (args.Port != component.Port)
return;
StartTimer(uid, args.Trigger);
}
private void OnTimerSignalInit(EntityUid uid, TimerStartOnSignalComponent component, ComponentInit args)
{
_signalSystem.EnsureSinkPorts(uid, component.Port);
}
}
}

View File

@@ -4,6 +4,7 @@ using Content.Server.Discord;
using Content.Server.GameTicking.Events;
using Content.Server.Ghost;
using Content.Server.Maps;
using Content.Server.Roles;
using Content.Shared.CCVar;
using Content.Shared.Database;
using Content.Shared.GameTicking;
@@ -26,6 +27,7 @@ namespace Content.Server.GameTicking
public sealed partial class GameTicker
{
[Dependency] private readonly DiscordWebhook _discord = default!;
[Dependency] private readonly RoleSystem _role = default!;
[Dependency] private readonly ITaskManager _taskManager = default!;
private static readonly Counter RoundNumberMetric = Metrics.CreateCounter(
@@ -190,9 +192,6 @@ namespace Content.Server.GameTicking
if (!_playerManager.TryGetSessionById(userId, out _))
continue;
if (_banManager.GetRoleBans(userId) == null)
continue;
total++;
}
@@ -236,11 +235,7 @@ namespace Content.Server.GameTicking
#if DEBUG
DebugTools.Assert(_userDb.IsLoadComplete(session), $"Player was readied up but didn't have user DB data loaded yet??");
#endif
if (_banManager.GetRoleBans(userId) == null)
{
Logger.ErrorS("RoleBans", $"Role bans for player {session} {userId} have not been loaded yet.");
continue;
}
readyPlayers.Add(session);
HumanoidCharacterProfile profile;
if (_prefsManager.TryGetCachedPreferences(userId, out var preferences))
@@ -339,8 +334,23 @@ namespace Content.Server.GameTicking
RunLevel = GameRunLevel.PostRound;
ShowRoundEndScoreboard(text);
SendRoundEndDiscordMessage();
try
{
ShowRoundEndScoreboard(text);
}
catch (Exception e)
{
Log.Error($"Error while showing round end scoreboard: {e}");
}
try
{
SendRoundEndDiscordMessage();
}
catch (Exception e)
{
Log.Error($"Error while sending round end Discord message: {e}");
}
}
public void ShowRoundEndScoreboard(string text = "")
@@ -373,7 +383,7 @@ namespace Content.Server.GameTicking
var userId = mind.UserId ?? mind.OriginalOwnerUserId;
var connected = false;
var observer = HasComp<ObserverRoleComponent>(mindId);
var observer = _role.MindHasRole<ObserverRoleComponent>(mindId);
// Continuing
if (userId != null && _playerManager.ValidSessionId(userId.Value))
{
@@ -400,7 +410,7 @@ namespace Content.Server.GameTicking
_pvsOverride.AddGlobalOverride(GetNetEntity(entity.Value), recursive: true);
}
var roles = _roles.MindGetAllRoles(mindId);
var roles = _roles.MindGetAllRoleInfo(mindId);
var playerEndRoundInfo = new RoundEndMessageEvent.RoundEndPlayerInfo()
{

View File

@@ -3,8 +3,6 @@ using System.Linq;
using System.Numerics;
using Content.Server.Administration.Managers;
using Content.Server.GameTicking.Events;
using Content.Server.Ghost;
using Content.Server.Shuttles.Components;
using Content.Server.Spawners.Components;
using Content.Server.Speech.Components;
using Content.Server.Station.Components;
@@ -224,13 +222,12 @@ namespace Content.Server.GameTicking
_mind.SetUserId(newMind, data.UserId);
var jobPrototype = _prototypeManager.Index<JobPrototype>(jobId);
var job = new JobComponent {Prototype = jobId};
_roles.MindAddRole(newMind, job, silent: silent);
_roles.MindAddJobRole(newMind, silent: silent, jobPrototype:jobId);
var jobName = _jobs.MindTryGetJobName(newMind);
_playTimeTrackings.PlayerRolesChanged(player);
var mobMaybe = _stationSpawning.SpawnPlayerCharacterOnStation(station, job, character);
var mobMaybe = _stationSpawning.SpawnPlayerCharacterOnStation(station, jobId, character);
DebugTools.AssertNotNull(mobMaybe);
var mob = mobMaybe!.Value;
@@ -271,13 +268,17 @@ namespace Content.Server.GameTicking
_stationJobs.TryAssignJob(station, jobPrototype, player.UserId);
if (lateJoin)
{
_adminLogger.Add(LogType.LateJoin,
LogImpact.Medium,
$"Player {player.Name} late joined as {character.Name:characterName} on station {Name(station):stationName} with {ToPrettyString(mob):entity} as a {jobName:jobName}.");
}
else
{
_adminLogger.Add(LogType.RoundStartJoin,
LogImpact.Medium,
$"Player {player.Name} joined as {character.Name:characterName} on station {Name(station):stationName} with {ToPrettyString(mob):entity} as a {jobName:jobName}.");
}
// Make sure they're aware of extended access.
if (Comp<StationJobsComponent>(station).ExtendedAccess
@@ -363,7 +364,7 @@ namespace Content.Server.GameTicking
var (mindId, mindComp) = _mind.CreateMind(player.UserId, name);
mind = (mindId, mindComp);
_mind.SetUserId(mind.Value, player.UserId);
_roles.MindAddRole(mind.Value, new ObserverRoleComponent());
_roles.MindAddRole(mind.Value, "MindRoleObserver");
}
var ghost = _ghost.SpawnGhost(mind.Value);

View File

@@ -1,4 +1,5 @@
using Content.Shared.Dataset;
using Content.Shared.FixedPoint;
using Content.Shared.NPC.Prototypes;
using Content.Shared.Random;
using Content.Shared.Roles;
@@ -31,6 +32,24 @@ public sealed partial class TraitorRuleComponent : Component
[DataField]
public ProtoId<DatasetPrototype> ObjectiveIssuers = "TraitorCorporations";
/// <summary>
/// Give this traitor an Uplink on spawn.
/// </summary>
[DataField]
public bool GiveUplink = true;
/// <summary>
/// Give this traitor the codewords.
/// </summary>
[DataField]
public bool GiveCodewords = true;
/// <summary>
/// Give this traitor a briefing in chat.
/// </summary>
[DataField]
public bool GiveBriefing = true;
public int TotalTraitors => TraitorMinds.Count;
public string[] Codewords = new string[3];
@@ -68,5 +87,5 @@ public sealed partial class TraitorRuleComponent : Component
/// The amount of TC traitors start with.
/// </summary>
[DataField]
public int StartingBalance = 20;
public FixedPoint2 StartingBalance = 20;
}

View File

@@ -9,7 +9,6 @@ using Content.Server.RoundEnd;
using Content.Server.Shuttles.Events;
using Content.Server.Shuttles.Systems;
using Content.Server.Station.Components;
using Content.Server.Store.Components;
using Content.Server.Store.Systems;
using Content.Shared.GameTicking.Components;
using Content.Shared.Mobs;
@@ -31,9 +30,9 @@ namespace Content.Server.GameTicking.Rules;
public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
{
[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly EmergencyShuttleSystem _emergency = default!;
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly RoundEndSystem _roundEndSystem = default!;
[Dependency] private readonly StoreSystem _store = default!;
@@ -57,6 +56,8 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
SubscribeLocalEvent<NukeOperativeComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<NukeOperativeComponent, EntityZombifiedEvent>(OnOperativeZombified);
SubscribeLocalEvent<NukeopsRoleComponent, GetBriefingEvent>(OnGetBriefing);
SubscribeLocalEvent<ConsoleFTLAttemptEvent>(OnShuttleFTLAttempt);
SubscribeLocalEvent<WarDeclaredEvent>(OnWarDeclared);
SubscribeLocalEvent<CommunicationConsoleCallShuttleAttemptEvent>(OnShuttleCallAttempt);
@@ -65,7 +66,9 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
SubscribeLocalEvent<NukeopsRuleComponent, RuleLoadedGridsEvent>(OnRuleLoadedGrids);
}
protected override void Started(EntityUid uid, NukeopsRuleComponent component, GameRuleComponent gameRule,
protected override void Started(EntityUid uid,
NukeopsRuleComponent component,
GameRuleComponent gameRule,
GameRuleStartedEvent args)
{
var eligible = new List<Entity<StationEventEligibleComponent, NpcFactionMemberComponent>>();
@@ -85,7 +88,9 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
}
#region Event Handlers
protected override void AppendRoundEndText(EntityUid uid, NukeopsRuleComponent component, GameRuleComponent gameRule,
protected override void AppendRoundEndText(EntityUid uid,
NukeopsRuleComponent component,
GameRuleComponent gameRule,
ref RoundEndTextAppendEvent args)
{
var winText = Loc.GetString($"nukeops-{component.WinType.ToString().ToLower()}");
@@ -227,7 +232,8 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
// If the disk is currently at Central Command, the crew wins - just slightly.
// This also implies that some nuclear operatives have died.
SetWinType(ent, diskAtCentCom
SetWinType(ent,
diskAtCentCom
? WinType.CrewMinor
: WinType.OpsMinor);
ent.Comp.WinConditions.Add(diskAtCentCom
@@ -456,8 +462,11 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
: WinCondition.AllNukiesDead);
SetWinType(ent, WinType.CrewMajor, false);
_roundEndSystem.DoRoundEndBehavior(
nukeops.RoundEndBehavior, nukeops.EvacShuttleTime, nukeops.RoundEndTextSender, nukeops.RoundEndTextShuttleCall, nukeops.RoundEndTextAnnouncement);
_roundEndSystem.DoRoundEndBehavior(nukeops.RoundEndBehavior,
nukeops.EvacShuttleTime,
nukeops.RoundEndTextSender,
nukeops.RoundEndTextShuttleCall,
nukeops.RoundEndTextAnnouncement);
// prevent it called multiple times
nukeops.RoundEndBehavior = RoundEndBehavior.Nothing;
@@ -465,16 +474,22 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
private void OnAfterAntagEntSelected(Entity<NukeopsRuleComponent> ent, ref AfterAntagEntitySelectedEvent args)
{
if (ent.Comp.TargetStation is not { } station)
return;
var target = (ent.Comp.TargetStation is not null) ? Name(ent.Comp.TargetStation.Value) : "the target";
_antag.SendBriefing(args.Session, Loc.GetString("nukeops-welcome",
("station", station),
_antag.SendBriefing(args.Session,
Loc.GetString("nukeops-welcome",
("station", target),
("name", Name(ent))),
Color.Red,
ent.Comp.GreetSoundNotification);
}
private void OnGetBriefing(Entity<NukeopsRoleComponent> role, ref GetBriefingEvent args)
{
// TODO Different character screen briefing for the 3 nukie types
args.Append(Loc.GetString("nukeops-briefing"));
}
/// <remarks>
/// Is this method the shitty glue holding together the last of my sanity? yes.
/// Do i have a better solution? not presently.

View File

@@ -15,7 +15,6 @@ using Content.Shared.Database;
using Content.Shared.GameTicking.Components;
using Content.Shared.Humanoid;
using Content.Shared.IdentityManagement;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Mindshield.Components;
using Content.Shared.Mobs;
@@ -38,8 +37,8 @@ namespace Content.Server.GameTicking.Rules;
public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleComponent>
{
[Dependency] private readonly IAdminLogManager _adminLogManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly EmergencyShuttleSystem _emergencyShuttle = default!;
[Dependency] private readonly EuiManager _euiMan = default!;
[Dependency] private readonly MindSystem _mind = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
@@ -49,7 +48,7 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
[Dependency] private readonly SharedStunSystem _stun = default!;
[Dependency] private readonly RoundEndSystem _roundEnd = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly EmergencyShuttleSystem _emergencyShuttle = default!;
[Dependency] private readonly IGameTiming _timing = default!;
//Used in OnPostFlash, no reference to the rule component is available
public readonly ProtoId<NpcFactionPrototype> RevolutionaryNpcFaction = "Revolutionary";
@@ -59,9 +58,12 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
{
base.Initialize();
SubscribeLocalEvent<CommandStaffComponent, MobStateChangedEvent>(OnCommandMobStateChanged);
SubscribeLocalEvent<HeadRevolutionaryComponent, MobStateChangedEvent>(OnHeadRevMobStateChanged);
SubscribeLocalEvent<RevolutionaryRoleComponent, GetBriefingEvent>(OnGetBriefing);
SubscribeLocalEvent<HeadRevolutionaryComponent, AfterFlashedEvent>(OnPostFlash);
SubscribeLocalEvent<HeadRevolutionaryComponent, MobStateChangedEvent>(OnHeadRevMobStateChanged);
SubscribeLocalEvent<RevolutionaryRoleComponent, GetBriefingEvent>(OnGetBriefing);
}
protected override void Started(EntityUid uid, RevolutionaryRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
@@ -85,7 +87,9 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
}
}
protected override void AppendRoundEndText(EntityUid uid, RevolutionaryRuleComponent component, GameRuleComponent gameRule,
protected override void AppendRoundEndText(EntityUid uid,
RevolutionaryRuleComponent component,
GameRuleComponent gameRule,
ref RoundEndTextAppendEvent args)
{
base.AppendRoundEndText(uid, component, gameRule, ref args);
@@ -101,7 +105,9 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
args.AddLine(Loc.GetString("rev-headrev-count", ("initialCount", sessionData.Count)));
foreach (var (mind, data, name) in sessionData)
{
var count = CompOrNull<RevolutionaryRoleComponent>(mind)?.ConvertedCount ?? 0;
_role.MindHasRole<RevolutionaryRoleComponent>(mind, out var role);
var count = CompOrNull<RevolutionaryRoleComponent>(role)?.ConvertedCount ?? 0;
args.AddLine(Loc.GetString("rev-headrev-name-user",
("name", name),
("username", data.UserName),
@@ -113,10 +119,8 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
private void OnGetBriefing(EntityUid uid, RevolutionaryRoleComponent comp, ref GetBriefingEvent args)
{
if (!TryComp<MindComponent>(uid, out var mind) || mind.OwnedEntity == null)
return;
var head = HasComp<HeadRevolutionaryComponent>(mind.OwnedEntity);
var ent = args.Mind.Comp.OwnedEntity;
var head = HasComp<HeadRevolutionaryComponent>(ent);
args.Append(Loc.GetString(head ? "head-rev-briefing" : "rev-briefing"));
}
@@ -145,15 +149,20 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
if (ev.User != null)
{
_adminLogManager.Add(LogType.Mind, LogImpact.Medium, $"{ToPrettyString(ev.User.Value)} converted {ToPrettyString(ev.Target)} into a Revolutionary");
_adminLogManager.Add(LogType.Mind,
LogImpact.Medium,
$"{ToPrettyString(ev.User.Value)} converted {ToPrettyString(ev.Target)} into a Revolutionary");
if (_mind.TryGetRole<RevolutionaryRoleComponent>(ev.User.Value, out var headrev))
headrev.ConvertedCount++;
if (_mind.TryGetMind(ev.User.Value, out var revMindId, out _))
{
if (_role.MindHasRole<RevolutionaryRoleComponent>(revMindId, out var role))
role.Value.Comp2.ConvertedCount++;
}
}
if (mindId == default || !_role.MindHasRole<RevolutionaryRoleComponent>(mindId))
{
_role.MindAddRole(mindId, new RevolutionaryRoleComponent { PrototypeId = RevPrototypeId });
_role.MindAddRole(mindId, "MindRoleRevolutionary");
}
if (mind?.Session != null)

View File

@@ -1,18 +1,12 @@
using Content.Server.Antag;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Mind;
using Content.Server.Objectives;
using Content.Server.Roles;
using Content.Shared.Humanoid;
using Content.Shared.Mind;
using Content.Shared.Objectives.Components;
using Robust.Shared.Random;
namespace Content.Server.GameTicking.Rules;
public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
{
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly AntagSelectionSystem _antag = default!;
public override void Initialize()
@@ -24,32 +18,33 @@ public sealed class ThiefRuleSystem : GameRuleSystem<ThiefRuleComponent>
SubscribeLocalEvent<ThiefRoleComponent, GetBriefingEvent>(OnGetBriefing);
}
private void AfterAntagSelected(Entity<ThiefRuleComponent> ent, ref AfterAntagEntitySelectedEvent args)
// Greeting upon thief activation
private void AfterAntagSelected(Entity<ThiefRuleComponent> mindId, ref AfterAntagEntitySelectedEvent args)
{
if (!_mindSystem.TryGetMind(args.EntityUid, out var mindId, out var mind))
return;
//Generate objectives
_antag.SendBriefing(args.EntityUid, MakeBriefing(args.EntityUid), null, null);
var ent = args.EntityUid;
_antag.SendBriefing(ent, MakeBriefing(ent), null, null);
}
//Add mind briefing
private void OnGetBriefing(Entity<ThiefRoleComponent> thief, ref GetBriefingEvent args)
// Character screen briefing
private void OnGetBriefing(Entity<ThiefRoleComponent> role, ref GetBriefingEvent args)
{
if (!TryComp<MindComponent>(thief.Owner, out var mind) || mind.OwnedEntity == null)
return;
var ent = args.Mind.Comp.OwnedEntity;
args.Append(MakeBriefing(mind.OwnedEntity.Value));
if (ent is null)
return;
args.Append(MakeBriefing(ent.Value));
}
private string MakeBriefing(EntityUid thief)
private string MakeBriefing(EntityUid ent)
{
var isHuman = HasComp<HumanoidAppearanceComponent>(thief);
var isHuman = HasComp<HumanoidAppearanceComponent>(ent);
var briefing = isHuman
? Loc.GetString("thief-role-greeting-human")
: Loc.GetString("thief-role-greeting-animal");
briefing += "\n \n" + Loc.GetString("thief-role-greeting-equipment") + "\n";
if (isHuman)
briefing += "\n \n" + Loc.GetString("thief-role-greeting-equipment") + "\n";
return briefing;
}
}

View File

@@ -1,3 +1,4 @@
using Content.Server.Administration.Logs;
using Content.Server.Antag;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Mind;
@@ -5,12 +6,12 @@ using Content.Server.Objectives;
using Content.Server.PDA.Ringer;
using Content.Server.Roles;
using Content.Server.Traitor.Uplink;
using Content.Shared.Database;
using Content.Shared.FixedPoint;
using Content.Shared.GameTicking.Components;
using Content.Shared.Mind;
using Content.Shared.NPC.Systems;
using Content.Shared.Objectives.Components;
using Content.Shared.PDA;
using Content.Shared.Radio;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Content.Shared.Roles.RoleCodeword;
@@ -25,29 +26,29 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
{
private static readonly Color TraitorCodewordColor = Color.FromHex("#cc3b3b");
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly UplinkSystem _uplink = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly SharedRoleSystem _roleSystem = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
[Dependency] private readonly SharedRoleCodewordSystem _roleCodewordSystem = default!;
[Dependency] private readonly SharedRoleSystem _roleSystem = default!;
[Dependency] private readonly UplinkSystem _uplink = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<TraitorRuleComponent, AfterAntagEntitySelectedEvent>(AfterEntitySelected);
SubscribeLocalEvent<TraitorRuleComponent, ObjectivesTextPrependEvent>(OnObjectivesTextPrepend);
}
protected override void Added(EntityUid uid, TraitorRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args)
{
base.Added(uid, component, gameRule, args);
SetCodewords(component);
SetCodewords(component, args.RuleEntity);
}
private void AfterEntitySelected(Entity<TraitorRuleComponent> ent, ref AfterAntagEntitySelectedEvent args)
@@ -55,9 +56,10 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
MakeTraitor(args.EntityUid, ent);
}
private void SetCodewords(TraitorRuleComponent component)
private void SetCodewords(TraitorRuleComponent component, EntityUid ruleEntity)
{
component.Codewords = GenerateTraitorCodewords(component);
_adminLogger.Add(LogType.EventStarted, LogImpact.Low, $"Codewords generated for game rule {ToPrettyString(ruleEntity)}: {string.Join(", ", component.Codewords)}");
}
public string[] GenerateTraitorCodewords(TraitorRuleComponent component)
@@ -74,47 +76,59 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
return codewords;
}
public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component, bool giveUplink = true)
public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component)
{
//Grab the mind if it wasnt provided
//Grab the mind if it wasn't provided
if (!_mindSystem.TryGetMind(traitor, out var mindId, out var mind))
return false;
var briefing = Loc.GetString("traitor-role-codewords-short", ("codewords", string.Join(", ", component.Codewords)));
var briefing = "";
if (component.GiveCodewords)
briefing = Loc.GetString("traitor-role-codewords-short", ("codewords", string.Join(", ", component.Codewords)));
var issuer = _random.Pick(_prototypeManager.Index(component.ObjectiveIssuers).Values);
// Uplink code will go here if applicable, but we still need the variable if there aren't any
Note[]? code = null;
if (giveUplink)
if (component.GiveUplink)
{
// Calculate the amount of currency on the uplink.
var startingBalance = component.StartingBalance;
if (_jobs.MindTryGetJob(mindId, out _, out var prototype))
startingBalance = Math.Max(startingBalance - prototype.AntagAdvantage, 0);
if (_jobs.MindTryGetJob(mindId, out var prototype))
{
if (startingBalance < prototype.AntagAdvantage) // Can't use Math functions on FixedPoint2
startingBalance = 0;
else
startingBalance = startingBalance - prototype.AntagAdvantage;
}
// creadth: we need to create uplink for the antag.
// PDA should be in place already
var pda = _uplink.FindUplinkTarget(traitor);
if (pda == null || !_uplink.AddUplink(traitor, startingBalance, giveDiscounts: true))
return false;
// Give traitors their codewords and uplink code to keep in their character info menu
code = EnsureComp<RingerUplinkComponent>(pda.Value).Code;
// If giveUplink is false the uplink code part is omitted
briefing = string.Format("{0}\n{1}", briefing,
Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("-", code).Replace("sharp", "#"))));
// Choose and generate an Uplink, and return the uplink code if applicable
var uplinkParams = RequestUplink(traitor, startingBalance, briefing);
code = uplinkParams.Item1;
briefing = uplinkParams.Item2;
}
_antag.SendBriefing(traitor, GenerateBriefing(component.Codewords, code, issuer), null, component.GreetSoundNotification);
string[]? codewords = null;
if (component.GiveCodewords)
codewords = component.Codewords;
if (component.GiveBriefing)
_antag.SendBriefing(traitor, GenerateBriefing(codewords, code, issuer), null, component.GreetSoundNotification);
component.TraitorMinds.Add(mindId);
// Assign briefing
_roleSystem.MindAddRole(mindId, new RoleBriefingComponent
//Since this provides neither an antag/job prototype, nor antag status/roletype,
//and is intrinsically related to the traitor role
//it does not need to be a separate Mind Role Entity
_roleSystem.MindHasRole<TraitorRoleComponent>(mindId, out var traitorRole);
if (traitorRole is not null)
{
Briefing = briefing
}, mind, true);
AddComp<RoleBriefingComponent>(traitorRole.Value.Owner);
Comp<RoleBriefingComponent>(traitorRole.Value.Owner).Briefing = briefing;
}
// Send codewords to only the traitor client
var color = TraitorCodewordColor; // Fall back to a dark red Syndicate color if a prototype is not found
@@ -129,20 +143,51 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
return true;
}
private (Note[]?, string) RequestUplink(EntityUid traitor, FixedPoint2 startingBalance, string briefing)
{
var pda = _uplink.FindUplinkTarget(traitor);
Note[]? code = null;
var uplinked = _uplink.AddUplink(traitor, startingBalance, pda, true);
if (pda is not null && uplinked)
{
// Codes are only generated if the uplink is a PDA
code = EnsureComp<RingerUplinkComponent>(pda.Value).Code;
// If giveUplink is false the uplink code part is omitted
briefing = string.Format("{0}\n{1}",
briefing,
Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("-", code).Replace("sharp", "#"))));
return (code, briefing);
}
else if (pda is null && uplinked)
{
briefing += "\n" + Loc.GetString("traitor-role-uplink-implant-short");
}
return (null, briefing);
}
// TODO: AntagCodewordsComponent
private void OnObjectivesTextPrepend(EntityUid uid, TraitorRuleComponent comp, ref ObjectivesTextPrependEvent args)
{
args.Text += "\n" + Loc.GetString("traitor-round-end-codewords", ("codewords", string.Join(", ", comp.Codewords)));
if(comp.GiveCodewords)
args.Text += "\n" + Loc.GetString("traitor-round-end-codewords", ("codewords", string.Join(", ", comp.Codewords)));
}
// TODO: figure out how to handle this? add priority to briefing event?
private string GenerateBriefing(string[] codewords, Note[]? uplinkCode, string? objectiveIssuer = null)
private string GenerateBriefing(string[]? codewords, Note[]? uplinkCode, string? objectiveIssuer = null)
{
var sb = new StringBuilder();
sb.AppendLine(Loc.GetString("traitor-role-greeting", ("corporation", objectiveIssuer ?? Loc.GetString("objective-issuer-unknown"))));
sb.AppendLine(Loc.GetString("traitor-role-codewords", ("codewords", string.Join(", ", codewords))));
if (codewords != null)
sb.AppendLine(Loc.GetString("traitor-role-codewords", ("codewords", string.Join(", ", codewords))));
if (uplinkCode != null)
sb.AppendLine(Loc.GetString("traitor-role-uplink-code", ("code", string.Join("-", uplinkCode).Replace("sharp", "#"))));
else
sb.AppendLine(Loc.GetString("traitor-role-uplink-implant"));
return sb.ToString();
}

View File

@@ -13,6 +13,7 @@ using Content.Shared.Mind;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Roles;
using Content.Shared.Zombies;
using Robust.Shared.Player;
using Robust.Shared.Timing;
@@ -22,15 +23,16 @@ namespace Content.Server.GameTicking.Rules;
public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
{
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly RoundEndSystem _roundEnd = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly ZombieSystem _zombie = default!;
[Dependency] private readonly SharedMindSystem _mindSystem = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly SharedMindSystem _mindSystem = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly SharedRoleSystem _roles = default!;
[Dependency] private readonly RoundEndSystem _roundEnd = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly ZombieSystem _zombie = default!;
public override void Initialize()
{
@@ -41,23 +43,20 @@ public sealed class ZombieRuleSystem : GameRuleSystem<ZombieRuleComponent>
SubscribeLocalEvent<IncurableZombieComponent, ZombifySelfActionEvent>(OnZombifySelf);
}
private void OnGetBriefing(EntityUid uid, InitialInfectedRoleComponent component, ref GetBriefingEvent args)
private void OnGetBriefing(Entity<InitialInfectedRoleComponent> role, ref GetBriefingEvent args)
{
if (!TryComp<MindComponent>(uid, out var mind) || mind.OwnedEntity == null)
return;
if (HasComp<ZombieRoleComponent>(uid)) // don't show both briefings
return;
args.Append(Loc.GetString("zombie-patientzero-role-greeting"));
if (!_roles.MindHasRole<ZombieRoleComponent>(args.Mind.Owner))
args.Append(Loc.GetString("zombie-patientzero-role-greeting"));
}
private void OnGetBriefing(EntityUid uid, ZombieRoleComponent component, ref GetBriefingEvent args)
private void OnGetBriefing(Entity<ZombieRoleComponent> role, ref GetBriefingEvent args)
{
if (!TryComp<MindComponent>(uid, out var mind) || mind.OwnedEntity == null)
return;
args.Append(Loc.GetString("zombie-infection-greeting"));
}
protected override void AppendRoundEndText(EntityUid uid, ZombieRuleComponent component, GameRuleComponent gameRule,
protected override void AppendRoundEndText(EntityUid uid,
ZombieRuleComponent component,
GameRuleComponent gameRule,
ref RoundEndTextAppendEvent args)
{
base.AppendRoundEndText(uid, component, gameRule, ref args);

Some files were not shown because too many files have changed in this diff Show More