Skip to content

Commit d3f7edb

Browse files
authored
Feature/faction token (#143)
* Faction Tokens * Fixed with correct LOT
1 parent 524dadb commit d3f7edb

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

Uchu.Core/Resources/FactionFlags.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace Uchu.Core.Resources
2+
{
3+
public enum FactionFlags
4+
{
5+
Venture = 46,
6+
Assembly = 47,
7+
Paradox = 48,
8+
Sentinel = 49,
9+
}
10+
}

Uchu.StandardScripts/BlockYard/BlockYardProperty.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class BlockYardProperty : NativeScript
1818
{
1919
static private string GUIDMaelstrom { get; } = "{7881e0a1-ef6d-420c-8040-f59994aa3357}"; // ambient sounds for when the Maelstrom is on
2020
static private string GUIDPeaceful { get; } = "{c5725665-58d0-465f-9e11-aeb1d21842ba}"; // happy ambient sounds when no Maelstrom is present
21-
static bool HasOwner { get; set; } = false;
21+
static bool HasOwner { get; set; } = true;
2222
static private string[] GlobalObjects { get; } = // Objects you always spawn
2323
{
2424
"Mailbox",

Uchu.World/Objects/Components/ReplicaComponents/DestructibleComponent.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using RakDotNet.IO;
55
using Uchu.Core;
66
using Uchu.Core.Client;
7+
using Uchu.Core.Resources;
78

89
namespace Uchu.World
910
{
@@ -161,7 +162,18 @@ private async Task GenerateYieldsAsync(Player owner)
161162

162163
foreach (var lot in await container.GenerateLootYieldsAsync(owner))
163164
{
164-
var drop = InstancingUtilities.InstantiateLoot(lot, owner, GameObject, Transform.Position);
165+
Lot item = lot;
166+
167+
if (lot == Lot.FactionTokenProxy)
168+
{
169+
if (await owner.GetFlagAsync((int) FactionFlags.Assembly)) item = Lot.AssemblyFactionToken;
170+
if (await owner.GetFlagAsync((int) FactionFlags.Paradox)) item = Lot.ParadoxFactionToken;
171+
if (await owner.GetFlagAsync((int) FactionFlags.Sentinel)) item = Lot.SentinelFactionToken;
172+
if (await owner.GetFlagAsync((int) FactionFlags.Venture)) item = Lot.VentureFactionToken;
173+
if (item == lot) continue;
174+
}
175+
176+
var drop = InstancingUtilities.InstantiateLoot(item, owner, GameObject, Transform.Position);
165177

166178
Start(drop);
167179
}

Uchu.World/Structs/Lot.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ public int[] GetComponentIds(int componentType)
117117
public static readonly Lot RocketBuildCockpit = 6910;
118118
public static readonly Lot RocketBuildTail = 6915;
119119

120+
public const int FactionTokenProxy = 13763;
121+
public const int AssemblyFactionToken = 8318;
122+
public const int SentinelFactionToken = 8319;
123+
public const int ParadoxFactionToken = 8320;
124+
public const int VentureFactionToken = 8321;
125+
126+
120127
#endregion
121128
}
122129
}

0 commit comments

Comments
 (0)