Skip to content

Commit

Permalink
BonusForFullyDiscovered (#2376)
Browse files Browse the repository at this point in the history
* smile

* fixicki

* 123

* oops

* ooops

* pullim

* fix

* Update Resources/Locale/ru-RU/prototypes/entities/objects/blueprint/blueprint.ftl

Co-authored-by: Svarshik <[email protected]>

* Update Resources/Locale/ru-RU/prototypes/entities/objects/blueprint/blueprint.ftl

Co-authored-by: Svarshik <[email protected]>

* ftl

* rev

---------

Co-authored-by: Svarshik <[email protected]>
  • Loading branch information
21Melkuu and lexaSvarshik authored Dec 26, 2024
1 parent e78b55d commit d47d933
Show file tree
Hide file tree
Showing 10 changed files with 467 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<EntityPrototype>)), ViewVariables]
public List<string>? BonusPrototype;

// SS220-BonusForFullyDiscovered - end

}

/// <summary>
Expand Down
39 changes: 39 additions & 0 deletions Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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()
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -296,4 +315,24 @@ public ArtifactNode GetRootNode(List<ArtifactNode> 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
}
Original file line number Diff line number Diff line change
@@ -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 }
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -90,5 +129,4 @@
components:
- type: Artifact
nodesMin: 9
nodesMax: 13

nodesMax: 13
Loading

0 comments on commit d47d933

Please sign in to comment.