]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add Changeling DNA store (#41632)
authoralexalexmax <149889301+alexalexmax@users.noreply.github.com>
Mon, 1 Dec 2025 12:21:52 +0000 (04:21 -0800)
committerGitHub <noreply@github.com>
Mon, 1 Dec 2025 12:21:52 +0000 (12:21 +0000)
* 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>
12 files changed:
Content.Server/Store/Systems/StoreSystem.Ui.cs
Content.Shared/Store/ListingPrototype.cs
Resources/Locale/en-US/store/changeling-catalog.ftl [new file with mode: 0644]
Resources/Locale/en-US/store/currency.ftl
Resources/Locale/en-US/store/store.ftl
Resources/Prototypes/Actions/changeling.yml
Resources/Prototypes/Catalog/changeling_catalog.yml [new file with mode: 0644]
Resources/Prototypes/Entities/Mobs/Player/changeling.yml
Resources/Prototypes/GameRules/roundstart.yml
Resources/Prototypes/Store/categories.yml
Resources/Prototypes/Store/currency.yml
Resources/Prototypes/Store/presets.yml

index c3d37a74b87ee45cf1ed1d34cbcdaf1ac860ebbd..cd9059b1db2ea2306bad5d5c41916079f03dfe68 100644 (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);
index 4d01f91c44cd1afd02436a9f8841548cd76cd2a0..7e92c6c5d630c8b505e22fe5ed5d4fd8cbbb2bd0 100644 (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
         )
     {
     }
diff --git a/Resources/Locale/en-US/store/changeling-catalog.ftl b/Resources/Locale/en-US/store/changeling-catalog.ftl
new file mode 100644 (file)
index 0000000..eb7795f
--- /dev/null
@@ -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.
index 1ba66e64813d68e7f469df7e6a8cde09bbec940a..3f1ddebc2ceadd28b9a6d4aeb1e2639ad756ee88 100644 (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
index 6fce1bcaa096e1623d40702f6f3deec0c2362fa1..9a9d75f4c05c974e20b08ebe040b2ae62c463100 100644 (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
index 6e4ec6db6c492998f20be767ac79e5c580b7ab3b..6382f4c8375c34dc619f15feb4f3eef928b33a99 100644 (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.
diff --git a/Resources/Prototypes/Catalog/changeling_catalog.yml b/Resources/Prototypes/Catalog/changeling_catalog.yml
new file mode 100644 (file)
index 0000000..dea0f90
--- /dev/null
@@ -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
index d8d4aac742484f07c0080e28184162d77f46f26a..6ee9de8d01e83d310a08ed586564e95e420839cb 100644 (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
index 80e8aba005ed70c90e774b3d74ffb91f73e161b8..b8f183e8749194f4928f26443cc9b33936d868f8 100644 (file)
       - 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
index b3c358d3889390e04e8ea22778d5d94895d38096..cb11de7848f5fd6b9dcb40849512a25506068f2b 100644 (file)
   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
index 0173de62f973232aace6f894ee4e999cd0a0d4fb..ae2b183345742b8da693f0475d7080cdec8b22d4 100644 (file)
   displayName: store-currency-display-wizcoin
   canWithdraw: false
 
+- type: currency
+  id: ChangelingDNA
+  displayName: store-currency-display-dna
+  canWithdraw: false
+
 #debug
 - type: currency
   id: DebugDollar
index 762ed68921aa8989928ea6a86f30b911460e8d7a..de7717877dcce7eced8a3463a486b630fe6f270f 100644 (file)
     - 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