Terraria 1.4.0.5 Source Code
This commit is contained in:
commit
05205f009e
1059 changed files with 563450 additions and 0 deletions
17
GameContent/LootSimulation/ISimulationConditionSetter.cs
Normal file
17
GameContent/LootSimulation/ISimulationConditionSetter.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.ISimulationConditionSetter
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation
|
||||
{
|
||||
public interface ISimulationConditionSetter
|
||||
{
|
||||
int GetTimesToRunMultiplier(SimulatorInfo info);
|
||||
|
||||
void Setup(SimulatorInfo info);
|
||||
|
||||
void TearDown(SimulatorInfo info);
|
||||
}
|
||||
}
|
62
GameContent/LootSimulation/LootSimulationItemCounter.cs
Normal file
62
GameContent/LootSimulation/LootSimulationItemCounter.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.LootSimulationItemCounter
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation
|
||||
{
|
||||
public class LootSimulationItemCounter
|
||||
{
|
||||
private long[] _itemCountsObtained = new long[5045];
|
||||
private long[] _itemCountsObtainedExpert = new long[5045];
|
||||
private long _totalTimesAttempted;
|
||||
private long _totalTimesAttemptedExpert;
|
||||
|
||||
public void AddItem(int itemId, int amount, bool expert)
|
||||
{
|
||||
if (expert)
|
||||
this._itemCountsObtainedExpert[itemId] += (long) amount;
|
||||
else
|
||||
this._itemCountsObtained[itemId] += (long) amount;
|
||||
}
|
||||
|
||||
public void Exclude(params int[] itemIds)
|
||||
{
|
||||
foreach (int itemId in itemIds)
|
||||
{
|
||||
this._itemCountsObtained[itemId] = 0L;
|
||||
this._itemCountsObtainedExpert[itemId] = 0L;
|
||||
}
|
||||
}
|
||||
|
||||
public void IncreaseTimesAttempted(int amount, bool expert)
|
||||
{
|
||||
if (expert)
|
||||
this._totalTimesAttemptedExpert += (long) amount;
|
||||
else
|
||||
this._totalTimesAttempted += (long) amount;
|
||||
}
|
||||
|
||||
public string PrintCollectedItems(bool expert)
|
||||
{
|
||||
long[] collectionToUse = this._itemCountsObtained;
|
||||
long totalDropsAttempted = this._totalTimesAttempted;
|
||||
if (expert)
|
||||
{
|
||||
collectionToUse = this._itemCountsObtainedExpert;
|
||||
this._totalTimesAttempted = this._totalTimesAttemptedExpert;
|
||||
}
|
||||
return string.Join(",\n", ((IEnumerable<long>) collectionToUse).Select((count, itemId) => new
|
||||
{
|
||||
itemId = itemId,
|
||||
count = count
|
||||
}).Where(entry => entry.count > 0L).Select(entry => entry.itemId).Select<int, string>((Func<int, string>) (itemId => string.Format("new ItemDropInfo(ItemID.{0}, {1}, {2})", (object) ItemID.Search.GetName(itemId), (object) collectionToUse[itemId], (object) totalDropsAttempted))));
|
||||
}
|
||||
}
|
||||
}
|
121
GameContent/LootSimulation/LootSimulator.cs
Normal file
121
GameContent/LootSimulation/LootSimulator.cs
Normal file
|
@ -0,0 +1,121 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.LootSimulator
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
using ReLogic.OS;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation
|
||||
{
|
||||
public class LootSimulator
|
||||
{
|
||||
private List<ISimulationConditionSetter> _neededTestConditions = new List<ISimulationConditionSetter>();
|
||||
private int[] _excludedItemIds = new int[0];
|
||||
|
||||
public LootSimulator()
|
||||
{
|
||||
this.FillDesiredTestConditions();
|
||||
this.FillItemExclusions();
|
||||
}
|
||||
|
||||
private void FillItemExclusions()
|
||||
{
|
||||
List<int> intList = new List<int>();
|
||||
intList.AddRange(((IEnumerable<bool>) ItemID.Sets.IsAPickup).Select((state, index) => new
|
||||
{
|
||||
index = index,
|
||||
state = state
|
||||
}).Where(tuple => tuple.state).Select(tuple => tuple.index));
|
||||
intList.AddRange(((IEnumerable<bool>) ItemID.Sets.CommonCoin).Select((state, index) => new
|
||||
{
|
||||
index = index,
|
||||
state = state
|
||||
}).Where(tuple => tuple.state).Select(tuple => tuple.index));
|
||||
this._excludedItemIds = intList.ToArray();
|
||||
}
|
||||
|
||||
private void FillDesiredTestConditions() => this._neededTestConditions.AddRange((IEnumerable<ISimulationConditionSetter>) new List<ISimulationConditionSetter>()
|
||||
{
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.MidDay,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.MidNight,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.HardMode,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.ExpertMode,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.ExpertAndHardMode,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.WindyExpertHardmodeEndgameBloodMoonNight,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.WindyExpertHardmodeEndgameEclipseMorning,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.SlimeStaffTest,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.LuckyCoinTest
|
||||
});
|
||||
|
||||
public void Run()
|
||||
{
|
||||
int timesMultiplier = 10000;
|
||||
this.SetCleanSlateWorldConditions();
|
||||
string str1 = "";
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
for (int npcNetId = -65; npcNetId < 663; ++npcNetId)
|
||||
{
|
||||
string outputText;
|
||||
if (this.TryGettingLootFor(npcNetId, timesMultiplier, out outputText))
|
||||
str1 = str1 + outputText + "\n\n";
|
||||
}
|
||||
stopwatch.Stop();
|
||||
string str2 = str1 + string.Format("\nSimulation Took {0} seconds to complete.\n", (object) (float) ((double) stopwatch.ElapsedMilliseconds / 1000.0));
|
||||
Platform.Get<IClipboard>().Value = str2;
|
||||
}
|
||||
|
||||
private void SetCleanSlateWorldConditions()
|
||||
{
|
||||
Main.dayTime = true;
|
||||
Main.time = 27000.0;
|
||||
Main.hardMode = false;
|
||||
Main.GameMode = 0;
|
||||
NPC.downedMechBoss1 = false;
|
||||
NPC.downedMechBoss2 = false;
|
||||
NPC.downedMechBoss3 = false;
|
||||
NPC.downedMechBossAny = false;
|
||||
NPC.downedPlantBoss = false;
|
||||
Main._shouldUseWindyDayMusic = false;
|
||||
Main._shouldUseStormMusic = false;
|
||||
Main.eclipse = false;
|
||||
Main.bloodMoon = false;
|
||||
}
|
||||
|
||||
private bool TryGettingLootFor(int npcNetId, int timesMultiplier, out string outputText)
|
||||
{
|
||||
SimulatorInfo info = new SimulatorInfo();
|
||||
NPC npc = new NPC();
|
||||
npc.SetDefaults(npcNetId);
|
||||
info.npcVictim = npc;
|
||||
LootSimulationItemCounter simulationItemCounter = new LootSimulationItemCounter();
|
||||
info.itemCounter = simulationItemCounter;
|
||||
foreach (ISimulationConditionSetter neededTestCondition in this._neededTestConditions)
|
||||
{
|
||||
neededTestCondition.Setup(info);
|
||||
int amount = neededTestCondition.GetTimesToRunMultiplier(info) * timesMultiplier;
|
||||
for (int index = 0; index < amount; ++index)
|
||||
npc.NPCLoot();
|
||||
simulationItemCounter.IncreaseTimesAttempted(amount, info.runningExpertMode);
|
||||
neededTestCondition.TearDown(info);
|
||||
this.SetCleanSlateWorldConditions();
|
||||
}
|
||||
simulationItemCounter.Exclude(((IEnumerable<int>) this._excludedItemIds).ToArray<int>());
|
||||
string str1 = simulationItemCounter.PrintCollectedItems(false);
|
||||
string str2 = simulationItemCounter.PrintCollectedItems(true);
|
||||
string str3 = string.Format("FindEntryByNPCID(NPCID.{0})", (object) NPCID.Search.GetName(npcNetId));
|
||||
if (str1.Length > 0)
|
||||
str3 = string.Format("{0}\n.AddDropsNormalMode({1})", (object) str3, (object) str1);
|
||||
if (str2.Length > 0)
|
||||
str3 = string.Format("{0}\n.AddDropsExpertMode({1})", (object) str3, (object) str2);
|
||||
string str4 = str3 + ";";
|
||||
outputText = str4;
|
||||
return str1.Length > 0 || str2.Length > 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes.FastConditionSetter
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
using System;
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes
|
||||
{
|
||||
public class FastConditionSetter : ISimulationConditionSetter
|
||||
{
|
||||
private Action<SimulatorInfo> _setup;
|
||||
private Action<SimulatorInfo> _tearDown;
|
||||
|
||||
public FastConditionSetter(Action<SimulatorInfo> setup, Action<SimulatorInfo> tearDown)
|
||||
{
|
||||
this._setup = setup;
|
||||
this._tearDown = tearDown;
|
||||
}
|
||||
|
||||
public void Setup(SimulatorInfo info)
|
||||
{
|
||||
if (this._setup == null)
|
||||
return;
|
||||
this._setup(info);
|
||||
}
|
||||
|
||||
public void TearDown(SimulatorInfo info)
|
||||
{
|
||||
if (this._tearDown == null)
|
||||
return;
|
||||
this._tearDown(info);
|
||||
}
|
||||
|
||||
public int GetTimesToRunMultiplier(SimulatorInfo info) => 1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes.LuckyCoinConditionSetter
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes
|
||||
{
|
||||
public class LuckyCoinConditionSetter : ISimulationConditionSetter
|
||||
{
|
||||
private int _timesToRun;
|
||||
|
||||
public LuckyCoinConditionSetter(int timesToRunMultiplier) => this._timesToRun = timesToRunMultiplier;
|
||||
|
||||
public int GetTimesToRunMultiplier(SimulatorInfo info)
|
||||
{
|
||||
switch (info.npcVictim.netID)
|
||||
{
|
||||
case 216:
|
||||
case 491:
|
||||
return this._timesToRun;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void Setup(SimulatorInfo info)
|
||||
{
|
||||
}
|
||||
|
||||
public void TearDown(SimulatorInfo info)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes.SlimeStaffConditionSetter
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes
|
||||
{
|
||||
public class SlimeStaffConditionSetter : ISimulationConditionSetter
|
||||
{
|
||||
private int _timesToRun;
|
||||
|
||||
public SlimeStaffConditionSetter(int timesToRunMultiplier) => this._timesToRun = timesToRunMultiplier;
|
||||
|
||||
public int GetTimesToRunMultiplier(SimulatorInfo info)
|
||||
{
|
||||
switch (info.npcVictim.netID)
|
||||
{
|
||||
case -33:
|
||||
case -32:
|
||||
case -10:
|
||||
case -9:
|
||||
case -8:
|
||||
case -7:
|
||||
case -6:
|
||||
case -5:
|
||||
case -4:
|
||||
case -3:
|
||||
case 1:
|
||||
case 16:
|
||||
case 138:
|
||||
case 141:
|
||||
case 147:
|
||||
case 184:
|
||||
case 187:
|
||||
case 204:
|
||||
case 302:
|
||||
case 333:
|
||||
case 334:
|
||||
case 335:
|
||||
case 336:
|
||||
case 433:
|
||||
case 535:
|
||||
case 537:
|
||||
return this._timesToRun;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void Setup(SimulatorInfo info)
|
||||
{
|
||||
}
|
||||
|
||||
public void TearDown(SimulatorInfo info)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes.StackedConditionSetter
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes
|
||||
{
|
||||
public class StackedConditionSetter : ISimulationConditionSetter
|
||||
{
|
||||
private ISimulationConditionSetter[] _setters;
|
||||
|
||||
public StackedConditionSetter(params ISimulationConditionSetter[] setters) => this._setters = setters;
|
||||
|
||||
public void Setup(SimulatorInfo info)
|
||||
{
|
||||
for (int index = 0; index < this._setters.Length; ++index)
|
||||
this._setters[index].Setup(info);
|
||||
}
|
||||
|
||||
public void TearDown(SimulatorInfo info)
|
||||
{
|
||||
for (int index = 0; index < this._setters.Length; ++index)
|
||||
this._setters[index].TearDown(info);
|
||||
}
|
||||
|
||||
public int GetTimesToRunMultiplier(SimulatorInfo info) => 1;
|
||||
}
|
||||
}
|
82
GameContent/LootSimulation/SimulationConditionSetters.cs
Normal file
82
GameContent/LootSimulation/SimulationConditionSetters.cs
Normal file
|
@ -0,0 +1,82 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.SimulationConditionSetters
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
using System;
|
||||
using Terraria.GameContent.LootSimulation.LootSimulatorConditionSetterTypes;
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation
|
||||
{
|
||||
public class SimulationConditionSetters
|
||||
{
|
||||
public static FastConditionSetter HardMode = new FastConditionSetter((Action<SimulatorInfo>) (info => Main.hardMode = true), (Action<SimulatorInfo>) (info => Main.hardMode = false));
|
||||
public static FastConditionSetter ExpertMode = new FastConditionSetter((Action<SimulatorInfo>) (info =>
|
||||
{
|
||||
Main.GameMode = 1;
|
||||
info.runningExpertMode = true;
|
||||
}), (Action<SimulatorInfo>) (info =>
|
||||
{
|
||||
Main.GameMode = 0;
|
||||
info.runningExpertMode = false;
|
||||
}));
|
||||
public static FastConditionSetter Eclipse = new FastConditionSetter((Action<SimulatorInfo>) (info => Main.eclipse = true), (Action<SimulatorInfo>) (info => Main.eclipse = false));
|
||||
public static FastConditionSetter BloodMoon = new FastConditionSetter((Action<SimulatorInfo>) (info => Main.bloodMoon = true), (Action<SimulatorInfo>) (info => Main.bloodMoon = false));
|
||||
public static FastConditionSetter SlainMechBosses = new FastConditionSetter((Action<SimulatorInfo>) (info =>
|
||||
{
|
||||
int num;
|
||||
NPC.downedMechBossAny = (num = 1) != 0;
|
||||
NPC.downedMechBoss3 = num != 0;
|
||||
NPC.downedMechBoss2 = num != 0;
|
||||
NPC.downedMechBoss1 = num != 0;
|
||||
}), (Action<SimulatorInfo>) (info =>
|
||||
{
|
||||
int num;
|
||||
NPC.downedMechBossAny = (num = 0) != 0;
|
||||
NPC.downedMechBoss3 = num != 0;
|
||||
NPC.downedMechBoss2 = num != 0;
|
||||
NPC.downedMechBoss1 = num != 0;
|
||||
}));
|
||||
public static FastConditionSetter SlainPlantera = new FastConditionSetter((Action<SimulatorInfo>) (info => NPC.downedPlantBoss = true), (Action<SimulatorInfo>) (info => NPC.downedPlantBoss = false));
|
||||
public static StackedConditionSetter ExpertAndHardMode = new StackedConditionSetter(new ISimulationConditionSetter[2]
|
||||
{
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.ExpertMode,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.HardMode
|
||||
});
|
||||
public static FastConditionSetter WindyWeather = new FastConditionSetter((Action<SimulatorInfo>) (info => Main._shouldUseWindyDayMusic = true), (Action<SimulatorInfo>) (info => Main._shouldUseWindyDayMusic = false));
|
||||
public static FastConditionSetter MidDay = new FastConditionSetter((Action<SimulatorInfo>) (info =>
|
||||
{
|
||||
Main.dayTime = true;
|
||||
Main.time = 27000.0;
|
||||
}), (Action<SimulatorInfo>) (info => info.ReturnToOriginalDaytime()));
|
||||
public static FastConditionSetter MidNight = new FastConditionSetter((Action<SimulatorInfo>) (info =>
|
||||
{
|
||||
Main.dayTime = false;
|
||||
Main.time = 16200.0;
|
||||
}), (Action<SimulatorInfo>) (info => info.ReturnToOriginalDaytime()));
|
||||
public static FastConditionSetter SlimeRain = new FastConditionSetter((Action<SimulatorInfo>) (info => Main.slimeRain = true), (Action<SimulatorInfo>) (info => Main.slimeRain = false));
|
||||
public static StackedConditionSetter WindyExpertHardmodeEndgameEclipseMorning = new StackedConditionSetter(new ISimulationConditionSetter[7]
|
||||
{
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.WindyWeather,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.ExpertMode,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.HardMode,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.SlainMechBosses,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.SlainPlantera,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.Eclipse,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.MidDay
|
||||
});
|
||||
public static StackedConditionSetter WindyExpertHardmodeEndgameBloodMoonNight = new StackedConditionSetter(new ISimulationConditionSetter[7]
|
||||
{
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.WindyWeather,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.ExpertMode,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.HardMode,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.SlainMechBosses,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.SlainPlantera,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.BloodMoon,
|
||||
(ISimulationConditionSetter) SimulationConditionSetters.MidNight
|
||||
});
|
||||
public static SlimeStaffConditionSetter SlimeStaffTest = new SlimeStaffConditionSetter(100);
|
||||
public static LuckyCoinConditionSetter LuckyCoinTest = new LuckyCoinConditionSetter(100);
|
||||
}
|
||||
}
|
40
GameContent/LootSimulation/SimulatorInfo.cs
Normal file
40
GameContent/LootSimulation/SimulatorInfo.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.LootSimulation.SimulatorInfo
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace Terraria.GameContent.LootSimulation
|
||||
{
|
||||
public class SimulatorInfo
|
||||
{
|
||||
public Player player;
|
||||
private double _originalDayTimeCounter;
|
||||
private bool _originalDayTimeFlag;
|
||||
private Vector2 _originalPlayerPosition;
|
||||
public bool runningExpertMode;
|
||||
public LootSimulationItemCounter itemCounter;
|
||||
public NPC npcVictim;
|
||||
|
||||
public SimulatorInfo()
|
||||
{
|
||||
this.player = new Player();
|
||||
this._originalDayTimeCounter = Main.time;
|
||||
this._originalDayTimeFlag = Main.dayTime;
|
||||
this._originalPlayerPosition = this.player.position;
|
||||
this.runningExpertMode = false;
|
||||
}
|
||||
|
||||
public void ReturnToOriginalDaytime()
|
||||
{
|
||||
Main.dayTime = this._originalDayTimeFlag;
|
||||
Main.time = this._originalDayTimeCounter;
|
||||
}
|
||||
|
||||
public void AddItem(int itemId, int amount) => this.itemCounter.AddItem(itemId, amount, this.runningExpertMode);
|
||||
|
||||
public void ReturnToOriginalPlayerPosition() => this.player.position = this._originalPlayerPosition;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue