Skip to content

Commit a58d900

Browse files
committed
Adding inputs
starting structure groups adding genartor
1 parent 6df5efb commit a58d900

21 files changed

+181
-25
lines changed

EIV_Game.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
<PackageReadmeFile>README.md</PackageReadmeFile>
2929
<PackageLicenseFile>license.txt</PackageLicenseFile>
3030
</PropertyGroup>
31-
<ItemGroup>
32-
<Compile Remove="libs\**" />
33-
<EmbeddedResource Remove="libs\**" />
34-
</ItemGroup>
3531
<ItemGroup>
3632
<Compile Update="csharp\Properties\Resource.Designer.cs">
3733
<DesignTime>True</DesignTime>
@@ -48,6 +44,7 @@
4844
<ItemGroup>
4945
<PackageReference Include="EIV_Common" Version="0.0.2" />
5046
<PackageReference Include="EIV_DataPack" Version="1.0.3.1" />
47+
<PackageReference Include="EIV_Generator" Version="0.0.1" />
5148
<PackageReference Include="EIV_JsonLib" Version="2.0.5.2" />
5249
<PackageReference Include="ini-parser-netstandard" Version="2.5.2" />
5350
<PackageReference Include="ModAPI" Version="0.0.2.1" />

csharp/Game/InputNames.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static partial class InputNames
1212
public static string SlowWalk = "move_slowly";
1313
public static string Jump = "move_jump";
1414
public static string Crouch = "move_crouch";
15-
public static string Prone = "move_prone"; // Currently not implemented.
15+
public static string Prone = "move_prone";
1616
public static string InventoryOpen = "inventory_open";
1717
public static string ItemUse = "item_use";
1818
public static string ItemCancel = "item_cancel";
@@ -27,15 +27,15 @@ public static partial class InputNames
2727
public static string ToolSlot7 = "slot7";
2828
public static string ToolSlot8 = "slot8";
2929
public static string ToolSlot9 = "slot9";
30-
public static string MenuButton = "menu"; //Esc
30+
public static string MenuButton = "menu";
3131

3232

3333
public static List<string> AllAction =
3434
[
3535
MoveForward, MoveBackward, MoveLeft, MoveRight, Sprint, SlowWalk, Crouch, Prone,
3636
InventoryOpen, ItemUse, ItemCancel, WeaponReload,
3737
ToolSlot0, ToolSlot1, ToolSlot2, ToolSlot3, ToolSlot4, ToolSlot5, ToolSlot6, ToolSlot7, ToolSlot8, ToolSlot9,
38-
MenuButton, "Test"
38+
MenuButton
3939
];
4040

4141
// Add

csharp/Generator/Attributes.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
3+
namespace ExtractIntoVoid.Generator;
4+
5+
/// <summary>
6+
/// Generate Custom Item with structure.
7+
/// </summary>
8+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
9+
public sealed class CustomItemStructure : Attribute
10+
{
11+
/// <summary>
12+
/// New Item Name to generate. (Default is same as the current.)
13+
/// </summary>
14+
public string NewItemName { get; set; } = string.Empty;
15+
16+
/// <summary>
17+
/// Generate Custom Item with structure.
18+
/// </summary>
19+
/// <param name="newItemName"></param>
20+
public CustomItemStructure(string newItemName = "")
21+
{
22+
this.NewItemName = newItemName;
23+
}
24+
}

csharp/Items/GunBase.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
using EIV_Common.Extensions;
22
using EIV_JsonLib;
33
using EIV_JsonLib.Extension;
4+
using ExtractIntoVoid.Items.ObjectGroups;
45
using ExtractIntoVoid.Physics;
56
using Godot;
67
using System.Linq;
78

89
namespace ExtractIntoVoid.Items;
910

11+
[Generator.CustomItemStructure]
1012
public abstract partial class GunBase : UsableBase
1113
{
1214
public Gun Gun => UsableItem.As<Gun>();
1315
public bool IsJammed { get; internal set; } = false;
1416
public Marker3D BulletSpawner { get; internal set; }
17+
public GunGroup GunGroup { get; internal set; }
1518

1619
public override void _Ready()
1720
{
21+
1822
BulletSpawner = GetNode<Marker3D>("BulletSpawner");
23+
GunGroup = new()
24+
{
25+
Barrel = GetNode<Marker3D>("")
26+
27+
};
1928
}
2029

2130
public override void OnTick(double delta)

csharp/Items/HealingBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace ExtractIntoVoid.Items;
66

7+
[Generator.CustomItemStructure]
78
public abstract partial class HealingBase : UsableBase
89
{
910
public Healing HealingItem => UsableItem.As<Healing>();

csharp/Items/ItemBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace ExtractIntoVoid.Items;
66

7+
[Generator.CustomItemStructure]
78
public abstract partial class InventoryItemBase : RigidBody3D
89
{
910
public InventoryModule InventoryModule { get; set; }

csharp/Items/ObjectGroups/GunGroup.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Godot;
2+
3+
namespace ExtractIntoVoid.Items.ObjectGroups;
4+
5+
public struct GunGroup
6+
{
7+
public Node3D Frame { get; init; }
8+
public Node3D Slide { get; init; }
9+
public Node3D Trigger { get; init; }
10+
public Node3D Mag { get; init; }
11+
public Node3D Barrel { get; init; }
12+
public Node3D Hammer { get; init; }
13+
public Node3D Safety { get; init; }
14+
public Node3D Slide_Lock { get; init; }
15+
public Node3D IronSight { get; init; }
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Godot;
2+
3+
namespace ExtractIntoVoid.Items.ObjectGroups;
4+
5+
public struct GunModPositionGroup
6+
{
7+
// These should be one of just a bunch of list?
8+
public Marker3D Supressor { get; internal set; }
9+
public Marker3D Sight { get; internal set; }
10+
public Marker3D Grip { get; internal set; }
11+
public Marker3D Stock { get; internal set; }
12+
}

csharp/Items/ThrowableBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace ExtractIntoVoid.Items;
66

7+
[Generator.CustomItemStructure]
78
public abstract partial class ThrowableBase : UsableBase
89
{
910
public Throwable Throwable => UsableItem.As<Throwable>();

csharp/Items/UsableBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace ExtractIntoVoid.Items;
66

7+
[Generator.CustomItemStructure]
78
public abstract partial class UsableBase : InventoryItemBase
89
{
910
public CoreUsable UsableItem => InventoryModule.Inventory.Hand.As<CoreUsable>();

0 commit comments

Comments
 (0)