From 9c84ce9be078b75efba75c0a8c4191a07331a7c9 Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:28:27 +0300 Subject: [PATCH] Currency collect goal (#352) * simple currency comp * stack support + weapon cost dnd port * add collect currency objective conditions * clean up --- .../Character/CharacterUIController.cs | 4 +- .../CP14CurrencyCollectConditionComponent.cs | 26 ++++ .../CP14CurrencyCollectConditionSystem.cs | 113 ++++++++++++++++++ .../_CP14/Currency/CP14CurrencyComponent.cs | 18 +++ .../_CP14/Currency/CP14CurrencySystem.cs | 62 ++++++++++ .../en-US/_CP14/currency/currency_comp.ftl | 4 + .../_CP14/objectives/condition/expedition.ftl | 2 +- .../_CP14/objectives/condition/issuers.ftl | 1 - .../_CP14/objectives/condition/personal.ftl | 4 + .../ru-RU/_CP14/currency/currency_comp.ftl | 4 + .../_CP14/objectives/condition/issuers.ftl | 1 - .../_CP14/objectives/condition/personal.ftl | 4 + Resources/Maps/_CP14/battle_royale.yml | 12 -- .../_CP14/Entities/Objects/Economy/coins.yml | 11 ++ .../Objects/Weapons/Melee/battleHammer.yml | 2 + .../Objects/Weapons/Melee/battleStaff.yml | 4 +- .../Entities/Objects/Weapons/Melee/dagger.yml | 4 +- .../Objects/Weapons/Melee/handheldAxe.yml | 4 +- .../Objects/Weapons/Melee/lightHammer.yml | 2 + .../Entities/Objects/Weapons/Melee/mace.yml | 2 + .../Entities/Objects/Weapons/Melee/sickle.yml | 4 +- .../Entities/Objects/Weapons/Melee/sword.yml | 8 +- .../Objects/Weapons/Melee/twoHandedSword.yml | 2 + .../Objects/Weapons/Ranged/lightCrossbow.yml | 4 +- .../Prototypes/_CP14/GameRules/roundstart.yml | 3 +- .../_CP14/Objectives/personal_objectives.yml | 51 ++++++++ 26 files changed, 332 insertions(+), 24 deletions(-) create mode 100644 Content.Server/_CP14/Objectives/Components/CP14CurrencyCollectConditionComponent.cs create mode 100644 Content.Server/_CP14/Objectives/Systems/CP14CurrencyCollectConditionSystem.cs create mode 100644 Content.Shared/_CP14/Currency/CP14CurrencyComponent.cs create mode 100644 Content.Shared/_CP14/Currency/CP14CurrencySystem.cs create mode 100644 Resources/Locale/en-US/_CP14/currency/currency_comp.ftl delete mode 100644 Resources/Locale/en-US/_CP14/objectives/condition/issuers.ftl create mode 100644 Resources/Locale/en-US/_CP14/objectives/condition/personal.ftl create mode 100644 Resources/Locale/ru-RU/_CP14/currency/currency_comp.ftl delete mode 100644 Resources/Locale/ru-RU/_CP14/objectives/condition/issuers.ftl create mode 100644 Resources/Locale/ru-RU/_CP14/objectives/condition/personal.ftl create mode 100644 Resources/Prototypes/_CP14/Objectives/personal_objectives.yml diff --git a/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs b/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs index 1e4d2f2765..e18269777c 100644 --- a/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs +++ b/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs @@ -142,8 +142,8 @@ public sealed class CharacterUIController : UIController, IOnStateEntered + /// Limits the goal to collecting values from a specific category. + /// + [DataField] + public string? Category; + + [DataField(required: true)] + public LocId ObjectiveText; + + [DataField(required: true)] + public LocId ObjectiveDescription; + + [DataField(required: true)] + public SpriteSpecifier ObjectiveSprite; +} diff --git a/Content.Server/_CP14/Objectives/Systems/CP14CurrencyCollectConditionSystem.cs b/Content.Server/_CP14/Objectives/Systems/CP14CurrencyCollectConditionSystem.cs new file mode 100644 index 0000000000..3261f7d7d9 --- /dev/null +++ b/Content.Server/_CP14/Objectives/Systems/CP14CurrencyCollectConditionSystem.cs @@ -0,0 +1,113 @@ +using Content.Server._CP14.Objectives.Components; +using Content.Shared._CP14.Currency; +using Content.Shared.Mind; +using Content.Shared.Mind.Components; +using Content.Shared.Movement.Pulling.Components; +using Content.Shared.Objectives.Components; +using Content.Shared.Objectives.Systems; +using Robust.Shared.Containers; + +namespace Content.Server._CP14.Objectives.Systems; + +public sealed class CP14CurrencyCollectConditionSystem : EntitySystem +{ + [Dependency] private readonly MetaDataSystem _metaData = default!; + [Dependency] private readonly SharedObjectivesSystem _objectives = default!; + [Dependency] private readonly CP14CurrencySystem _currency = default!; + + private EntityQuery _containerQuery; + + public override void Initialize() + { + base.Initialize(); + + _containerQuery = GetEntityQuery(); + + SubscribeLocalEvent(OnAssigned); + SubscribeLocalEvent(OnAfterAssign); + SubscribeLocalEvent(OnGetProgress); + } + + private void OnAssigned(Entity condition, ref ObjectiveAssignedEvent args) + { + } + + private void OnAfterAssign(Entity condition, ref ObjectiveAfterAssignEvent args) + { + _metaData.SetEntityName(condition.Owner, Loc.GetString(condition.Comp.ObjectiveText), args.Meta); + _metaData.SetEntityDescription(condition.Owner, Loc.GetString(condition.Comp.ObjectiveDescription, ("coins", _currency.GetPrettyCurrency(condition.Comp.Currency))), args.Meta); + _objectives.SetIcon(condition.Owner, condition.Comp.ObjectiveSprite); + } + + private void OnGetProgress(Entity condition, ref ObjectiveGetProgressEvent args) + { + args.Progress = GetProgress(args.Mind, condition); + } + + private float GetProgress(MindComponent mind, CP14CurrencyCollectConditionComponent condition) + { + if (!_containerQuery.TryGetComponent(mind.OwnedEntity, out var currentManager)) + return 0; + + var containerStack = new Stack(); + var count = 0; + + //check pulling object + if (TryComp(mind.OwnedEntity, out var pull)) //TO DO: to make the code prettier? don't like the repetition + { + var pulledEntity = pull.Pulling; + if (pulledEntity != null) + { + CheckEntity(pulledEntity.Value, condition, ref containerStack, ref count); + } + } + + // recursively check each container for the item + // checks inventory, bag, implants, etc. + do + { + foreach (var container in currentManager.Containers.Values) + { + foreach (var entity in container.ContainedEntities) + { + // check if this is the item + count += CheckCurrency(entity, condition); + + // if it is a container check its contents + if (_containerQuery.TryGetComponent(entity, out var containerManager)) + containerStack.Push(containerManager); + } + } + } while (containerStack.TryPop(out currentManager)); + + var result = count / (float) condition.Currency; + result = Math.Clamp(result, 0, 1); + return result; + } + + private void CheckEntity(EntityUid entity, CP14CurrencyCollectConditionComponent condition, ref Stack containerStack, ref int counter) + { + // check if this is the item + counter += CheckCurrency(entity, condition); + + //we don't check the inventories of sentient entity + if (!TryComp(entity, out _)) + { + // if it is a container check its contents + if (_containerQuery.TryGetComponent(entity, out var containerManager)) + containerStack.Push(containerManager); + } + } + + private int CheckCurrency(EntityUid entity, CP14CurrencyCollectConditionComponent condition) + { + // check if this is the target + if (!TryComp(entity, out var target)) + return 0; + + if (target.Category != condition.Category) + return 0; + + return _currency.GetTotalCurrency(entity); + } +} diff --git a/Content.Shared/_CP14/Currency/CP14CurrencyComponent.cs b/Content.Shared/_CP14/Currency/CP14CurrencyComponent.cs new file mode 100644 index 0000000000..23285b82a3 --- /dev/null +++ b/Content.Shared/_CP14/Currency/CP14CurrencyComponent.cs @@ -0,0 +1,18 @@ +namespace Content.Shared._CP14.Currency; + +/// +/// Reflects the market value of an item, to guide players through the economy. +/// + +[RegisterComponent, Access(typeof(CP14CurrencySystem))] +public sealed partial class CP14CurrencyComponent : Component +{ + [DataField] + public int Currency = 1; + + /// + /// allows you to categorize different valuable items in order to, for example, give goals for buying weapons, or earning money specifically. + /// + [DataField] + public string? Category; +} diff --git a/Content.Shared/_CP14/Currency/CP14CurrencySystem.cs b/Content.Shared/_CP14/Currency/CP14CurrencySystem.cs new file mode 100644 index 0000000000..79d0c7dd53 --- /dev/null +++ b/Content.Shared/_CP14/Currency/CP14CurrencySystem.cs @@ -0,0 +1,62 @@ +using Content.Shared.Examine; +using Content.Shared.Stacks; + +namespace Content.Shared._CP14.Currency; + +public sealed partial class CP14CurrencySystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnExamine); + } + + private void OnExamine(Entity currency, ref ExaminedEvent args) + { + var total = GetTotalCurrency(currency, currency.Comp); + + var push = Loc.GetString("cp14-currency-examine-title"); + push += GetPrettyCurrency(total); + args.PushMarkup(push); + } + + public string GetPrettyCurrency(int currency) + { + var total = currency; + + if (total <= 0) + return string.Empty; + + var gp = total / 100; + total %= 100; + + var sp = total / 10; + total %= 10; + + var cp = total; + + var push = string.Empty; + + if (gp > 0) push += " " + Loc.GetString("cp14-currency-examine-gp", ("coin", gp)); + if (sp > 0) push += " " + Loc.GetString("cp14-currency-examine-sp", ("coin", sp)); + if (cp > 0) push += " " + Loc.GetString("cp14-currency-examine-cp", ("coin", cp)); + + return push; + } + + public int GetTotalCurrency(EntityUid uid, CP14CurrencyComponent? currency = null) + { + if (!Resolve(uid, ref currency)) + return 0; + + var total = currency.Currency; + + if (TryComp(uid, out var stack)) + { + total *= stack.Count; + } + + return total; + } +} diff --git a/Resources/Locale/en-US/_CP14/currency/currency_comp.ftl b/Resources/Locale/en-US/_CP14/currency/currency_comp.ftl new file mode 100644 index 0000000000..aea1c972b3 --- /dev/null +++ b/Resources/Locale/en-US/_CP14/currency/currency_comp.ftl @@ -0,0 +1,4 @@ +cp14-currency-examine-title = Market price: +cp14-currency-examine-gp = [color=#ebad3b]{$coin}gp[/color] +cp14-currency-examine-sp = [color=#bad1d6]{$coin}sp[/color] +cp14-currency-examine-cp = [color=#824e27]{$coin}cp[/color] \ No newline at end of file diff --git a/Resources/Locale/en-US/_CP14/objectives/condition/expedition.ftl b/Resources/Locale/en-US/_CP14/objectives/condition/expedition.ftl index 1bbd523c22..54588197e5 100644 --- a/Resources/Locale/en-US/_CP14/objectives/condition/expedition.ftl +++ b/Resources/Locale/en-US/_CP14/objectives/condition/expedition.ftl @@ -1,4 +1,4 @@ -cp14-objective-issuer-expedition = [color=#fcae38]Expedition oobjective[/color] +cp14-objective-issuer-expedition = [color=#fcae38]Expedition objective[/color] cp14-objective-expedition-collect-title = Collect { $itemName } cp14-objective-expedition-collect-desc = Your objective is to collect and deliver { $itemName } to the Elemental Ship. diff --git a/Resources/Locale/en-US/_CP14/objectives/condition/issuers.ftl b/Resources/Locale/en-US/_CP14/objectives/condition/issuers.ftl deleted file mode 100644 index 8146b593eb..0000000000 --- a/Resources/Locale/en-US/_CP14/objectives/condition/issuers.ftl +++ /dev/null @@ -1 +0,0 @@ -objective-issuer-ExpeditionObjective = [color=#d6853a]Expedition Objective[/color] \ No newline at end of file diff --git a/Resources/Locale/en-US/_CP14/objectives/condition/personal.ftl b/Resources/Locale/en-US/_CP14/objectives/condition/personal.ftl new file mode 100644 index 0000000000..556a97a0f1 --- /dev/null +++ b/Resources/Locale/en-US/_CP14/objectives/condition/personal.ftl @@ -0,0 +1,4 @@ +cp14-objective-issuer-personal = [color="#95a6c2"]Personal objectives[/color] + +cp14-objective-personal-currency-collect-title = Make money +cp14-objective-personal-currency-collect-desc = I need this expedition primarily as a way to make money. At the very least I plan on making{$coins} \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/currency/currency_comp.ftl b/Resources/Locale/ru-RU/_CP14/currency/currency_comp.ftl new file mode 100644 index 0000000000..40a8be31c7 --- /dev/null +++ b/Resources/Locale/ru-RU/_CP14/currency/currency_comp.ftl @@ -0,0 +1,4 @@ +cp14-currency-examine-title = Рыночная цена: +cp14-currency-examine-gp = [color=#ebad3b]{$coin}зм[/color] +cp14-currency-examine-sp = [color=#bad1d6]{$coin}см[/color] +cp14-currency-examine-cp = [color=#824e27]{$coin}мм[/color] \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/objectives/condition/issuers.ftl b/Resources/Locale/ru-RU/_CP14/objectives/condition/issuers.ftl deleted file mode 100644 index db0e261384..0000000000 --- a/Resources/Locale/ru-RU/_CP14/objectives/condition/issuers.ftl +++ /dev/null @@ -1 +0,0 @@ -objective-issuer-ExpeditionObjective = [color=#d6853a]Цель экспедиции[/color] \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/objectives/condition/personal.ftl b/Resources/Locale/ru-RU/_CP14/objectives/condition/personal.ftl new file mode 100644 index 0000000000..9602f4d574 --- /dev/null +++ b/Resources/Locale/ru-RU/_CP14/objectives/condition/personal.ftl @@ -0,0 +1,4 @@ +cp14-objective-issuer-personal = [color="#95a6c2"]Личные цели[/color] + +cp14-objective-personal-currency-collect-title = Заработать денег +cp14-objective-personal-currency-collect-desc = Эта экспедиция нужна мне в первую очередь как способ заработка денег. Как минимум я планирую заработать{$coins} \ No newline at end of file diff --git a/Resources/Maps/_CP14/battle_royale.yml b/Resources/Maps/_CP14/battle_royale.yml index c392829231..1f388f20bb 100644 --- a/Resources/Maps/_CP14/battle_royale.yml +++ b/Resources/Maps/_CP14/battle_royale.yml @@ -46195,7 +46195,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46226,7 +46225,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46257,7 +46255,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46288,7 +46285,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46319,7 +46315,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46350,7 +46345,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46449,7 +46443,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46480,7 +46473,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46512,7 +46504,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46543,7 +46534,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46640,7 +46630,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 @@ -46672,7 +46661,6 @@ entities: - CP14Crossbolt - CP14BaseSharpeningStone - CP14BaseSharpeningStone - - CP14Shovel - CP14OldLantern - CP14CopperCoin1 - CP14CopperCoin1 diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Economy/coins.yml b/Resources/Prototypes/_CP14/Entities/Objects/Economy/coins.yml index bf6a6ed17f..ca22853d48 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Economy/coins.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Economy/coins.yml @@ -23,6 +23,9 @@ - coin9 - coin10 - type: Appearance + - type: CP14Currency + currency: 1 + category: Currency # Copper @@ -41,6 +44,8 @@ - type: Stack stackType: CP14CopperCoin count: 10 + - type: CP14Currency + currency: 1 - type: entity id: CP14CopperCoin5 @@ -79,6 +84,8 @@ - type: Stack stackType: CP14SilverCoin count: 10 + - type: CP14Currency + currency: 10 - type: entity id: CP14SilverCoin5 @@ -117,6 +124,8 @@ - type: Stack stackType: CP14GoldCoin count: 10 + - type: CP14Currency + currency: 100 - type: entity id: CP14GoldCoin5 @@ -155,6 +164,8 @@ - type: Stack stackType: CP14PlatinumCoin count: 10 + - type: CP14Currency + currency: 1000 - type: entity id: CP14PlatinumCoin5 diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/battleHammer.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/battleHammer.yml index 2ebfe1a26c..023151cc63 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/battleHammer.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/battleHammer.yml @@ -57,3 +57,5 @@ params: variation: 0.03 volume: 2 + - type: CP14Currency + currency: 1500 diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/battleStaff.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/battleStaff.yml index 5ae929320f..4ea47867dc 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/battleStaff.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/battleStaff.yml @@ -35,4 +35,6 @@ soundHit: collection: MetalThud cPAnimationLength: 0.3 - cPAnimationOffset: -1.3 \ No newline at end of file + cPAnimationOffset: -1.3 + - type: CP14Currency + currency: 20 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/dagger.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/dagger.yml index d9099f023e..617a5be796 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/dagger.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/dagger.yml @@ -41,4 +41,6 @@ offset: 0.15,0.15 removalTime: 1 - type: ThrowingAngle - angle: 225 \ No newline at end of file + angle: 225 + - type: CP14Currency + currency: 200 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/handheldAxe.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/handheldAxe.yml index a8d432d882..034501fbae 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/handheldAxe.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/handheldAxe.yml @@ -40,4 +40,6 @@ damage: types: Slash: 5 - Piercing: 5 \ No newline at end of file + Piercing: 5 + - type: CP14Currency + currency: 500 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/lightHammer.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/lightHammer.yml index f234652f3e..209679d725 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/lightHammer.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/lightHammer.yml @@ -42,3 +42,5 @@ params: variation: 0.03 volume: 2 + - type: CP14Currency + currency: 200 diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/mace.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/mace.yml index 268d0168c8..f207b416c1 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/mace.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/mace.yml @@ -34,3 +34,5 @@ damage: types: Blunt: 10 + - type: CP14Currency + currency: 500 diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/sickle.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/sickle.yml index 8a8b96f042..6fe17bbce2 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/sickle.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/sickle.yml @@ -38,4 +38,6 @@ collection: MetalThud - type: Tag tags: - - CP14HerbalGathering \ No newline at end of file + - CP14HerbalGathering + - type: CP14Currency + currency: 100 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/sword.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/sword.yml index 0c9dcca964..92d9445ca7 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/sword.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/sword.yml @@ -33,4 +33,10 @@ types: Slash: 12 soundHit: - collection: MetalThud \ No newline at end of file + collection: MetalThud + - type: CP14SkillRequirement + fuckupChance: 0.5 + requiredSkills: + - Warcraft + - type: CP14Currency + currency: 1200 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/twoHandedSword.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/twoHandedSword.yml index 66368aa6df..fe9d17fd06 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/twoHandedSword.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Melee/twoHandedSword.yml @@ -48,6 +48,8 @@ fuckupChance: 0.5 requiredSkills: - Warcraft + - type: CP14Currency + currency: 5000 - type: entity id: CP14TwoHandedSwordScythe diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Ranged/lightCrossbow.yml b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Ranged/lightCrossbow.yml index d3addb703b..fa46327400 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Ranged/lightCrossbow.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Weapons/Ranged/lightCrossbow.yml @@ -51,4 +51,6 @@ unwielded-arrow: whitelist: tags: - - CP14CrossbowBolt \ No newline at end of file + - CP14CrossbowBolt + - type: CP14Currency + currency: 2500 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/GameRules/roundstart.yml b/Resources/Prototypes/_CP14/GameRules/roundstart.yml index d6a9f5cd1d..c4b42538f0 100644 --- a/Resources/Prototypes/_CP14/GameRules/roundstart.yml +++ b/Resources/Prototypes/_CP14/GameRules/roundstart.yml @@ -13,7 +13,8 @@ components: - type: CP14ExpeditionObjectivesRule objectives: - - CP14ExpeditionCollectGoldObjective + #- CP14ExpeditionCollectGoldObjective + - CP14PersonalCurrencyCollectObjectiveMedium # Expedition random objectives # main objective + sub objective? # motivations diff --git a/Resources/Prototypes/_CP14/Objectives/personal_objectives.yml b/Resources/Prototypes/_CP14/Objectives/personal_objectives.yml new file mode 100644 index 0000000000..d9b425932d --- /dev/null +++ b/Resources/Prototypes/_CP14/Objectives/personal_objectives.yml @@ -0,0 +1,51 @@ +- type: entity + abstract: true + parent: BaseObjective + id: CP14BasePersonalObjective + components: + - type: Objective + issuer: cp14-objective-issuer-personal + difficulty: 1 + +- type: entity + parent: CP14BasePersonalObjective + abstract: true + id: CP14BasePersonalCurrencyCollectObjective + components: + - type: Objective + difficulty: 0 + - type: CP14CurrencyCollectCondition + currency: 10 + category: Currency + objectiveText: cp14-objective-personal-currency-collect-title + objectiveDescription: cp14-objective-personal-currency-collect-desc + objectiveSprite: + sprite: /Textures/_CP14/Objects/Economy/gp_coin.rsi + state: coin10 + +- type: entity + parent: CP14BasePersonalCurrencyCollectObjective + id: CP14PersonalCurrencyCollectObjectiveSmall + components: + - type: Objective + difficulty: 0.5 + - type: CP14CurrencyCollectCondition + currency: 500 + +- type: entity + parent: CP14BasePersonalCurrencyCollectObjective + id: CP14PersonalCurrencyCollectObjectiveMedium + components: + - type: Objective + difficulty: 1 + - type: CP14CurrencyCollectCondition + currency: 1000 + +- type: entity + parent: CP14BasePersonalCurrencyCollectObjective + id: CP14PersonalCurrencyCollectObjectiveBig + components: + - type: Objective + difficulty: 3 + - type: CP14CurrencyCollectCondition + currency: 3000 \ No newline at end of file