Skip to content

Commit

Permalink
Merge branch 'Corvax-Frontier:master' into CvarFrontier
Browse files Browse the repository at this point in the history
  • Loading branch information
percent-temp-percent authored Feb 3, 2025
2 parents e1f8a66 + 39dee68 commit 747ecd8
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 61 deletions.
42 changes: 19 additions & 23 deletions Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, int>();
foreach (var reward in mission.Rewards)
{
var name = _prototype.Index<EntityPrototype>(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<string, int>();
foreach (var reward in mission.Rewards)
{
var name = _prototype.Index<EntityPrototype>(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()
{
Expand Down
72 changes: 34 additions & 38 deletions Content.Shared/Salvage/SharedSalvageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,48 +181,44 @@ public T GetMod<T>(System.Random rand, ref float rating) where T : class, IProto
private List<string> GetRewards(DifficultyRating difficulty, System.Random rand)
{
var rewards = new List<string>(3);
// Frontier : Removed rewards
//var ids = RewardsForDifficulty(difficulty);
// foreach (var id in ids)
// {
// // pick a random reward to give
// var weights = _proto.Index<WeightedRandomEntityPrototype>(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<WeightedRandomEntityPrototype>(id);
rewards.Add(weights.Pick(rand));
}

return rewards;
}

/**
* Frontier: Removed rewards
*/
// /// <summary>
// /// 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
// /// </summary>
// 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();
// }
// }
/// <summary>
/// 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
/// </summary>
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]
Expand Down
13 changes: 13 additions & 0 deletions Resources/Maps/Corvax/Shuttles/Expedition/charon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -6831,6 +6838,8 @@ entities:
- type: Transform
pos: -5.5,11.5
parent: 1
- type: Drink
solution: tank
- proto: SinkWide
entities:
- uid: 785
Expand All @@ -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
Expand Down Expand Up @@ -8259,6 +8270,8 @@ entities:
- type: Transform
pos: 3.5,-11.5
parent: 1
- type: Drink
solution: tank
- proto: Window
entities:
- uid: 18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
parent: [BaseStructureDisableToolUse, BaseStructureIndestructible, BaseStructure] # Frontier - BaseStructureDisabledToolsUse,BaseStructureIndestructible
components:
- type: InteractionOutline
- type: CargoPallet # Corvax-Frontier
- type: Anchorable
flags:
- Anchorable
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/Procedural/salvage_rewards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -62,3 +69,7 @@
# rare chemicals
CognizineChemistryBottle: 1.0
OmnizineChemistryBottle: 1.0
# money
SpaceCash2500: 1.0
SpaceCash5000: 0.75
SpaceCash10000: 0.5
89 changes: 89 additions & 0 deletions Resources/Prototypes/_NF/Catalog/Fills/Items/briefcases.yml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions Resources/Prototypes/_NF/Procedural/salvage_rewards.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 747ecd8

Please sign in to comment.