Skip to content

Commit

Permalink
randomizer update
Browse files Browse the repository at this point in the history
  • Loading branch information
igorseabra4 committed Jul 24, 2019
1 parent 85f6a72 commit aa5810c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 36 deletions.
22 changes: 9 additions & 13 deletions IndustrialPark/ArchiveEditor/ArchiveEditorFunctions_Randomizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ public bool Shuffle(RandomizerFlags flags, float minSpeed, float maxSpeed, float
shuffled = true;
}

if (ShouldShuffle(flags, RandomizerFlags.LODT_Entries, AssetType.LODT))
if (ShouldShuffle(flags, RandomizerFlags.Double_LODT_Distances, AssetType.LODT))
{
ShuffleLODT();
DoubleLODT();
shuffled = true;
}

Expand Down Expand Up @@ -430,25 +430,21 @@ private void ShuffleSounds(bool mixTypes)
}
}

private void ShuffleLODT()
private void DoubleLODT()
{
float min = 0.8f;
float max = 1.6f;
float value = 2f;

foreach (Asset a in assetDictionary.Values)
if (a is AssetLODT lodt)
{
EntryLODT[] entries = lodt.LODT_Entries;

Random r = new Random((int)DateTime.Now.ToBinary());


foreach (var v in entries)
{
float multi = r.NextFloat(min, max);
v.MaxDistance *= multi;
v.LOD1_Distance *= multi;
v.LOD2_Distance *= multi;
v.LOD3_Distance *= multi;
v.MaxDistance *= value;
v.LOD1_Distance *= value;
v.LOD2_Distance *= value;
v.LOD3_Distance *= value;
}

lodt.LODT_Entries = entries;
Expand Down
2 changes: 1 addition & 1 deletion IndustrialPark/Research/Randomizer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions IndustrialPark/Research/RandomizerFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
{
public enum RandomizerFlags
{
LevelFiles = 0x01,
Textures = 0x02,
Sounds = 0x04,
Boulder_Settings = 0x08,
Pickup_Positions = 0x10,
PLAT_Speeds = 0x20,
Tiki_Types = 0x40,
Tiki_Models = 0x80,
Tiki_Allow_Any_Type = 0x100,
MRKR_Positions = 0x200,
DYNA_Pointers = 0x400,
MVPT_Radius = 0x800,
Cameras = 0x1000,
Timers = 0x2000,
LODT_Entries = 0x4000,
____ = 0x8000,
Enemy_Types = 0x10000,
Enemy_Models = 0x20000,
Enemies_Allow_Any_Type = 0x40000,
Mix_SND_SNDS = 0x80000,
SIMP_Positions = 0x100000,
Models = 0x200000
LevelFiles = 1 << 0,
Textures = 1 << 1,
Sounds = 1 << 2,
Boulder_Settings = 1 << 3,
Pickup_Positions = 1 << 4,
PLAT_Speeds = 1 << 5,
Tiki_Types = 1 << 6,
Tiki_Models = 1 << 7,
Tiki_Allow_Any_Type = 1 << 8,
Enemy_Types = 1 << 9,
MRKR_Positions = 1 << 10,
DYNA_Pointers = 1 << 11,
MVPT_Radius = 1 << 12,
Cameras = 1 << 13,
Timers = 1 << 14,
Double_LODT_Distances = 1 << 15,
_Not_Recommended_ = 1 << 16,
Mix_SND_SNDS = 1 << 17,
SIMP_Positions = 1 << 18,
Enemy_Models = 1 << 19,
Enemies_Allow_Any_Type = 1 << 20,
Models = 1 << 21
}
}

0 comments on commit aa5810c

Please sign in to comment.