Skip to content

Feature/faction token #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Uchu.Core/Resources/FactionFlags.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Uchu.Core.Resources
{
public enum FactionFlags
{
Venture = 46,
Assembly = 47,
Paradox = 48,
Sentinel = 49,
}
}
2 changes: 1 addition & 1 deletion Uchu.StandardScripts/BlockYard/BlockYardProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class BlockYardProperty : NativeScript
{
static private string GUIDMaelstrom { get; } = "{7881e0a1-ef6d-420c-8040-f59994aa3357}"; // ambient sounds for when the Maelstrom is on
static private string GUIDPeaceful { get; } = "{c5725665-58d0-465f-9e11-aeb1d21842ba}"; // happy ambient sounds when no Maelstrom is present
static bool HasOwner { get; set; } = false;
static bool HasOwner { get; set; } = true;
static private string[] GlobalObjects { get; } = // Objects you always spawn
{
"Mailbox",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using RakDotNet.IO;
using Uchu.Core;
using Uchu.Core.Client;
using Uchu.Core.Resources;

namespace Uchu.World
{
Expand Down Expand Up @@ -161,7 +162,18 @@ private async Task GenerateYieldsAsync(Player owner)

foreach (var lot in await container.GenerateLootYieldsAsync(owner))
{
var drop = InstancingUtilities.InstantiateLoot(lot, owner, GameObject, Transform.Position);
Lot item = lot;

if (lot == Lot.FactionTokenProxy)
{
if (await owner.GetFlagAsync((int) FactionFlags.Assembly)) item = Lot.AssemblyFactionToken;
if (await owner.GetFlagAsync((int) FactionFlags.Paradox)) item = Lot.ParadoxFactionToken;
if (await owner.GetFlagAsync((int) FactionFlags.Sentinel)) item = Lot.SentinelFactionToken;
if (await owner.GetFlagAsync((int) FactionFlags.Venture)) item = Lot.VentureFactionToken;
if (item == lot) continue;
}

var drop = InstancingUtilities.InstantiateLoot(item, owner, GameObject, Transform.Position);

Start(drop);
}
Expand Down
7 changes: 7 additions & 0 deletions Uchu.World/Structs/Lot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ public int[] GetComponentIds(int componentType)
public static readonly Lot RocketBuildCockpit = 6910;
public static readonly Lot RocketBuildTail = 6915;

public const int FactionTokenProxy = 13763;
public const int AssemblyFactionToken = 8318;
public const int SentinelFactionToken = 8319;
public const int ParadoxFactionToken = 8320;
public const int VentureFactionToken = 8321;


#endregion
}
}