From 32ecf1d1753680e3e89ac02d5b160474379ea423 Mon Sep 17 00:00:00 2001 From: Sh1ntra Date: Tue, 28 Jan 2025 17:56:56 +0300 Subject: [PATCH 1/4] Revert "Remove rewards from expeditions (#2385)" This reverts commit 34b9c4af44c84f0e665b93e82ed404158475eb67. --- .../UI/SalvageExpeditionWindow.xaml.cs | 42 ++++----- Content.Shared/Salvage/SharedSalvageSystem.cs | 72 +++++++-------- .../Prototypes/Procedural/salvage_rewards.yml | 11 +++ .../_NF/Catalog/Fills/Items/briefcases.yml | 89 +++++++++++++++++++ .../_NF/Procedural/salvage_rewards.yml | 24 +++++ 5 files changed, 177 insertions(+), 61 deletions(-) create mode 100644 Resources/Prototypes/_NF/Catalog/Fills/Items/briefcases.yml create mode 100644 Resources/Prototypes/_NF/Procedural/salvage_rewards.yml diff --git a/Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml.cs b/Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml.cs index 0f5804ba9a6..43f9cc1f02e 100644 --- a/Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml.cs +++ b/Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml.cs @@ -195,33 +195,29 @@ public void UpdateState(SalvageExpeditionConsoleState state) Margin = new Thickness(0f, 0f, 0f, 5f), }); - // Frontier: wrap in rewards > 0 , otherwise dont show "rewards" text - if (mission.Rewards.Count > 0) + lBox.AddChild(new Label() { - lBox.AddChild(new Label() - { - Text = Loc.GetString("salvage-expedition-window-rewards") - }); - - var rewards = new Dictionary(); - foreach (var reward in mission.Rewards) - { - var name = _prototype.Index(reward).Name; - var count = rewards.GetOrNew(name); - count++; - rewards[name] = count; - } + Text = Loc.GetString("salvage-expedition-window-rewards") + }); - // there will always be 3 or more rewards so no need for 0 check - lBox.AddChild(new Label() - { - Text = string.Join("\n", rewards.Select(o => "- " + o.Key + (o.Value > 1 ? $" x {o.Value}" : ""))).TrimEnd(), - FontColorOverride = StyleNano.ConcerningOrangeFore, - HorizontalAlignment = HAlignment.Left, - Margin = new Thickness(0f, 0f, 0f, 5f) - }); + var rewards = new Dictionary(); + foreach (var reward in mission.Rewards) + { + var name = _prototype.Index(reward).Name; + var count = rewards.GetOrNew(name); + count++; + rewards[name] = count; } + // there will always be 3 or more rewards so no need for 0 check + lBox.AddChild(new Label() + { + Text = string.Join("\n", rewards.Select(o => "- " + o.Key + (o.Value > 1 ? $" x {o.Value}" : ""))).TrimEnd(), + FontColorOverride = StyleNano.ConcerningOrangeFore, + HorizontalAlignment = HAlignment.Left, + Margin = new Thickness(0f, 0f, 0f, 5f) + }); + // Claim var claimButton = new Button() { diff --git a/Content.Shared/Salvage/SharedSalvageSystem.cs b/Content.Shared/Salvage/SharedSalvageSystem.cs index 22e32bb4e60..15659944318 100644 --- a/Content.Shared/Salvage/SharedSalvageSystem.cs +++ b/Content.Shared/Salvage/SharedSalvageSystem.cs @@ -181,48 +181,44 @@ public T GetMod(System.Random rand, ref float rating) where T : class, IProto private List GetRewards(DifficultyRating difficulty, System.Random rand) { var rewards = new List(3); - // Frontier : Removed rewards - //var ids = RewardsForDifficulty(difficulty); - // foreach (var id in ids) - // { - // // pick a random reward to give - // var weights = _proto.Index(id); - // rewards.Add(weights.Pick(rand)); - // } + var ids = RewardsForDifficulty(difficulty); + foreach (var id in ids) + { + // pick a random reward to give + var weights = _proto.Index(id); + rewards.Add(weights.Pick(rand)); + } return rewards; } - /** - * Frontier: Removed rewards - */ - // /// - // /// Get a list of WeightedRandomEntityPrototype IDs with the rewards for a certain difficulty. - // /// Frontier: added uncommon and legendary reward tiers, limited amount of rewards to 1 per difficulty rating - // /// - // private string[] RewardsForDifficulty(DifficultyRating rating) - // { - // var t1 = "ExpeditionRewardT1"; // Frontier - Update tiers - // var t2 = "ExpeditionRewardT2"; // Frontier - Update tiers - // var t3 = "ExpeditionRewardT3"; // Frontier - Update tiers - // var t4 = "ExpeditionRewardT4"; // Frontier - Update tiers - // var t5 = "ExpeditionRewardT5"; // Frontier - Update tiers - // switch (rating) - // { - // case DifficultyRating.Minimal: - // return new string[] { t1 }; // Frontier - Update tiers - // case DifficultyRating.Minor: - // return new string[] { t2 }; // Frontier - Update tiers - // case DifficultyRating.Moderate: - // return new string[] { t3 }; // Frontier - Update tiers - // case DifficultyRating.Hazardous: - // return new string[] { t4 }; // Frontier - Update tiers - // case DifficultyRating.Extreme: - // return new string[] { t5 }; // Frontier - Update tiers - // default: - // throw new NotImplementedException(); - // } - // } + /// + /// Get a list of WeightedRandomEntityPrototype IDs with the rewards for a certain difficulty. + /// Frontier: added uncommon and legendary reward tiers, limited amount of rewards to 1 per difficulty rating + /// + private string[] RewardsForDifficulty(DifficultyRating rating) + { + var t1 = "ExpeditionRewardT1"; // Frontier - Update tiers + var t2 = "ExpeditionRewardT2"; // Frontier - Update tiers + var t3 = "ExpeditionRewardT3"; // Frontier - Update tiers + var t4 = "ExpeditionRewardT4"; // Frontier - Update tiers + var t5 = "ExpeditionRewardT5"; // Frontier - Update tiers + switch (rating) + { + case DifficultyRating.Minimal: + return new string[] { t1 }; // Frontier - Update tiers + case DifficultyRating.Minor: + return new string[] { t2 }; // Frontier - Update tiers + case DifficultyRating.Moderate: + return new string[] { t3 }; // Frontier - Update tiers + case DifficultyRating.Hazardous: + return new string[] { t4 }; // Frontier - Update tiers + case DifficultyRating.Extreme: + return new string[] { t5 }; // Frontier - Update tiers + default: + throw new NotImplementedException(); + } + } } [Serializable, NetSerializable] diff --git a/Resources/Prototypes/Procedural/salvage_rewards.yml b/Resources/Prototypes/Procedural/salvage_rewards.yml index 4b374593607..a06d4e195f8 100644 --- a/Resources/Prototypes/Procedural/salvage_rewards.yml +++ b/Resources/Prototypes/Procedural/salvage_rewards.yml @@ -15,6 +15,9 @@ RandomArtifactSpawner: 0.25 # weighted down since it sells for a lot NuclearBombKeg: 0.1 + # money + SpaceCash500: 0.5 + SpaceCash1000: 0.25 - type: weightedRandomEntity id: SalvageRewardRare @@ -43,6 +46,10 @@ ClothingOuterArmorBasicSlim: 0.25 # rare weapons WeaponMakeshiftLaser: 0.1 + # money + SpaceCash500: 1.0 + SpaceCash1000: 0.75 + SpaceCash2500: 0.5 - type: weightedRandomEntity id: SalvageRewardEpic @@ -62,3 +69,7 @@ # rare chemicals CognizineChemistryBottle: 1.0 OmnizineChemistryBottle: 1.0 + # money + SpaceCash2500: 1.0 + SpaceCash5000: 0.75 + SpaceCash10000: 0.5 \ No newline at end of file diff --git a/Resources/Prototypes/_NF/Catalog/Fills/Items/briefcases.yml b/Resources/Prototypes/_NF/Catalog/Fills/Items/briefcases.yml new file mode 100644 index 00000000000..35baf565c72 --- /dev/null +++ b/Resources/Prototypes/_NF/Catalog/Fills/Items/briefcases.yml @@ -0,0 +1,89 @@ +- type: entity + parent: BaseItem + id: SpaceCashExpedition + name: spesos + description: Hard-earned credits. Fresh from the digital cash mint. Smells like success and unpaid taxes. + abstract: true + categories: [ HideSpawnMenu ] + suffix: Money + components: + - type: Sprite + sprite: Objects/Storage/Briefcases/briefcase_brown.rsi + state: icon + - type: Item + size: Ginormous + sprite: Objects/Storage/Briefcases/briefcase_brown.rsi + - type: CargoSellBlacklist # We dont want this to be sold by mistake, and so you cannot sell this on a cargo depo + +- type: entity + parent: SpaceCashExpedition + id: SpaceCashExpeditionT1 + name: spesos (5,000) + categories: [ HideSpawnMenu ] + components: + - type: SpawnItemsOnUse + items: + - id: SpaceCash5000 + sound: + collection: storageRustle + - type: StaticPrice # Require since you can still sell a ship that have it on it + price: 5000 + +- type: entity + parent: SpaceCashExpedition + id: SpaceCashExpeditionT2 + name: spesos (10,000) + categories: [ HideSpawnMenu ] + components: + - type: SpawnItemsOnUse + items: + - id: SpaceCash10000 + sound: + collection: storageRustle + - type: StaticPrice # Require since you can still sell a ship that have it on it + price: 10000 + +- type: entity + parent: SpaceCashExpedition + id: SpaceCashExpeditionT3 + name: spesos (20,000) + categories: [ HideSpawnMenu ] + components: + - type: SpawnItemsOnUse + items: + - id: SpaceCash20000 + sound: + collection: storageRustle + - type: StaticPrice # Require since you can still sell a ship that have it on it + price: 20000 + +- type: entity + parent: SpaceCashExpedition + id: SpaceCashExpeditionT4 + name: spesos (40,000) + categories: [ HideSpawnMenu ] + components: + - type: SpawnItemsOnUse + items: + - id: SpaceCash20000 + amount: 2 + sound: + collection: storageRustle + - type: StaticPrice # Require since you can still sell a ship that have it on it + price: 40000 + +- type: entity + parent: SpaceCashExpedition + id: SpaceCashExpeditionT5 + name: spesos (70,000) + categories: [ HideSpawnMenu ] + components: + - type: SpawnItemsOnUse + items: + - id: SpaceCash25000 + amount: 2 + - id: SpaceCash20000 + sound: + collection: storageRustle + - type: StaticPrice # Require since you can still sell a ship that have it on it + price: 70000 diff --git a/Resources/Prototypes/_NF/Procedural/salvage_rewards.yml b/Resources/Prototypes/_NF/Procedural/salvage_rewards.yml new file mode 100644 index 00000000000..52bbfdcd2d8 --- /dev/null +++ b/Resources/Prototypes/_NF/Procedural/salvage_rewards.yml @@ -0,0 +1,24 @@ +- type: weightedRandomEntity + id: ExpeditionRewardT1 + weights: + SpaceCashExpeditionT1: 1.0 + +- type: weightedRandomEntity + id: ExpeditionRewardT2 + weights: + SpaceCashExpeditionT2: 1.0 + +- type: weightedRandomEntity + id: ExpeditionRewardT3 + weights: + SpaceCashExpeditionT3: 1.0 + +- type: weightedRandomEntity + id: ExpeditionRewardT4 + weights: + SpaceCashExpeditionT4: 1.0 + +- type: weightedRandomEntity + id: ExpeditionRewardT5 + weights: + SpaceCashExpeditionT5: 1.0 From 6f25f0510a3777defaadc98dcaba257b42f38806 Mon Sep 17 00:00:00 2001 From: Dmitriy <108795395+Sh1ntra@users.noreply.github.com> Date: Sun, 2 Feb 2025 00:53:15 +0300 Subject: [PATCH 2/4] Update cargo_pallet.yml --- .../Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml b/Resources/Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml index e6d8ac34341..0a684b3d094 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml @@ -5,6 +5,7 @@ parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, BaseStructure] # Frontier - BaseStructureDisabledToolsUse,BaseStructureIndestructible components: - type: InteractionOutline + - type: CargoPallet - type: Anchorable flags: - Anchorable From cd2d55ad9866aff966096066a21f17f725cf74f1 Mon Sep 17 00:00:00 2001 From: Dmitriy <108795395+Sh1ntra@users.noreply.github.com> Date: Sun, 2 Feb 2025 00:53:53 +0300 Subject: [PATCH 3/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=20?= =?UTF-8?q?=D0=BA=D0=B0=D1=80=D0=B3=D0=BE-=D0=BF=D0=B0=D0=BB=D0=BB=D0=B5?= =?UTF-8?q?=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml b/Resources/Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml index 0a684b3d094..33646cb0302 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Cargo/cargo_pallet.yml @@ -5,7 +5,7 @@ parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, BaseStructure] # Frontier - BaseStructureDisabledToolsUse,BaseStructureIndestructible components: - type: InteractionOutline - - type: CargoPallet + - type: CargoPallet # Corvax-Frontier - type: Anchorable flags: - Anchorable From b3b8c7756ce478ee8d2cabf453e9d4df49100434 Mon Sep 17 00:00:00 2001 From: FireFoxPhoenix <171633349+FireFoxPhoenix@users.noreply.github.com> Date: Sun, 2 Feb 2025 12:06:19 +1000 Subject: [PATCH 4/4] =?UTF-8?q?=D0=9F=D0=B0=D0=BB=D0=BB=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Maps/Corvax/Shuttles/Expedition/charon.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Resources/Maps/Corvax/Shuttles/Expedition/charon.yml b/Resources/Maps/Corvax/Shuttles/Expedition/charon.yml index 03f33a64384..46fa41e8901 100644 --- a/Resources/Maps/Corvax/Shuttles/Expedition/charon.yml +++ b/Resources/Maps/Corvax/Shuttles/Expedition/charon.yml @@ -2636,6 +2636,13 @@ entities: - type: Transform pos: 1.3028102,-1.328778 parent: 1 +- proto: CargoPallet + entities: + - uid: 894 + components: + - type: Transform + pos: -10.5,11.5 + parent: 1 - proto: CarpetPurple entities: - uid: 1010 @@ -6831,6 +6838,8 @@ entities: - type: Transform pos: -5.5,11.5 parent: 1 + - type: Drink + solution: tank - proto: SinkWide entities: - uid: 785 @@ -6839,6 +6848,8 @@ entities: rot: 1.5707963267948966 rad pos: -3.5,9.5 parent: 1 + - type: Drink + solution: tank - proto: SMESBasic entities: - uid: 187 @@ -8259,6 +8270,8 @@ entities: - type: Transform pos: 3.5,-11.5 parent: 1 + - type: Drink + solution: tank - proto: Window entities: - uid: 18