Skip to content

Commit

Permalink
Merge Feature-DNF
Browse files Browse the repository at this point in the history
  • Loading branch information
EliotVU committed Aug 5, 2022
2 parents 8bf4cf8 + a63faaf commit 4aff61f
Show file tree
Hide file tree
Showing 33 changed files with 802 additions and 206 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ This is a table of games that are confirmed to be compatible with the current st
| Bioshock 2 | Vengeance | 143/059 | |
| Unreal Championship 2: Liandri Conflict | 3323 | 151/002 | (Third-party) <https://forums.beyondunreal.com/threads/unreal-championship-2-script-decompiler-release.206036/> |
| The Chronicles of Spellborn | Unknown | 159/029 | |
| Duke Nukem Forever (2011) | Unknown | 156/036 | [Extraction is required](https://github.com/DaZombieKiller/MegaPackageExtractor) |
| | | | |
| | | | |
| Roboblitz | 2306 | 369/006 | |
Expand Down
15 changes: 15 additions & 0 deletions src/Branch/UE2/DNF/Tokens/BreakpointToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using UELib.Core;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class BreakpointToken : UStruct.UByteCodeDecompiler.Token
{
public override string Decompile()
{
// TODO:
Decompiler.PreComment = "// Breakpoint";
Decompiler.MarkSemicolon();
return "@UnknownSyntax";
}
}
}
19 changes: 19 additions & 0 deletions src/Branch/UE2/DNF/Tokens/DynamicArrayEmptyToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using UELib.Core;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class DynamicArrayEmptyToken : UStruct.UByteCodeDecompiler.DynamicArrayMethodToken
{
public override void Deserialize(IUnrealStream stream)
{
// Array
DeserializeNext();
}

public override string Decompile()
{
Decompiler.MarkSemicolon();
return $"{DecompileNext()}.Empty()";
}
}
}
21 changes: 21 additions & 0 deletions src/Branch/UE2/DNF/Tokens/IntConstWordToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class IntConstWordToken : UStruct.UByteCodeDecompiler.Token
{
public ushort Value;

public override void Deserialize(IUnrealStream stream)
{
Value = stream.ReadUInt16();
Decompiler.AlignSize(sizeof(ushort));
}

public override string Decompile()
{
return PropertyDisplay.FormatLiteral(Value);
}
}
}
18 changes: 18 additions & 0 deletions src/Branch/UE2/DNF/Tokens/RotConstBytesToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using UELib.Core;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class RotConstBytesToken : UStruct.UByteCodeDecompiler.RotationConstToken
{
public override void Deserialize(IUnrealStream stream)
{
// FIXME: These must have been compressed right?
Value.Pitch = stream.ReadByte();
Decompiler.AlignSize(sizeof(byte));
Value.Roll = stream.ReadByte();
Decompiler.AlignSize(sizeof(byte));
Value.Yaw = stream.ReadByte();
Decompiler.AlignSize(sizeof(byte));
}
}
}
21 changes: 21 additions & 0 deletions src/Branch/UE2/DNF/Tokens/RotConstPitchToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class RotConstPitchToken : UStruct.UByteCodeDecompiler.Token
{
public int Pitch;

public override void Deserialize(IUnrealStream stream)
{
Pitch = stream.ReadInt32();
Decompiler.AlignSize(sizeof(int));
}

public override string Decompile()
{
return $"rotpitch({PropertyDisplay.FormatLiteral(Pitch)})";
}
}
}
21 changes: 21 additions & 0 deletions src/Branch/UE2/DNF/Tokens/RotConstRollToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class RotConstRollToken : UStruct.UByteCodeDecompiler.Token
{
public int Roll;

public override void Deserialize(IUnrealStream stream)
{
Roll = stream.ReadInt32();
Decompiler.AlignSize(sizeof(int));
}

public override string Decompile()
{
return $"rotroll({PropertyDisplay.FormatLiteral(Roll)})";
}
}
}
21 changes: 21 additions & 0 deletions src/Branch/UE2/DNF/Tokens/RotConstYawToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class RotConstYawToken : UStruct.UByteCodeDecompiler.Token
{
public int Yaw;

public override void Deserialize(IUnrealStream stream)
{
Yaw = stream.ReadInt32();
Decompiler.AlignSize(sizeof(int));
}

public override string Decompile()
{
return $"rotyaw({PropertyDisplay.FormatLiteral(Yaw)})";
}
}
}
12 changes: 12 additions & 0 deletions src/Branch/UE2/DNF/Tokens/RotConstZeroToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using UELib.Core;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class RotConstZeroToken : UStruct.UByteCodeDecompiler.Token
{
public override string Decompile()
{
return "rot(0, 0, 0)";
}
}
}
13 changes: 13 additions & 0 deletions src/Branch/UE2/DNF/Tokens/VectorConstUnitZToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using UELib.Core;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class VectorConstUnitZToken : UStruct.UByteCodeDecompiler.Token
{
public override string Decompile()
{
// TODO
return "@UnknownSyntax";
}
}
}
12 changes: 12 additions & 0 deletions src/Branch/UE2/DNF/Tokens/VectorConstZeroToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using UELib.Core;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class VectorConstZeroToken : UStruct.UByteCodeDecompiler.Token
{
public override string Decompile()
{
return "vect(0, 0, 0)";
}
}
}
21 changes: 21 additions & 0 deletions src/Branch/UE2/DNF/Tokens/VectorXToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class VectorXToken : UStruct.UByteCodeDecompiler.Token
{
public float X;

public override void Deserialize(IUnrealStream stream)
{
X = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));
}

public override string Decompile()
{
return $"vectx({PropertyDisplay.FormatLiteral(X)})";
}
}
}
24 changes: 24 additions & 0 deletions src/Branch/UE2/DNF/Tokens/VectorXYToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class VectorXYToken : UStruct.UByteCodeDecompiler.Token
{
public float X, Y;

public override void Deserialize(IUnrealStream stream)
{
X = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));

Y = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));
}

public override string Decompile()
{
return $"vectxy({PropertyDisplay.FormatLiteral(X)}, {PropertyDisplay.FormatLiteral(Y)})";
}
}
}
24 changes: 24 additions & 0 deletions src/Branch/UE2/DNF/Tokens/VectorXZToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class VectorXZToken : UStruct.UByteCodeDecompiler.Token
{
public float X, Z;

public override void Deserialize(IUnrealStream stream)
{
X = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));

Z = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));
}

public override string Decompile()
{
return $"vectxz({PropertyDisplay.FormatLiteral(X)}, {PropertyDisplay.FormatLiteral(Z)})";
}
}
}
21 changes: 21 additions & 0 deletions src/Branch/UE2/DNF/Tokens/VectorYToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class VectorYToken : UStruct.UByteCodeDecompiler.Token
{
public float Y;

public override void Deserialize(IUnrealStream stream)
{
Y = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));
}

public override string Decompile()
{
return $"vecty({PropertyDisplay.FormatLiteral(Y)})";
}
}
}
24 changes: 24 additions & 0 deletions src/Branch/UE2/DNF/Tokens/VectorYZToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class VectorYZToken : UStruct.UByteCodeDecompiler.Token
{
public float Y, Z;

public override void Deserialize(IUnrealStream stream)
{
Y = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));

Z = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));
}

public override string Decompile()
{
return $"vectyz({PropertyDisplay.FormatLiteral(Y)}, {PropertyDisplay.FormatLiteral(Z)})";
}
}
}
21 changes: 21 additions & 0 deletions src/Branch/UE2/DNF/Tokens/VectorZToken.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using UELib.Core;
using UELib.UnrealScript;

namespace UELib.Branch.UE2.DNF.Tokens
{
public class VectorZToken : UStruct.UByteCodeDecompiler.Token
{
public float Z;

public override void Deserialize(IUnrealStream stream)
{
Z = stream.ReadFloat();
Decompiler.AlignSize(sizeof(float));
}

public override string Decompile()
{
return $"vectz({PropertyDisplay.FormatLiteral(Z)})";
}
}
}
Loading

0 comments on commit 4aff61f

Please sign in to comment.