From d47d9339670ddd8d7b3862c643ab1e309a17584c Mon Sep 17 00:00:00 2001 From: 21Melkuu <79728504+21Melkuu@users.noreply.github.com> Date: Thu, 26 Dec 2024 12:03:01 +0300 Subject: [PATCH] BonusForFullyDiscovered (#2376) * smile * fixicki * 123 * oops * ooops * pullim * fix * Update Resources/Locale/ru-RU/prototypes/entities/objects/blueprint/blueprint.ftl Co-authored-by: Svarshik <96281939+lexaSvarshik@users.noreply.github.com> * Update Resources/Locale/ru-RU/prototypes/entities/objects/blueprint/blueprint.ftl Co-authored-by: Svarshik <96281939+lexaSvarshik@users.noreply.github.com> * ftl * rev --------- Co-authored-by: Svarshik <96281939+lexaSvarshik@users.noreply.github.com> --- .../XenoArtifacts/ArtifactComponent.cs | 13 ++ .../XenoArtifacts/ArtifactSystem.cs | 39 +++++ .../entities/objects/blueprint/blueprint.ftl | 47 ++++++ .../Xenoarchaeology/item_artifacts.yml | 39 +++++ .../Xenoarchaeology/structure_artifacts.yml | 42 ++++- .../Entities/Objects/Tools/blueprint.yml | 159 ++++++++++++++++++ .../SS220/Recipes/Lathes/devices.yml | 12 +- .../SS220/Recipes/Lathes/electronics.yml | 32 ++++ .../Prototypes/SS220/Recipes/Lathes/misc.yml | 47 ++++++ .../Prototypes/SS220/Recipes/Lathes/tools.yml | 40 +++++ 10 files changed, 467 insertions(+), 3 deletions(-) create mode 100644 Resources/Locale/ru-RU/prototypes/entities/objects/blueprint/blueprint.ftl create mode 100644 Resources/Prototypes/SS220/Entities/Objects/Tools/blueprint.yml create mode 100644 Resources/Prototypes/SS220/Recipes/Lathes/tools.yml diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactComponent.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactComponent.cs index 4afd8af21cfdf9..2a3012baa8ed39 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactComponent.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactComponent.cs @@ -2,6 +2,8 @@ using Robust.Shared.Audio; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; +using Robust.Shared.Prototypes; namespace Content.Server.Xenoarchaeology.XenoArtifacts; @@ -93,6 +95,17 @@ public sealed partial class ArtifactComponent : Component }; [DataField("activateActionEntity")] public EntityUid? ActivateActionEntity; + + // SS220-BonusForFullyDiscovered - start + + [ViewVariables] + public bool IsBonusIssued = false; + + [DataField("bonusPrototype", customTypeSerializer: typeof(PrototypeIdListSerializer)), ViewVariables] + public List? BonusPrototype; + + // SS220-BonusForFullyDiscovered - end + } /// diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs index 6ddcd56abd82f6..d4f28e2560b164 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs @@ -16,6 +16,7 @@ using Robust.Shared.Random; using Robust.Shared.Serialization.Manager; using Robust.Shared.Timing; +using Content.Shared.Throwing; ///ss220-BonusForFullyDiscovered namespace Content.Server.Xenoarchaeology.XenoArtifacts; @@ -27,6 +28,7 @@ public sealed partial class ArtifactSystem : EntitySystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly ISerializationManager _serialization = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly ThrowingSystem _throwing = default!; ///ss220-BonusForFullyDiscovered public override void Initialize() { @@ -193,6 +195,23 @@ public void ForceActivateArtifact(EntityUid uid, EntityUid? user = null, Artifac return; EnterNode(uid, ref newNode, component); + + // SS220-BonusForFullyDiscovered - start + + var countPassedNode = 0; + foreach (var node in component.NodeTree) + { + if (node.Discovered && node.Triggered) + countPassedNode++; + } + + if (countPassedNode == component.NodeTree.Count && !component.IsBonusIssued) + { + component.IsBonusIssued = true; + SpawnBonus(uid, component); + } + + // SS220-BonusForFullyDiscovered - end } private ArtifactNode? GetNewNode(EntityUid uid, ArtifactComponent component) @@ -296,4 +315,24 @@ public ArtifactNode GetRootNode(List allNodes) { return allNodes.First(n => n.Depth == 0); } + + // SS220-BonusForFullyDiscovered - start + + private void SpawnBonus(EntityUid uid, ArtifactComponent component) + { + if (component.BonusPrototype == null) + return; + + var protoId = _random.Pick(component.BonusPrototype); + if(!TrySpawnNextTo(protoId, uid, out var protoUid)) + return; + + var xform = Transform(protoUid.Value); + var throwing = xform.LocalRotation.ToWorldVec() * 5f; // magic number throwing force + var direction = xform.Coordinates.Offset(throwing); + + _throwing.TryThrow(protoUid.Value, direction); + } + + // SS220-BonusForFullyDiscovered - end } diff --git a/Resources/Locale/ru-RU/prototypes/entities/objects/blueprint/blueprint.ftl b/Resources/Locale/ru-RU/prototypes/entities/objects/blueprint/blueprint.ftl new file mode 100644 index 00000000000000..a5fb6dd2349677 --- /dev/null +++ b/Resources/Locale/ru-RU/prototypes/entities/objects/blueprint/blueprint.ftl @@ -0,0 +1,47 @@ +ent-BlueprintBeltChiefEngineer = чертёж пояса Старшего Инженера + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintSuperSynthesizerInstrument = чертёж супер синтезатора + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintFultonBeacon = чертёж маяка фултона + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintWallmountGeneratorAPUElectronics = чертёж микросхемы настенной ВСУ + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintClothingBeltMilitaryWebbing = чертёж армейской РПС + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintWeaponCrusher = чертёж крушителя + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintWeaponCrusherGlaive = чертёж глефы-крушителя + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintJetpackVoid = чертёж пустотного джетпака + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintToySword = чертёж игрушечного меча + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintDoubleToySword = чертёж игрушечный двухклинкового меча + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintWelderIndustrial = чертёж промышленного сварочного аппарата + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintWelderIndustrialAdvanced = чертёж продвинутого промышленного сварочного аппарата + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintSawAdvanced = чертёж улучшенной циркулярной пилы + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintGlowstickBlue = чертёж синего химсвета + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintSyndicateMicrowaveMachineCircuitboard = чертёж платы микроволновки Donk co. + .desc = { ent-BaseBlueprint.desc } + +ent-BlueprintPowerCellHyperPrinted = чертёж батареи гипер ёмкости + .desc = { ent-BaseBlueprint.desc } \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml index 2241cdd4aa09b1..b80062e3272b03 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/item_artifacts.yml @@ -36,6 +36,45 @@ restitution: 0.3 # fite me friction: 0.2 - type: Artifact + bonusPrototype: # SS220-BonusForFullyDiscovered - start + - BlueprintBeltChiefEngineer + - BlueprintSeismicCharge + - BlueprintFulton + - BlueprintSuperSynthesizerInstrument + - BlueprintFultonBeacon + - BlueprintClothingBeltMilitaryWebbing + - BlueprintWallmountGeneratorAPUElectronics + - BlueprintWeaponCrusher + - BlueprintWeaponCrusherGlaive + - BlueprintJetpackVoid + - BlueprintToySword + - BlueprintDoubleToySword + - BlueprintWelderIndustrial + - BlueprintWelderIndustrialAdvanced + - BlueprintSawAdvanced + - BlueprintGlowstickBlue + - BlueprintSyndicateMicrowaveMachineCircuitboard + - BlueprintPowerCellHyperPrinted + - ClothingOuterCoatExpensive + - PowerCellAntiqueProto + - MetalFoamGrenade + - WeaponLaserGun + - FireAxe + - ClothingHeadHatChameleon + - UsspPDA + - SyndiPDA + - SoapOmega + - ClothingOuterCoatExpensive + - ClothingBackpackERTSecurity + - WeaponTeslaGun + - Chainsaw + - EnergyDaggerLoud + - BorgModuleSyndicateWeapon + - WeaponMeleeToolboxRobust + - PresentRandomUnsafe + - TeslaToy + - ClothingHeadHatCatEars + - DnaScramblerImplanter # SS220-BonusForFullyDiscovered - end - type: RandomArtifactSprite maxSprite: 11 activationTime: 2.4 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml index 68947c0a71b5ea..825207d1cf3ea2 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/structure_artifacts.yml @@ -46,6 +46,45 @@ - MachineMask - type: InteractionOutline - type: Artifact + bonusPrototype: # SS220-BonusForFullyDiscovered - start + - BlueprintBeltChiefEngineer + - BlueprintSeismicCharge + - BlueprintFulton + - BlueprintSuperSynthesizerInstrument + - BlueprintFultonBeacon + - BlueprintClothingBeltMilitaryWebbing + - BlueprintWallmountGeneratorAPUElectronics + - BlueprintWeaponCrusher + - BlueprintWeaponCrusherGlaive + - BlueprintJetpackVoid + - BlueprintToySword + - BlueprintDoubleToySword + - BlueprintWelderIndustrial + - BlueprintWelderIndustrialAdvanced + - BlueprintSawAdvanced + - BlueprintGlowstickBlue + - BlueprintSyndicateMicrowaveMachineCircuitboard + - BlueprintPowerCellHyperPrinted + - ClothingOuterCoatExpensive + - PowerCellAntiqueProto + - MetalFoamGrenade + - WeaponLaserGun + - FireAxe + - ClothingHeadHatChameleon + - UsspPDA + - SyndiPDA + - SoapOmega + - ClothingOuterCoatExpensive + - ClothingBackpackERTSecurity + - WeaponTeslaGun + - Chainsaw + - EnergyDaggerLoud + - BorgModuleSyndicateWeapon + - WeaponMeleeToolboxRobust + - PresentRandomUnsafe + - TeslaToy + - ClothingHeadHatCatEars + - DnaScramblerImplanter # SS220-BonusForFullyDiscovered - end - type: RandomArtifactSprite maxSprite: 36 - type: RandomSprite @@ -90,5 +129,4 @@ components: - type: Artifact nodesMin: 9 - nodesMax: 13 - + nodesMax: 13 \ No newline at end of file diff --git a/Resources/Prototypes/SS220/Entities/Objects/Tools/blueprint.yml b/Resources/Prototypes/SS220/Entities/Objects/Tools/blueprint.yml new file mode 100644 index 00000000000000..a94bb47de21873 --- /dev/null +++ b/Resources/Prototypes/SS220/Entities/Objects/Tools/blueprint.yml @@ -0,0 +1,159 @@ +- type: entity + parent: BaseBlueprint + id: BlueprintBeltChiefEngineer + name: blueprint belt chief + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - ClothingBeltChiefEngineer + +- type: entity + parent: BaseBlueprint + id: BlueprintSuperSynthesizerInstrument + name: blueprint super synthesizer + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - SuperSynthesizerInstrument + +- type: entity + parent: BaseBlueprint + id: BlueprintFultonBeacon + name: blueprint fulton beacon + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - FultonBeacon + +- type: entity + parent: BaseBlueprint + id: BlueprintClothingBeltMilitaryWebbing + name: blueprint belt military Webbing + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - ClothingBeltMilitaryWebbing + +- type: entity + parent: BaseBlueprint + id: BlueprintWallmountGeneratorAPUElectronics + name: blueprint wallmount generator APU electronics + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - WallmountGeneratorAPUElectronics + +- type: entity + parent: BaseBlueprint + id: BlueprintWeaponCrusher + name: blueprint weapon crusher + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - WeaponCrusher + +- type: entity + parent: BaseBlueprint + id: BlueprintWeaponCrusherGlaive + name: blueprint weapon crusher glaive + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - WeaponCrusherGlaive + +- type: entity + parent: BaseBlueprint + id: BlueprintJetpackVoid + name: blueprint jetpackVoid + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - JetpackVoid + +- type: entity + parent: BaseBlueprint + id: BlueprintToySword + name: blueprint toy sword + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - ToySword + +- type: entity + parent: BaseBlueprint + id: BlueprintDoubleToySword + name: blueprint double toy Sword + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - DoubleToySword + +- type: entity + parent: BaseBlueprint + id: BlueprintWelderIndustrial + name: blueprint welder industrial + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - WelderIndustrial + +- type: entity + parent: BaseBlueprint + id: BlueprintWelderIndustrialAdvanced + name: blueprint welder industrial advanced + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - WelderIndustrialAdvanced + +- type: entity + parent: BaseBlueprint + id: BlueprintSawAdvanced + name: blueprint saw advanced + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - SawAdvanced + +- type: entity + parent: BaseBlueprint + id: BlueprintGlowstickBlue + name: blueprint glowstick blue + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - GlowstickBlue + +- type: entity + parent: BaseBlueprint + id: BlueprintSyndicateMicrowaveMachineCircuitboard + name: blueprint microwave Co. machine circuitboard + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - SyndicateMicrowaveMachineCircuitboard + +- type: entity + parent: BaseBlueprint + id: BlueprintPowerCellHyperPrinted + name: blueprint power cell hyperPrinted + description: A blueprint of some device. It can be placed in an autolat. + components: + - type: Blueprint + providedRecipes: + - PowerCellHyperPrinted \ No newline at end of file diff --git a/Resources/Prototypes/SS220/Recipes/Lathes/devices.yml b/Resources/Prototypes/SS220/Recipes/Lathes/devices.yml index 742f3debc61a75..0dfc2b90f5052d 100644 --- a/Resources/Prototypes/SS220/Recipes/Lathes/devices.yml +++ b/Resources/Prototypes/SS220/Recipes/Lathes/devices.yml @@ -24,4 +24,14 @@ completetime: 4 materials: Steel: 200 - Plastic: 200 \ No newline at end of file + Plastic: 200 + +- type: latheRecipe + id: JetpackVoid + result: JetpackVoid + completetime: 4 + materials: + Steel: 1200 + Glass: 400 + Plasma: 600 + Plastic: 400 diff --git a/Resources/Prototypes/SS220/Recipes/Lathes/electronics.yml b/Resources/Prototypes/SS220/Recipes/Lathes/electronics.yml index edfa55566f61fa..6cd252dd4f4704 100644 --- a/Resources/Prototypes/SS220/Recipes/Lathes/electronics.yml +++ b/Resources/Prototypes/SS220/Recipes/Lathes/electronics.yml @@ -50,3 +50,35 @@ materials: Steel: 200 Glass: 1000 + +- type: latheRecipe + id: WallmountGeneratorAPUElectronics + result: WallmountGeneratorAPUElectronics + category: Circuitry + completetime: 6 + materials: + Steel: 100 + Glass: 900 + Silver: 100 + Gold: 100 + +- type: latheRecipe + id: SyndicateMicrowaveMachineCircuitboard + result: SyndicateMicrowaveMachineCircuitboard + category: Circuitry + completetime: 6 + materials: + Steel: 100 + Glass: 900 + Silver: 100 + Gold: 100 + +- type: latheRecipe + id: PowerCellHyperPrinted + result: PowerCellHyperPrinted + category: Circuitry + completetime: 6 + materials: + Steel: 1200 + Silver: 100 + Gold: 500 \ No newline at end of file diff --git a/Resources/Prototypes/SS220/Recipes/Lathes/misc.yml b/Resources/Prototypes/SS220/Recipes/Lathes/misc.yml index dccb2e9cb27dec..dabe959b24affe 100644 --- a/Resources/Prototypes/SS220/Recipes/Lathes/misc.yml +++ b/Resources/Prototypes/SS220/Recipes/Lathes/misc.yml @@ -13,3 +13,50 @@ completetime: 1 materials: Plastic: 100 + +- type: latheRecipe + id: SuperSynthesizerInstrument + result: SuperSynthesizerInstrument + completetime: 1 + materials: + Steel: 1500 + Plastic: 500 + +- type: latheRecipe + id: ClothingBeltMilitaryWebbing + result: ClothingBeltMilitaryWebbing + completetime: 1 + materials: + Plastic: 200 + Cloth: 1000 + +- type: latheRecipe + id: WeaponCrusher + result: WeaponCrusher + completetime: 3 + materials: + Steel: 2000 + Gold: 500 + +- type: latheRecipe + id: WeaponCrusherGlaive + result: WeaponCrusherGlaive + completetime: 3 + materials: + Steel: 2500 + Plasma: 1500 + Gold: 1000 + +- type: latheRecipe + id: ToySword + result: ToySword + completetime: 1 + materials: + Plastic: 800 + +- type: latheRecipe + id: DoubleToySword + result: DoubleToySword + completetime: 1 + materials: + Plastic: 1600 \ No newline at end of file diff --git a/Resources/Prototypes/SS220/Recipes/Lathes/tools.yml b/Resources/Prototypes/SS220/Recipes/Lathes/tools.yml new file mode 100644 index 00000000000000..3fd6897d828a2e --- /dev/null +++ b/Resources/Prototypes/SS220/Recipes/Lathes/tools.yml @@ -0,0 +1,40 @@ +- type: latheRecipe + id: ClothingBeltChiefEngineer + result: ClothingBeltChiefEngineer + category: Tools + completetime: 1 + materials: + Steel: 200 + Cloth: 500 + +- type: latheRecipe + id: WelderIndustrial + result: WelderIndustrial + category: Tools + completetime: 1 + materials: + Steel: 800 + +- type: latheRecipe + id: WelderIndustrialAdvanced + result: WelderIndustrialAdvanced + category: Tools + completetime: 1 + materials: + Steel: 800 + +- type: latheRecipe + id: SawAdvanced + result: SawAdvanced + category: Tools + completetime: 1 + materials: + Steel: 1200 + +- type: latheRecipe + id: GlowstickBlue + result: GlowstickBlue + category: Tools + completetime: 1 + materials: + Steel: 250 \ No newline at end of file