Skip to content

Commit 0534cbf

Browse files
committed
added json and some other crap idk
1 parent 23d941b commit 0534cbf

19 files changed

+295
-1668
lines changed

3DGame/Scenes/GameplayAssets/Models/tree_spruce1.mgf

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
#beginmodel "tree_spruce1"
22
#choreo "null"
33
#beginsymbols
4-
$foliage=0:192:0
5-
$trunk=150:150:50
4+
$foliage=0:192:95
5+
$trunk=150:100:50
66
#endsymbols
77
#beginpart "Body"
88
#texture "trees"
99
#beginpoints
10-
0.20 0.0 0.0 $trunk 0 0 1
10+
0.20 0.0 0.0 $trunk 0.01 0 1
1111
0.10 0.0 0.15 $trunk 0.125 0 1
12-
-0.10 0.0 0.15 $trunk 0 0 1
12+
-0.10 0.0 0.15 $trunk 0.01 0 1
1313
-0.20 0.0 0.0 $trunk 0.125 0 1
14-
-0.10 0.0 -0.15 $trunk 0 0 1
14+
-0.10 0.0 -0.15 $trunk 0.01 0 1
1515
0.10 0.0 -0.15 $trunk 0.125 0 1
1616

17-
0.20 1.0 0.0 $trunk 0 0.25 1
18-
0.10 1.0 0.15 $trunk 0.125 0.25 1
19-
-0.10 1.0 0.15 $trunk 0 0.25 1
20-
-0.20 1.0 0.0 $trunk 0.125 0.25 1
21-
-0.10 1.0 -0.15 $trunk 0 0.25 1
22-
0.10 1.0 -0.15 $trunk 0.125 0.25 1
17+
0.20 1.0 0.0 $trunk 0.01 0.247 1
18+
0.10 1.0 0.15 $trunk 0.125 0.247 1
19+
-0.10 1.0 0.15 $trunk 0.01 0.247 1
20+
-0.20 1.0 0.0 $trunk 0.125 0.247 1
21+
-0.10 1.0 -0.15 $trunk 0.01 0.247 1
22+
0.10 1.0 -0.15 $trunk 0.125 0.247 1
2323

24-
0.20 1.0 0.0 $trunk 0 0 1
25-
0.10 1.0 0.15 $trunk 0.125 0 1
26-
-0.10 1.0 0.15 $trunk 0 0 1
27-
-0.20 1.0 0.0 $trunk 0.125 0 1
28-
-0.10 1.0 -0.15 $trunk 0 0 1
29-
0.10 1.0 -0.15 $trunk 0.125 0 1
24+
0.20 1.0 0.0 $trunk 0.01 0.01 1
25+
0.10 1.0 0.15 $trunk 0.125 0.01 1
26+
-0.10 1.0 0.15 $trunk 0.01 0.01 1
27+
-0.20 1.0 0.0 $trunk 0.125 0.01 1
28+
-0.10 1.0 -0.15 $trunk 0.01 0.01 1
29+
0.10 1.0 -0.15 $trunk 0.125 0.01 1
3030

31-
0.16 2.0 0.0 $trunk 0 0.25 1
32-
0.08 2.0 0.12 $trunk 0.125 0.25 1
33-
-0.08 2.0 0.12 $trunk 0 0.25 1
34-
-0.16 2.0 0.0 $trunk 0.125 0.25 1
35-
-0.08 2.0 -0.12 $trunk 0 0.25 1
36-
0.08 2.0 -0.12 $trunk 0.125 0.25 1
31+
0.16 2.0 0.0 $trunk 0.01 0.247 1
32+
0.08 2.0 0.12 $trunk 0.125 0.247 1
33+
-0.08 2.0 0.12 $trunk 0.01 0.247 1
34+
-0.16 2.0 0.0 $trunk 0.125 0.247 1
35+
-0.08 2.0 -0.12 $trunk 0.01 0.247 1
36+
0.08 2.0 -0.12 $trunk 0.125 0.247 1
3737

38-
0.16 2.0 0.0 $trunk 0 0 1
39-
0.08 2.0 0.12 $trunk 0.125 0 1
40-
-0.08 2.0 0.12 $trunk 0 0 1
41-
-0.16 2.0 0.0 $trunk 0.125 0 1
42-
-0.08 2.0 -0.12 $trunk 0 0 1
43-
0.08 2.0 -0.12 $trunk 0.125 0 1
38+
0.16 2.0 0.0 $trunk 0.01 0.01 1
39+
0.08 2.0 0.12 $trunk 0.125 0.01 1
40+
-0.08 2.0 0.12 $trunk 0.01 0.01 1
41+
-0.16 2.0 0.0 $trunk 0.125 0.01 1
42+
-0.08 2.0 -0.12 $trunk 0.01 0.01 1
43+
0.08 2.0 -0.12 $trunk 0.125 0.01 1
4444

45-
0.0 3.0 0.0 $trunk 0.0625 0.25 1
45+
0.0 3.0 0.0 $trunk 0.0625 0.247 1
4646
#endpoints
4747
#beginmesh
4848
0,1,6 1,7,6

3DGame/graphics/itemparts.png

331 Bytes
Loading

3DGame/graphics/itemparts_nt.png

104 Bytes
Loading

GameObject/AbilityLogic/AbilityExecutor.cs

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public void Update(float dT)
7272
}
7373
else
7474
{
75+
7576
effect.Apply(Source, Target, ability.Level);
7677
}
7778
}

GameObject/GameObject.csproj

+32-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>GameObject</RootNamespace>
1111
<AssemblyName>GameObject</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<Deterministic>true</Deterministic>
15+
<TargetFrameworkProfile />
1516
</PropertyGroup>
1617
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1718
<DebugSymbols>true</DebugSymbols>
@@ -32,9 +33,37 @@
3233
<WarningLevel>4</WarningLevel>
3334
</PropertyGroup>
3435
<ItemGroup>
36+
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
37+
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
38+
</Reference>
3539
<Reference Include="MonoGame.Framework, Version=3.6.0.1625, Culture=neutral, processorArchitecture=MSIL" />
3640
<Reference Include="System" />
41+
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
42+
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
43+
</Reference>
3744
<Reference Include="System.Core" />
45+
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
46+
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
47+
</Reference>
48+
<Reference Include="System.Numerics" />
49+
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
50+
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
51+
</Reference>
52+
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
53+
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
54+
</Reference>
55+
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
56+
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
57+
</Reference>
58+
<Reference Include="System.Text.Json, Version=8.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
59+
<HintPath>..\packages\System.Text.Json.8.0.3\lib\net462\System.Text.Json.dll</HintPath>
60+
</Reference>
61+
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
62+
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
63+
</Reference>
64+
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
65+
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
66+
</Reference>
3867
<Reference Include="System.Xml.Linq" />
3968
<Reference Include="System.Data.DataSetExtensions" />
4069
<Reference Include="Microsoft.CSharp" />
@@ -148,6 +177,8 @@
148177
</Content>
149178
</ItemGroup>
150179
<ItemGroup>
180+
<None Include="app.config" />
181+
<None Include="packages.config" />
151182
<None Include="statnames.md" />
152183
</ItemGroup>
153184
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

GameObject/ItemSet.cs

+84-24
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,14 @@ public enum IncludeWeaponCount
2525
/// <summary>
2626
/// This sed should include two weapons.
2727
/// </summary>
28-
Two
29-
}
30-
31-
/// <summary>
32-
///
33-
/// </summary>
34-
public enum RingDuplicationOption
35-
{
36-
/// <summary>
37-
/// All rings must be distinct.
38-
/// </summary>
39-
No,
40-
/// <summary>
41-
/// All rings must be the same.
42-
/// </summary>
43-
Yes,
28+
Two,
4429
/// <summary>
45-
/// Any combination of rings up to RingCount contributes to the set.
30+
/// This set should include two weapons, any combination contributes to the set.
4631
/// </summary>
47-
Mixed
32+
TwoAny
4833
}
49-
34+
35+
/*
5036
public enum RingCountOption
5137
{
5238
/// <summary>
@@ -66,7 +52,7 @@ public enum RingCountOption
6652
/// </summary>
6753
Three
6854
}
69-
55+
//*/
7056

7157
/// <summary>
7258
/// String ID of this ItemSet.
@@ -78,18 +64,92 @@ public enum RingCountOption
7864

7965
public IncludeWeaponCount WeaponCount { get; set; }
8066

81-
public RingCountOption RingCount { get; set; }
67+
public int RingCount { get; set; }
8268

83-
public RingDuplicationOption RingOption { get; set; }
69+
public bool RingRequireDistinct { get; set; }
8470

85-
public int BonusCount { get; set; }
71+
//public int BonusCount { get; set; }
8672

8773
public Items.ItemBonus[] Bonuses { get; set; }
8874

8975
public ItemSet(ItemSetTemplate Template)
9076
{
91-
BonusCount = Template.ItemList.Count;
77+
int BonusCount = Template.ItemList.Count;
9278
Bonuses = new Items.ItemBonus[BonusCount];
9379
}
80+
81+
public int GetSetCount(List<Items.ItemEquip> ItemList)
82+
{
83+
int result = 0;
84+
//two lists to keep track of rings and weapons due to special handling
85+
List<Items.ItemEquip> rings = new List<Items.ItemEquip>();
86+
List<Items.ItemEquip> weps = new List<Items.ItemEquip>();
87+
//go through every item in the list given
88+
foreach(Items.ItemEquip item in ItemList)
89+
{
90+
//only count items that specify this as their set
91+
if(item.Set==this)
92+
{
93+
//if it's a ring, add it to the rings list
94+
if (Items.ItemEquip.EquipSlot.IsRing(item.EquipmentSlot))
95+
{
96+
rings.Add(item);
97+
}
98+
//if it's a weapon, add it to the weapons list
99+
else if (Items.ItemEquip.EquipSlot.IsWeapon(item.EquipmentSlot))
100+
{
101+
weps.Add(item);
102+
}
103+
//else increase the tally as no other types can have duplicate slots
104+
else
105+
{
106+
result++;
107+
}
108+
}
109+
110+
}
111+
112+
//add either the number of all weapons and rings equipped, or just unique ones as the set requires.
113+
//items are compared by their IGameID.ID as two distinct copies of the same ring item will count as
114+
//unique if compared with regular equality as the player will never be able to equip the same
115+
//instance of an item twice.
116+
//rings only count up to maximum ring count in the set - for example, if a set includes 1 ring,
117+
//equipping 2 or 3 of that ring will not "satisfy" additional set slots.
118+
119+
//if ring mixing is allowed, or same ring option was set in template, add all rings we found
120+
if(RingRequireDistinct)
121+
{
122+
result += Math.Max(rings.Select(r => r.ID).Distinct().ToList().Count,this.RingCount);
123+
}
124+
//else only add the unique ones.
125+
else
126+
{
127+
result += Math.Min(rings.Count,this.RingCount);
128+
}
129+
//if specifically two different weapons are required, count uniques in the list in case two of the same are eqipped;
130+
if(WeaponCount== IncludeWeaponCount.Two)
131+
{
132+
result += weps.Select(r => r.ID).Distinct().ToList().Count;
133+
}
134+
else
135+
{
136+
result += weps.Count;
137+
}
138+
139+
140+
141+
return result;
142+
}
143+
144+
public List<Items.ItemBonus> GetBonuses(int ItemCount)
145+
{
146+
List<Items.ItemBonus> result = new List<Items.ItemBonus>();
147+
if (ItemCount > Bonuses.Length)
148+
ItemCount = Bonuses.Length;
149+
for (int i = 0; i < ItemCount; i++)
150+
if (Bonuses[i] != null)
151+
result.Add(Bonuses[i]);
152+
return result;
153+
}
94154
}
95155
}

GameObject/ItemSetTemplate.cs

+19-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@
66

77
namespace GameObject
88
{
9+
/// <summary>
10+
/// This is an item set template.
11+
/// It defines a combination of item types that can make up
12+
/// an item set, as well as a couple rules related to the
13+
/// items there can be multiples of.
14+
/// An ItemSet created from this will contain the list of
15+
/// specific items that the set will consist of, as well as
16+
/// an array of ItemBonus that will be granted upon
17+
/// collecting a specific number of items in the set. The
18+
/// bonuses specific to the item set will be randomly picked
19+
/// from the same pools as the items comprising the set. The
20+
/// Rarity value will also be chosen at the time of set
21+
/// generation. The only variable related to ItemBonuses
22+
/// that can be controlled here is the total count that will
23+
/// be available for the set. These will be distributed at
24+
/// the time of the set generation as well.
25+
/// </summary>
926
public class ItemSetTemplate : Interfaces.IGameID
1027
{
1128
/// <summary>
@@ -44,9 +61,9 @@ public enum IncludeWeaponType
4461

4562
public ItemSet.IncludeWeaponCount WeaponCount { get; set; }
4663

47-
public ItemSet.RingCountOption RingCount { get; set; }
64+
public int RingCount { get; set; }
4865

49-
public ItemSet.RingDuplicationOption RingOption { get; set; }
66+
public bool RingRequireDistinct { get; set; }
5067

5168
/// <summary>
5269
/// List of equip types that the set should contain.

GameObject/Items/ItemEquip.cs

+12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class ItemEquip : Item
2525
public string Subject;
2626
public Enchantment Enchant;
2727
public int EquipmentSlot;
28+
29+
public ItemSet Set;
2830
/// <summary>
2931
/// Equip categories used in item generation.
3032
/// </summary>
@@ -232,6 +234,16 @@ public class EquipSlot
232234
public const int Bonus = 14;
233235

234236
public const int Max = 15;
237+
238+
public static bool IsRing(int Slot)
239+
{
240+
return Slot == Ring0 || Slot == Ring1 || Slot == Ring2;
241+
}
242+
243+
public static bool IsWeapon(int Slot)
244+
{
245+
return Slot == RightArm || Slot == LeftArm;
246+
}
235247
}
236248

237249
public class xxDeprecatedEquipType

GameObject/MapEntities/Actor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public virtual void Hit(Actor Source, float amount, bool Magic, int Type)
172172
return;
173173
this.CurrentHPBuffer -= amount;
174174
amount = (int)Math.Round(amount);
175-
this.WorldSpawn.Entities.Add(new DamageParticle(this.Position, amount.ToString(), Color.Red, 0.5f));
175+
this.WorldSpawn.Entities.Add(new DamageParticle(this, this.Position, amount.ToString(), Color.Red, 0.5f));
176176
}
177177

178178
public static Item PickItemFromTable(List<Tuple<int, Item>> table, Random RNG)

GameObject/MapEntities/DamageParticle.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ public override void Render(GraphicsDevice device, float dT, Vector2 Reference,
1818
{
1919
//don't
2020
}
21-
public DamageParticle(Interfaces.WorldPosition Position,string Text,Color Colour,float TTL)
21+
public DamageParticle(MapEntity Parent, Interfaces.WorldPosition Position,string Text,Color Colour,float TTL)
2222
{
23+
this.WorldSpawn = Parent.WorldSpawn;
2324
this.Position = Position;
2425
this.Text = Text;
2526
this.Colour = Colour;

GameObject/MapEntity.cs

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ public virtual void Render(GraphicsDevice device, float dT, Vector2 Reference,bo
128128

129129
public virtual void Update(float dT)
130130
{
131+
if (IsDead)
132+
return;
131133
// this.Heading += dT*10;
132134
float dH = 0.1f;
133135
Vector3 Movevector = new Vector3(dT, 0, 0);

GameObject/app.config

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
8+
</dependentAssembly>
9+
</assemblyBinding>
10+
</runtime>
11+
</configuration>

0 commit comments

Comments
 (0)