From: alexalexmax <149889301+alexalexmax@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:21:52 +0000 (-0800) Subject: Add Changeling DNA store (#41632) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=cf619a9ab2ca8b903e7e4416a3802bf67029ec72;p=space-station-14.git 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> --- diff --git a/Content.Server/Store/Systems/StoreSystem.Ui.cs b/Content.Server/Store/Systems/StoreSystem.Ui.cs index c3d37a74b8..cd9059b1db 100644 --- a/Content.Server/Store/Systems/StoreSystem.Ui.cs +++ b/Content.Server/Store/Systems/StoreSystem.Ui.cs @@ -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); diff --git a/Content.Shared/Store/ListingPrototype.cs b/Content.Shared/Store/ListingPrototype.cs index 4d01f91c44..7e92c6c5d6 100644 --- a/Content.Shared/Store/ListingPrototype.cs +++ b/Content.Shared/Store/ListingPrototype.cs @@ -40,7 +40,8 @@ public partial class ListingData : IEquatable other.OriginalCost, other.RestockTime, other.DiscountDownTo, - other.DisableRefund + other.DisableRefund, + other.ApplyToMob ) { @@ -65,7 +66,8 @@ public partial class ListingData : IEquatable IReadOnlyDictionary, FixedPoint2> originalCost, TimeSpan restockTime, Dictionary, FixedPoint2> dataDiscountDownTo, - bool disableRefund + bool disableRefund, + bool applyToMob ) { Name = name; @@ -87,6 +89,7 @@ public partial class ListingData : IEquatable RestockTime = restockTime; DiscountDownTo = new Dictionary, FixedPoint2>(dataDiscountDownTo); DisableRefund = disableRefund; + ApplyToMob = applyToMob; } [ViewVariables] @@ -203,6 +206,12 @@ public partial class ListingData : IEquatable [DataField] public bool DisableRefund = false; + /// + /// Whether or not to apply the store listing to the player mob rather than the player mind. + /// + [DataField] + public bool ApplyToMob = false; + public bool Equals(ListingData? listing) { if (listing == null) @@ -215,7 +224,9 @@ public partial class ListingData : IEquatable 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 ) { } diff --git a/Resources/Locale/en-US/store/changeling-catalog.ftl b/Resources/Locale/en-US/store/changeling-catalog.ftl new file mode 100644 index 0000000000..eb7795ff36 --- /dev/null +++ b/Resources/Locale/en-US/store/changeling-catalog.ftl @@ -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. diff --git a/Resources/Locale/en-US/store/currency.ftl b/Resources/Locale/en-US/store/currency.ftl index 1ba66e6481..3f1ddebc2c 100644 --- a/Resources/Locale/en-US/store/currency.ftl +++ b/Resources/Locale/en-US/store/currency.ftl @@ -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 diff --git a/Resources/Locale/en-US/store/store.ftl b/Resources/Locale/en-US/store/store.ftl index 6fce1bcaa0..9a9d75f4c0 100644 --- a/Resources/Locale/en-US/store/store.ftl +++ b/Resources/Locale/en-US/store/store.ftl @@ -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 diff --git a/Resources/Prototypes/Actions/changeling.yml b/Resources/Prototypes/Actions/changeling.yml index 6e4ec6db6c..6382f4c837 100644 --- a/Resources/Prototypes/Actions/changeling.yml +++ b/Resources/Prototypes/Actions/changeling.yml @@ -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. diff --git a/Resources/Prototypes/Catalog/changeling_catalog.yml b/Resources/Prototypes/Catalog/changeling_catalog.yml new file mode 100644 index 0000000000..dea0f908eb --- /dev/null +++ b/Resources/Prototypes/Catalog/changeling_catalog.yml @@ -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 diff --git a/Resources/Prototypes/Entities/Mobs/Player/changeling.yml b/Resources/Prototypes/Entities/Mobs/Player/changeling.yml index d8d4aac742..6ee9de8d01 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/changeling.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/changeling.yml @@ -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 diff --git a/Resources/Prototypes/GameRules/roundstart.yml b/Resources/Prototypes/GameRules/roundstart.yml index 80e8aba005..b8f183e874 100644 --- a/Resources/Prototypes/GameRules/roundstart.yml +++ b/Resources/Prototypes/GameRules/roundstart.yml @@ -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 diff --git a/Resources/Prototypes/Store/categories.yml b/Resources/Prototypes/Store/categories.yml index b3c358d388..cb11de7848 100644 --- a/Resources/Prototypes/Store/categories.yml +++ b/Resources/Prototypes/Store/categories.yml @@ -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 diff --git a/Resources/Prototypes/Store/currency.yml b/Resources/Prototypes/Store/currency.yml index 0173de62f9..ae2b183345 100644 --- a/Resources/Prototypes/Store/currency.yml +++ b/Resources/Prototypes/Store/currency.yml @@ -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 diff --git a/Resources/Prototypes/Store/presets.yml b/Resources/Prototypes/Store/presets.yml index 762ed68921..de7717877d 100644 --- a/Resources/Prototypes/Store/presets.yml +++ b/Resources/Prototypes/Store/presets.yml @@ -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