Add Changeling DNA store (#41632)

* created changeling dna currency and locale currency name

* created changeling store category, created changeling-catalog.ftl

* added store and action to Urist McLing

* found the entity

* make armblade a purchase

* comment

* created ApplyToMob datafield and applied to armblade

* ApplyToMob check in storesystem

* Update Resources/Prototypes/Catalog/changeling_catalog.yml

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
alexalexmax
2025-12-01 04:21:52 -08:00
committed by GitHub
parent 3eae394d24
commit cf619a9ab2
12 changed files with 89 additions and 8 deletions

View File

@@ -202,7 +202,7 @@ public sealed partial class StoreSystem
EntityUid? actionId;
// I guess we just allow duplicate actions?
// Allow duplicate actions and just have a single list buy for the buy-once ones.
if (!_mind.TryGetMind(buyer, out var mind, out _))
if (listing.ApplyToMob || !_mind.TryGetMind(buyer, out var mind, out _))
actionId = _actions.AddAction(buyer, listing.ProductAction);
else
actionId = _actionContainer.AddAction(mind, listing.ProductAction);

View File

@@ -40,7 +40,8 @@ public partial class ListingData : IEquatable<ListingData>
other.OriginalCost,
other.RestockTime,
other.DiscountDownTo,
other.DisableRefund
other.DisableRefund,
other.ApplyToMob
)
{
@@ -65,7 +66,8 @@ public partial class ListingData : IEquatable<ListingData>
IReadOnlyDictionary<ProtoId<CurrencyPrototype>, FixedPoint2> originalCost,
TimeSpan restockTime,
Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> dataDiscountDownTo,
bool disableRefund
bool disableRefund,
bool applyToMob
)
{
Name = name;
@@ -87,6 +89,7 @@ public partial class ListingData : IEquatable<ListingData>
RestockTime = restockTime;
DiscountDownTo = new Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2>(dataDiscountDownTo);
DisableRefund = disableRefund;
ApplyToMob = applyToMob;
}
[ViewVariables]
@@ -203,6 +206,12 @@ public partial class ListingData : IEquatable<ListingData>
[DataField]
public bool DisableRefund = false;
/// <summary>
/// Whether or not to apply the store listing to the player mob rather than the player mind.
/// </summary>
[DataField]
public bool ApplyToMob = false;
public bool Equals(ListingData? listing)
{
if (listing == null)
@@ -215,7 +224,9 @@ public partial class ListingData : IEquatable<ListingData>
ProductEntity != listing.ProductEntity ||
ProductAction != listing.ProductAction ||
ProductEvent?.GetType() != listing.ProductEvent?.GetType() ||
RestockTime != listing.RestockTime)
RestockTime != listing.RestockTime ||
DisableRefund != listing.DisableRefund ||
ApplyToMob != listing.ApplyToMob)
return false;
if (Icon != null && !Icon.Equals(listing.Icon))
@@ -296,7 +307,8 @@ public sealed partial class ListingDataWithCostModifiers : ListingData
listingData.OriginalCost,
listingData.RestockTime,
listingData.DiscountDownTo,
listingData.DisableRefund
listingData.DisableRefund,
listingData.ApplyToMob
)
{
}

View File

@@ -0,0 +1,2 @@
changeling-arm-blade-name = Retractable Arm Blade
changeling-arm-blade-desc = Transform your arm into a terrifying flesh blade. Can be toggled.

View File

@@ -11,3 +11,4 @@ store-currency-display-telecrystal = TC
store-currency-display-stolen-essence = Stolen Essence
store-currency-display-silicon-memory = Memory
store-currency-display-wizcoin = Wiz€oin™
store-currency-display-dna = DNA

View File

@@ -14,3 +14,4 @@ store-not-account-owner = This {$store} is not bound to you!
store-preset-name-uplink = Uplink
store-preset-name-spellbook = Spellbook
store-preset-name-changeling = DNA Store

View File

@@ -42,3 +42,9 @@
icon: { sprite : Interface/Actions/changeling.rsi, state: "transform" }
- type: InstantAction
event: !type:ChangelingTransformActionEvent
- type: entity
parent: ActionIntrinsicStore
id: ActionChangelingStore
name: DNA Store
description: Opens the ability store.

View File

@@ -0,0 +1,15 @@
# Abilities
- type: listing
id: ChangelingArmBlade
name: changeling-arm-blade-name
description: changeling-arm-blade-desc
productAction: ActionRetractableItemArmBlade
applyToMob: true
cost:
ChangelingDNA: 25
categories:
- ChangelingAbilities
conditions:
- !type:ListingLimitedStockCondition
stock: 1

View File

@@ -1,5 +1,5 @@
- type: entity
parent: MobHuman
parent: [ MobHuman, StorePresetChangeling ]
id: MobLing
name: Urist McLing
suffix: Non-Antag
@@ -9,4 +9,12 @@
- type: ChangelingTransform
- type: ActionGrant
actions:
- ActionRetractableItemArmBlade # Temporary addition, will inevitably be a purchasable in the bio-store
- ActionChangelingStore
- type: Store
balance:
ChangelingDNA: 50
- type: UserInterface
interfaces:
enum.StoreUiKey.Key:
type: StoreBoundUserInterface
requireInputValidation: false

View File

@@ -276,7 +276,21 @@
- type: ChangelingTransform
- type: ActionGrant
actions:
- ActionRetractableItemArmBlade # Temporary addition, will inevitably be a purchasable in the bio-store
- ActionChangelingStore
# TODO: Make it so the changeling gamerule changeling can inherit from the changeling store preset somehow
- type: Store
name: store-preset-name-changeling
categories:
- ChangelingAbilities
currencyWhitelist:
- ChangelingDNA
balance:
ChangelingDNA: 50
- type: UserInterface
interfaces:
enum.StoreUiKey.Key:
type: StoreBoundUserInterface
requireInputValidation: false
mindRoles:
- MindRoleChangeling
- type: AntagObjectives

View File

@@ -99,6 +99,12 @@
id: PAIAbilities
name: store-category-abilities
#changeling
#todo: add actual categories when changeling design/abilities are fleshed out
- type: storeCategory
id: ChangelingAbilities
name: store-category-abilities
- type: storeCategory
id: DiscountedItems
name: store-discounted-items

View File

@@ -20,6 +20,11 @@
displayName: store-currency-display-wizcoin
canWithdraw: false
- type: currency
id: ChangelingDNA
displayName: store-currency-display-dna
canWithdraw: false
#debug
- type: currency
id: DebugDollar

View File

@@ -35,3 +35,14 @@
- SpellbookEvents #Summon Weapons, Summon Ghosts
currencyWhitelist:
- WizCoin
- type: entity
id: StorePresetChangeling
abstract: true
components:
- type: Store
name: store-preset-name-changeling
categories:
- ChangelingAbilities
currencyWhitelist:
- ChangelingDNA