forked from space-wizards/space-station-14
-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* i got that dawg in me * dasasdsaddas * jhkhkjj * my lazy ass is not doing the rest * finally. * finally. * jesus christ 1 * help me * jesus christ 2 * UAAAAWHGHHGG BUABHAUBHAUBHHGH * jesus christ 3 * sdfjsdkghjdfkljbhsfuobd * 1984 * ash lore update * THE CURSE OF 220 * ultra violencce * fart * fdgfdgbfdbf * fgbdfgndfgn * it's raw propheting time * blbkblbkglbgkbgbgbgdfbfgbbb AAAAAAAAAAAAAAAAAAAAAAAAA * fdbfsgbybdf * bkbgkblkgbgbngfkb * void path part 1 * REAL!!!!!! * it is working * ok looks good to me * random influence spawn * hey shitass, wanna see me bypass yaml linter? * RAAAAAAAAAAGH * dghgdfbsfdgbsdf * dfvsfvavsd * help * help * bbnvbnvmvbnmvbnmvbn * guiedbook * fhfdsghfgdhdfgh * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA * please * fucking die * vlkblvkbbgjhjfbhnbkvbnf A * i am malding * 6666 lines * FUCK * GOD SAVE MY SOUL!! * revert store shitassery * dfvdfgdf * Reapply "Uplink discounts (#580)" This reverts commit 55540db. * more uplink shittery revert * FUCK * based * dvsfv * dghfgghfgh * blnkbnbknlbnklb * * finally. * yeah * bnbnmbvnm * vblknknvblnkvblknklvbn * fuck * gaming * bnkb,nkvbnklvbknvb --------- Co-authored-by: whateverusername0 <whateveremail> Co-authored-by: Piras314 <[email protected]>
- Loading branch information
Showing
25 changed files
with
752 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
Content.Server/Goobstation/Heretic/Ritual/CustomBehavior.Knowledge.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using Content.Server.Heretic.EntitySystems; | ||
using Content.Shared.Dataset; | ||
using Content.Shared.Heretic; | ||
using Content.Shared.Heretic.Prototypes; | ||
using Content.Shared.Tag; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Random; | ||
using System.Text; | ||
|
||
namespace Content.Server.Heretic.Ritual; | ||
|
||
public sealed partial class RitualKnowledgeBehavior : RitualCustomBehavior | ||
{ | ||
// made static so that it doesn't regenerate itself each time | ||
private static Dictionary<ProtoId<TagPrototype>, int> requiredTags = new(); | ||
private List<EntityUid> toDelete = new(); | ||
|
||
private IPrototypeManager _prot = default!; | ||
private IRobustRandom _rand = default!; | ||
private EntityLookupSystem _lookup = default!; | ||
private HereticSystem _heretic = default!; | ||
|
||
// this is basically a ripoff from hereticritualsystem | ||
public override bool Execute(RitualData args, out string? outstr) | ||
{ | ||
_prot = IoCManager.Resolve<IPrototypeManager>(); | ||
_rand = IoCManager.Resolve<IRobustRandom>(); | ||
_lookup = args.EntityManager.System<EntityLookupSystem>(); | ||
_heretic = args.EntityManager.System<HereticSystem>(); | ||
|
||
outstr = null; | ||
|
||
// generate new set of tags | ||
if (requiredTags.Count == 0) | ||
for (int i = 0; i < 4; i++) | ||
requiredTags.Add(_rand.Pick(_prot.Index<DatasetPrototype>("EligibleTags").Values), 1); | ||
|
||
var lookup = _lookup.GetEntitiesInRange(args.Platform, .75f); | ||
var missingList = new List<string>(); | ||
|
||
foreach (var look in lookup) | ||
{ | ||
foreach (var tag in requiredTags) | ||
{ | ||
if (!args.EntityManager.TryGetComponent<TagComponent>(look, out var tags)) | ||
continue; | ||
var ltags = tags.Tags; | ||
|
||
if (ltags.Contains(tag.Key)) | ||
{ | ||
requiredTags[tag.Key] -= 1; | ||
toDelete.Add(look); | ||
} | ||
} | ||
} | ||
|
||
foreach (var tag in requiredTags) | ||
if (tag.Value > 0) | ||
missingList.Add(tag.Key); | ||
|
||
if (missingList.Count > 0) | ||
{ | ||
var sb = new StringBuilder(); | ||
for (int i = 0; i < missingList.Count; i++) | ||
{ | ||
if (i != missingList.Count - 1) | ||
sb.Append($"{missingList[i]}, "); | ||
else sb.Append(missingList[i]); | ||
} | ||
|
||
outstr = Loc.GetString("heretic-ritual-fail-items", ("itemlist", sb.ToString())); | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
public override void Finalize(RitualData args) | ||
{ | ||
// delete all and reset | ||
foreach (var ent in toDelete) | ||
args.EntityManager.QueueDeleteEntity(ent); | ||
toDelete = new(); | ||
|
||
if (args.EntityManager.TryGetComponent<HereticComponent>(args.Performer, out var hereticComp)) | ||
_heretic.UpdateKnowledge(args.Performer, hereticComp, 4); | ||
|
||
// reset tags | ||
requiredTags = new(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.