diff --git a/Content.Server/Nutrition/Components/FoodComponent.cs b/Content.Server/Nutrition/Components/FoodComponent.cs index 9e37af2a108..0f696d36946 100644 --- a/Content.Server/Nutrition/Components/FoodComponent.cs +++ b/Content.Server/Nutrition/Components/FoodComponent.cs @@ -17,7 +17,7 @@ public sealed partial class FoodComponent : Component [DataField] public SoundSpecifier UseSound = new SoundPathSpecifier("/Audio/Items/eatfood.ogg"); - [DataField] + [DataField("trash")] public EntProtoId? TrashPrototype; [DataField] diff --git a/Content.Server/StationEvents/BasicStationEventSchedulerSystem.cs b/Content.Server/StationEvents/BasicStationEventSchedulerSystem.cs index bc77a9ce471..36d30f50eee 100644 --- a/Content.Server/StationEvents/BasicStationEventSchedulerSystem.cs +++ b/Content.Server/StationEvents/BasicStationEventSchedulerSystem.cs @@ -1,8 +1,13 @@ +using System.Linq; +using Content.Server.Administration; using Content.Server.GameTicking.Rules; using Content.Server.GameTicking.Rules.Components; using Content.Server.StationEvents.Components; +using Content.Shared.Administration; using JetBrains.Annotations; using Robust.Shared.Random; +using Robust.Shared.Toolshed; +using Robust.Shared.Utility; namespace Content.Server.StationEvents { @@ -56,4 +61,54 @@ private void ResetTimer(BasicStationEventSchedulerComponent component) component.TimeUntilNextEvent = _random.Next(300, 1500); } } + + [ToolshedCommand, AdminCommand(AdminFlags.Debug)] + public sealed class StationEventCommand : ToolshedCommand + { + private EventManagerSystem? _stationEvent; + + [CommandImplementation("lsprob")] + public IEnumerable<(string, float)> LsProb() + { + _stationEvent ??= GetSys(); + var events = _stationEvent.AllEvents(); + + var totalWeight = events.Sum(x => x.Value.Weight); + + foreach (var (proto, comp) in events) + { + yield return (proto.ID, comp.Weight / totalWeight); + } + } + + [CommandImplementation("lsprobtime")] + public IEnumerable<(string, float)> LsProbTime([CommandArgument] float time) + { + _stationEvent ??= GetSys(); + var events = _stationEvent.AllEvents().Where(pair => pair.Value.EarliestStart <= time).ToList(); + + var totalWeight = events.Sum(x => x.Value.Weight); + + foreach (var (proto, comp) in events) + { + yield return (proto.ID, comp.Weight / totalWeight); + } + } + + [CommandImplementation("prob")] + public float Prob([CommandArgument] string eventId) + { + _stationEvent ??= GetSys(); + var events = _stationEvent.AllEvents(); + + var totalWeight = events.Sum(x => x.Value.Weight); + var weight = 0f; + if (events.TryFirstOrNull(p => p.Key.ID == eventId, out var pair)) + { + weight = pair.Value.Value.Weight; + } + + return weight / totalWeight; + } + } } diff --git a/Content.Shared/Audio/AmbientSoundComponent.cs b/Content.Shared/Audio/AmbientSoundComponent.cs index 8075c0bd4b9..bd59ab611fb 100644 --- a/Content.Shared/Audio/AmbientSoundComponent.cs +++ b/Content.Shared/Audio/AmbientSoundComponent.cs @@ -12,7 +12,7 @@ namespace Content.Shared.Audio; [Access(typeof(SharedAmbientSoundSystem))] public sealed partial class AmbientSoundComponent : Component, IComponentTreeEntry { - [DataField("enabled")] + [DataField("enabled", readOnly: true)] [ViewVariables(VVAccess.ReadWrite)] // only for map editing public bool Enabled { get; set; } = true; diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index ab94b9a30a4..1935125b976 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,9 +1,4 @@ Entries: -- author: graevy - changes: - - {message: Added reflection to the reflective vest and shuttle walls, type: Add} - id: 4381 - time: '2023-07-31T01:07:46.0000000+00:00' - author: Bhijn and Myr changes: - {message: 'The flash overlay is no longer offset towards the actual physical center @@ -2981,3 +2976,8 @@ Entries: - {message: Nukies can declare war again., type: Fix} id: 4880 time: '2023-09-23T20:00:13.0000000+00:00' +- author: Doru991 + changes: + - {message: Trash spawns correctly after food is eaten., type: Fix} + id: 4881 + time: '2023-09-24T17:20:03.0000000+00:00' diff --git a/Resources/Locale/en-US/commands/toolshed-commands.ftl b/Resources/Locale/en-US/commands/toolshed-commands.ftl index 9320dac917d..29c8190d6e2 100644 --- a/Resources/Locale/en-US/commands/toolshed-commands.ftl +++ b/Resources/Locale/en-US/commands/toolshed-commands.ftl @@ -40,6 +40,12 @@ command-description-stations-rename = Renames the given station. command-description-stations-largestgrid = Returns the largest grid the given station has, if any. +command-description-stationevent-lsprob = + Lists the probability of different station events occuring out of the entire pool. +command-description-stationevent-lsprobtime = + Lists the probability of different station events occuring based on the specified length of a round. +command-description-stationevent-prob = + Returns the probability of a single station event occuring out of the entire pool. command-description-admins-active = Returns a list of active admins. command-description-admins-all = diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index a002965eb86..3fd05e4ece3 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -999,7 +999,6 @@ - Trash - VimPilot - Mouse - - DoorBumpOpener - type: Respirator damage: types: diff --git a/Resources/Prototypes/Entities/Objects/Magic/books.yml b/Resources/Prototypes/Entities/Objects/Magic/books.yml index 79c0cd9a789..812949fb0b9 100644 --- a/Resources/Prototypes/Entities/Objects/Magic/books.yml +++ b/Resources/Prototypes/Entities/Objects/Magic/books.yml @@ -20,7 +20,6 @@ components: - type: Spellbook spells: - FlashRune: -1 ActionSpawnMagicarpSpell: -1 - type: entity @@ -99,7 +98,7 @@ - state: spell_default - type: Spellbook spells: - FlashRune: -1 - ExplosionRune: -1 - IgniteRune: -1 - StunRune: -1 + ActionFlashRune: -1 + ActionExplosionRune: -1 + ActionIgniteRune: -1 + ActionStunRune: -1 diff --git a/Resources/Prototypes/Hydroponics/seeds.yml b/Resources/Prototypes/Hydroponics/seeds.yml index e990ffdb370..8e1c6c93285 100644 --- a/Resources/Prototypes/Hydroponics/seeds.yml +++ b/Resources/Prototypes/Hydroponics/seeds.yml @@ -1272,7 +1272,7 @@ Vitamin: Min: 1 Max: 4 - PotencyDivisor: 40 + PotencyDivisor: 40 - type: seed id: bungo @@ -1301,4 +1301,4 @@ Enzyme: Min: 5 Max: 10 - PotencyDivisor: 20 \ No newline at end of file + PotencyDivisor: 20 diff --git a/Tools/actions_changelog_rss.py b/Tools/actions_changelog_rss.py index 01d9234ca8d..7be6e3dc26c 100755 --- a/Tools/actions_changelog_rss.py +++ b/Tools/actions_changelog_rss.py @@ -43,6 +43,7 @@ FEED_DESCRIPTION = "Changelog for the official Wizard's Den branch of Space Station 14." FEED_LANGUAGE = "en-US" FEED_GUID_PREFIX = "ss14-changelog-wizards-" +FEED_URL = "https://central.spacestation14.io/changelog.xml" CHANGELOG_FILE = "Resources/Changelog/Changelog.yml" @@ -56,7 +57,11 @@ XML_NS = "https://spacestation14.com/changelog_rss" XML_NS_B = f"{{{XML_NS}}}" +XML_NS_ATOM = "http://www.w3.org/2005/Atom" +XML_NS_ATOM_B = f"{{{XML_NS_ATOM}}}" + ET.register_namespace("ss14", XML_NS) +ET.register_namespace("atom", XML_NS_ATOM) # From https://stackoverflow.com/a/37958106/4678631 class NoDatesSafeLoader(yaml.SafeLoader): @@ -113,6 +118,7 @@ def create_feed(changelog: Any, previous_items: List[ET.Element]) -> Tuple[ET.El ET.SubElement(channel, "language").text = FEED_LANGUAGE ET.SubElement(channel, "lastBuildDate").text = email.utils.format_datetime(time_now) + ET.SubElement(channel, XML_NS_ATOM_B + "link", {"type": "application/rss+xml", "rel": "self", "href": FEED_URL}) # Find the last item ID mentioned in the previous changelog last_changelog_id = find_last_changelog_id(previous_items) @@ -132,7 +138,7 @@ def create_new_item_since(changelog: Any, channel: ET.Element, since: int, now: attrs = {XML_NS_B + "from-id": str(since), XML_NS_B + "to-id": str(top_entry_id)} new_item = ET.SubElement(channel, "item", attrs) ET.SubElement(new_item, "pubDate").text = email.utils.format_datetime(now) - ET.SubElement(new_item, "guid").text = f"{FEED_GUID_PREFIX}{since}-{top_entry_id}" + ET.SubElement(new_item, "guid", {"isPermaLink": "false"}).text = f"{FEED_GUID_PREFIX}{since}-{top_entry_id}" ET.SubElement(new_item, "description").text = generate_description_for_entries(entries_for_item)