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 BarryNorfolk
parent 5fbeecb011
commit 1bba368d22
12 changed files with 89 additions and 8 deletions

View File

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

View File

@ -40,7 +40,8 @@ public partial class ListingData : IEquatable<ListingData>
other.OriginalCost, other.OriginalCost,
other.RestockTime, other.RestockTime,
other.DiscountDownTo, other.DiscountDownTo,
other.DisableRefund other.DisableRefund,
other.ApplyToMob
) )
{ {
@ -65,7 +66,8 @@ public partial class ListingData : IEquatable<ListingData>
IReadOnlyDictionary<ProtoId<CurrencyPrototype>, FixedPoint2> originalCost, IReadOnlyDictionary<ProtoId<CurrencyPrototype>, FixedPoint2> originalCost,
TimeSpan restockTime, TimeSpan restockTime,
Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> dataDiscountDownTo, Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> dataDiscountDownTo,
bool disableRefund bool disableRefund,
bool applyToMob
) )
{ {
Name = name; Name = name;
@ -87,6 +89,7 @@ public partial class ListingData : IEquatable<ListingData>
RestockTime = restockTime; RestockTime = restockTime;
DiscountDownTo = new Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2>(dataDiscountDownTo); DiscountDownTo = new Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2>(dataDiscountDownTo);
DisableRefund = disableRefund; DisableRefund = disableRefund;
ApplyToMob = applyToMob;
} }
[ViewVariables] [ViewVariables]
@ -203,6 +206,12 @@ public partial class ListingData : IEquatable<ListingData>
[DataField] [DataField]
public bool DisableRefund = false; 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) public bool Equals(ListingData? listing)
{ {
if (listing == null) if (listing == null)
@ -215,7 +224,9 @@ public partial class ListingData : IEquatable<ListingData>
ProductEntity != listing.ProductEntity || ProductEntity != listing.ProductEntity ||
ProductAction != listing.ProductAction || ProductAction != listing.ProductAction ||
ProductEvent?.GetType() != listing.ProductEvent?.GetType() || ProductEvent?.GetType() != listing.ProductEvent?.GetType() ||
RestockTime != listing.RestockTime) RestockTime != listing.RestockTime ||
DisableRefund != listing.DisableRefund ||
ApplyToMob != listing.ApplyToMob)
return false; return false;
if (Icon != null && !Icon.Equals(listing.Icon)) if (Icon != null && !Icon.Equals(listing.Icon))
@ -296,7 +307,8 @@ public sealed partial class ListingDataWithCostModifiers : ListingData
listingData.OriginalCost, listingData.OriginalCost,
listingData.RestockTime, listingData.RestockTime,
listingData.DiscountDownTo, 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-stolen-essence = Stolen Essence
store-currency-display-silicon-memory = Memory store-currency-display-silicon-memory = Memory
store-currency-display-wizcoin = Wiz€oin™ 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-uplink = Uplink
store-preset-name-spellbook = Spellbook 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" } icon: { sprite : Interface/Actions/changeling.rsi, state: "transform" }
- type: InstantAction - type: InstantAction
event: !type:ChangelingTransformActionEvent 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 - type: entity
parent: MobHuman parent: [ MobHuman, StorePresetChangeling ]
id: MobLing id: MobLing
name: Urist McLing name: Urist McLing
suffix: Non-Antag suffix: Non-Antag
@ -9,4 +9,12 @@
- type: ChangelingTransform - type: ChangelingTransform
- type: ActionGrant - type: ActionGrant
actions: 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

@ -286,7 +286,21 @@
- type: ChangelingTransform - type: ChangelingTransform
- type: ActionGrant - type: ActionGrant
actions: 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: mindRoles:
- MindRoleChangeling - MindRoleChangeling
- type: AntagObjectives - type: AntagObjectives

View File

@ -99,6 +99,12 @@
id: PAIAbilities id: PAIAbilities
name: store-category-abilities 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 - type: storeCategory
id: DiscountedItems id: DiscountedItems
name: store-discounted-items name: store-discounted-items

View File

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

View File

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